Read the statement by Michael Teeuw here.
Unrecognized Config file
-
@dejayou you’re still using the wrong ones
/* Magic Mirror Config Sample By Michael Teeuw http://michaelteeuw.nl MIT Licensed. */ var config = { port: 8080, language: 'en', timeFormat: 24, units: 'metric', modules: [{ module: 'alert' }, { module: 'wuforecast', position: 'top_right', // This can be any of the regions. // Best results in left or right regions. config: { // See ‘Configuration options’ for more information. location: 'Cleveland', appid: '5095830b868b90bcc31affdad4911325' //wunderground.com API key. } }, { module: 'clock', position: 'top_left' }, { module: 'calendar', header: 'US Holidays', position: 'top_left', config: { calendars: [{ symbol: 'calendar-check-o ', url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics' }] } }, { module: 'compliments', position: 'lower_third' }, { module: 'currentweather', position: 'top_right', config: { location: 'Cleveland', locationID: '4614088', //ID from bulk.openweather.org/sample/ appid: '5095830b868b90bcc31affdad4911325' } }, { module: 'weatherforecast', position: 'top_right', header: 'Weather Forecast', config: { location: 'Cleveland', locationID: '4614088', //ID from bulk.openweather.org/sample/ appid: '5095830b868b90bcc31affdad4911325' } }, { module: 'newsfeed', position: 'bottom_bar', config: { feeds: [{ title: 'New York Times', url: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml' }], showSourceTitle: true, showPublishDate: true } } ] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== 'undefined') { module.exports = config; }
-
That’s odd. In the actual source code I am using the double quotes, but then in your yellow block text readout is somehow reverts back to single quotes in those same instances. Is this a Javascript thing?
-
@strawberry-3.141 So i’ve gone back through on the Linux system and checked that OS system and sure enough, when copying and pasting from a PC (here) and to a Linux, or vice versa, these quote marks have a tendency to alter.
At any rate, the code in the config file is now in a place where everything checks out ok in both the JSHint and JSLint tools, save for the last portion beneath the final line of demarcation where it reads not to edit the lines of code.
Here the error reads:
undeclared ‘module’.
if (typeof module !== “undefined”) {
unexpected ‘typeof’. Use ‘===’ to compare directly with undefined.
if (typeof module !== “undefined”) {
undeclared 'module"
module.exports = config;Is this why the config file ultimately won’t be recognized by my raspberry pi/magic mirror program?
-
Do not copy/paste from one OS to another, the language translations between them will be different, UTF-8, Windows, it’s all foobar. Edit the config file ON the rpi. You can use the command
'nano'
for that, as in'nano config.js'
. Doing the copy/paste is why your ‘'
’, ‘"
’ and others get translated wrong. -
Thanks KirAsh4. I am assuming that you meant to open the actual Terminal and edit the config file directly from within that environment, which is what I did with still no luck.
At this point I really don’t know what else to do. I am going to try and essentially start over from the beginning and see if I have better luck.
-
Yep, open Terminal and edit there, or use an SSH client remotely. The config is a bit finicky I discovered. Try not to change the layout too much, like for example, in your pastes above, I see this:
}, {
… in between modules. While I don’t think that would cause a problem, it also wouldn’t surprise me if that’s tripping up the parser. Keep them on separate lines:
}, {
-
Hi KirAsh4 -
After walking back through this setup tutorial again (https://forum.magicmirror.builders/topic/236/complete-setup-tutorial/) I am happy to report that I am no longer getting the error message asking about setting up a config file. Instead I now arrive at a blank black screen, absent any copy or modules. Do you know what might be causing this to occur?
-
Likely a bug recently discovered. Follow the instructions in the first post here to try the
'develop'
branch:https://forum.magicmirror.builders/topic/445/looking-for-beta-testers
-
This post is deleted!