<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Config.js file   Syntax]]></title><description><![CDATA[<p dir="auto">Hello Everyone,<br />
I’ve been working on this “weekend project” for the past 3 weeks!!! ahahah<br />
I started by having 0% clue of what I was doing to falling in love with the Terminal (Love/hate relationship)<br />
I’m so close to complete my first Magic Mirror but I’m stuck in two places. The first is:<br />
Keeps asking me to create and/or check my config.js file, I eliminated the config.js sample,<br />
After using JSHint I found out that some lines might be wrong. Is someone so kind to give a quick peak for me? please and thank you:</p>
<pre><code>/* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information how you can configurate this file
 * See https://github.com/MichMich/MagicMirror#configuration
 *
 */

var config = {
	port: 8080,
	ipWhitelist: ["10.0.0.231/24", "::ffff:10.0.0.1/112", "::1", "::ffff127.0.0.1/24"]
                                                         // Set [] to allow all IP addresses
	                                                       // or add a specific IPv4 of 192.168.1.5 :
	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
	                                                       // or IPv4 range of 192.168.3.0 --&gt; 192.168.3.15 use CIDR format :
	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

};


language="en",
  timezone: true;
	units: "metric",

modules: [
		
var time = {
	timeFormat: config.time.timeFormat || 24,
	dateLocation: '.date',
	timeLocation: '.time',
	updateInterval: 1000,
	intervalId: null
};

/**
 * Updates the time that is shown on the screen
 */
time.updateTime = function () {

	var _now = moment(),
		_date = _now.format('dddd, LL');

	$(this.dateLocation).html(_date);
	$(this.timeLocation).html(_now.format(this._timeFormat+':mm[]ss[]'));

}

time.init = function () {

	if (parseInt(time.timeFormat) === 12) {
		time._timeFormat = 'hh'
	} else {
		time._timeFormat = 'HH';
	}

	this.intervalId = setInterval(function () {
		this.updateTime();
	}.bind(this), 1000);

},

 
var calendar = {
	eventList: [],
	calendarLocation: '.calendar',
	updateInterval: 1000,
	updateDataInterval: 60000,
	fadeInterval: 1000,
	intervalId: null,
	dataIntervalId: null,
	maximumEntries: config.calendar.maximumEntries || 10
}

calendar.updateData = function (callback) {

	new ical_parser("calendar.php" + "?url="+encodeURIComponent(config.calendar.url), function(cal) {
		var events = cal.getEvents();
		this.eventList = [];

		for (var i in events) {

			var e = events[i];
			for (var key in e) {
				var value = e[key];
				var seperator = key.search(';');
				if (seperator &gt;= 0) {
					var mainKey = key.substring(0,seperator);
					var subKey = key.substring(seperator+1);

					var dt;
					if (subKey == 'VALUE=DATE') {
						//date
						dt = new Date(value.substring(0,4), value.substring(4,6) - 1, value.substring(6,8));
					} else {
						//time
						dt = new Date(value.substring(0,4), value.substring(4,6) - 1, value.substring(6,8), value.substring(9,11), value.substring(11,13), value.substring(13,15));
					}

					if (mainKey == 'DTSTART') e.startDate = dt;
					if (mainKey == 'DTEND') e.endDate = dt;
				}
			}

			if (e.startDate == undefined){
				//some old events in Gmail Calendar is "start_date"
				//FIXME: problems with Gmail's TimeZone
				var days = moment(e.DTSTART).diff(moment(), 'days');
				var seconds = moment(e.DTSTART).diff(moment(), 'seconds');
				var startDate = moment(e.DTSTART);
			} else {
				var days = moment(e.startDate).diff(moment(), 'days');
				var seconds = moment(e.startDate).diff(moment(), 'seconds');
				var startDate = moment(e.startDate);
			}

			//only add fututre events, days doesn't work, we need to check seconds
			if (seconds &gt;= 0) {
				if (seconds = 60*60*24*2) {
					var time_string = moment(startDate).fromNow();
				}else {
					var time_string = moment(startDate).calendar()
				}
				if (!e.RRULE) {
					this.eventList.push({'description':e.SUMMARY,'seconds':seconds,'days':time_string});
				}
				e.seconds = seconds;
			}
			
			// Special handling for rrule events
			if (e.RRULE) {
				var options = new RRule.parseString(e.RRULE);
				options.dtstart = e.startDate;
				var rule = new RRule(options);
				
				// TODO: don't use fixed end date here, use something like now() + 1 year
				var dates = rule.between(new Date(), new Date(2016,11,31), true, function (date, i){return i &lt; 10});
				for (date in dates) {
					var dt = new Date(dates[date]);
					var days = moment(dt).diff(moment(), 'days');
					var seconds = moment(dt).diff(moment(), 'seconds');
					var startDate = moment(dt);
					if (seconds &gt;= 0) {
						if (seconds = 60*60*24*2) {
							var time_string = moment(dt).fromNow();
						} else {
							var time_string = moment(dt).calendar()
						}
						this.eventList.push({'description':e.SUMMARY,'seconds':seconds,'days':time_string});
					}           
				}
			}
		};

		this.eventList = this.eventList.sort(function(a,b){return a.seconds-b.seconds});

		// Limit the number of entries.
		this.eventList = this.eventList.slice(0, calendar.maximumEntries);

		if (callback !== undefined &amp;&amp; Object.prototype.toString.call(callback) === '[object Function]') {
			callback(this.eventList);
		}

	}.bind(this));

}

calendar.updateCalendar = function (eventList) {

	table = $('&lt;table&gt;').addClass('xsmall').addClass('calendar-table');
	opacity = 1;

	for (var i in eventList) {
		var e = eventList[i];

		var row = $('&lt;tr&gt;').css('opacity',opacity);
		row.append($('&lt;td&gt;').html(e.description).addClass('description'));
		row.append($('&lt;/td&gt;&lt;td&gt;').html(e.days).addClass('days dimmed'));
		table.append(row);

		opacity -= 1 / eventList.length;
	}

	$(this.calendarLocation).updateWithText(table, this.fadeInterval);

}

calendar.init = function () {

	this.updateData(this.updateCalendar.bind(this));

	this.intervalId = setInterval(function () {
		this.updateCalendar(this.eventList)
	}.bind(this), this.updateInterval);

	this.dataIntervalId = setInterval(function () {
		this.updateData(this.updateCalendar.bind(this));
	}.bind(this), this.updateDataInterval);

},

var compliments = {
	complimentLocation: '.compliment',
	currentCompliment: '',
	complimentList: {
		'morning': config.compliments.morning,
		'afternoon': config.compliments.afternoon,
		'evening': config.compliments.evening
	},
	updateInterval: config.compliments.interval || 30000,
	fadeInterval: config.compliments.fadeInterval || 4000,
	intervalId: null
};

/**
 * Changes the compliment visible on the screen
 */
compliments.updateCompliment = function () {



	var _list = [];

	var hour = moment().hour();

	// In the followign if statement we use .slice() on the
	// compliments array to make a copy by value. 
	// This way the original array of compliments stays in tact.

	if (hour &gt;= 3 &amp;&amp; hour &lt; 12) {
		// Morning compliments
		_list = compliments.complimentList['morning'].slice();
	} else if (hour &gt;= 12 &amp;&amp; hour &lt; 17) {
		// Afternoon compliments
		_list = compliments.complimentList['afternoon'].slice();
	} else if (hour &gt;= 17 || hour &lt; 3) {
		// Evening compliments
		_list = compliments.complimentList['evening'].slice();
	} else {
		// Edge case in case something weird happens
		// This will select a compliment from all times of day
		Object.keys(compliments.complimentList).forEach(function (_curr) {
			_list = _list.concat(compliments.complimentList[_curr]).slice();
		});
	}

	// Search for the location of the current compliment in the list
	var _spliceIndex = _list.indexOf(compliments.currentCompliment);

	// If it exists, remove it so we don't see it again
	if (_spliceIndex !== -1) {
		_list.splice(_spliceIndex, 1);
	}

	// Randomly select a location
	var _randomIndex = Math.floor(Math.random() * _list.length);
	compliments.currentCompliment = _list[_randomIndex];

	$('.compliment').updateWithText(compliments.currentCompliment, compliments.fadeInterval);

}

compliments.init = function () {

	this.updateCompliment();

	this.intervalId = setInterval(function () {
		this.updateCompliment();
	}.bind(this), this.updateInterval)

},

		var weather = {
	// Default language is Dutch because that is what the original author used
	lang: config.lang || 'nl',
	params: config.weather.params || null,
	iconTable: {
		'01d':'wi-day-sunny',
		'02d':'wi-day-cloudy',
		'03d':'wi-cloudy',
		'04d':'wi-cloudy-windy',
		'09d':'wi-showers',
		'10d':'wi-rain',
		'11d':'wi-thunderstorm',
		'13d':'wi-snow',
		'50d':'wi-fog',
		'01n':'wi-night-clear',
		'02n':'wi-night-cloudy',
		'03n':'wi-night-cloudy',
		'04n':'wi-night-cloudy',
		'09n':'wi-night-showers',
		'10n':'wi-night-rain',
		'11n':'wi-night-thunderstorm',
		'13n':'wi-night-snow',
		'50n':'wi-night-alt-cloudy-windy'
	},
	temperatureLocation: '.temp',
	windSunLocation: '.windsun',
	forecastLocation: '.forecast',
	apiVersion: '2.5',
	apiBase: 'http://api.openweathermap.org/data/',
	weatherEndpoint: 'weather',
	forecastEndpoint: 'forecast/daily',
	updateInterval: config.weather.interval || 6000,
	fadeInterval: config.weather.fadeInterval || 1000,
	intervalId: null
}

/**
 * Rounds a float to one decimal place
 * @param  {float} temperature The temperature to be rounded
 * @return {float}             The new floating point value
 */
weather.roundValue = function (temperature) {
	return parseFloat(temperature).toFixed(1);
}

/**
 * Converts the wind speed (km/h) into the values given by the Beaufort Wind Scale
 * @see http://www.spc.noaa.gov/faq/tornado/beaufort.html
 * @param  {int} kmh The wind speed in Kilometers Per Hour
 * @return {int}     The wind speed converted into its corresponding Beaufort number
 */
weather.ms2Beaufort = function(ms) {
	var kmh = ms * 60 * 60 / 1000;
	var speeds = [1, 5, 11, 19, 28, 38, 49, 61, 74, 88, 102, 117, 1000];
	for (var beaufort in speeds) {
		var speed = speeds[beaufort];
		if (speed &gt; kmh) {
			return beaufort;
		}
	}
	return 12;
}

/**
 * Retrieves the current temperature and weather patter from the OpenWeatherMap API
 */
weather.updateCurrentWeather = function () {

	$.ajax({
		type: 'GET',
		url: weather.apiBase + '/' + weather.apiVersion + '/' + weather.weatherEndpoint,
		dataType: 'json',
		data: weather.params,
		success: function (data) {

			var _temperature = this.roundValue(data.main.temp),
				_temperatureMin = this.roundValue(data.main.temp_min),
				_temperatureMax = this.roundValue(data.main.temp_max),
				_wind = this.roundValue(data.wind.speed),
				_iconClass = this.iconTable[data.weather[0].icon];

			var _icon = '';

			var _newTempHtml = _icon + '' + _temperature + '°';

			$(this.temperatureLocation).updateWithText(_newTempHtml, this.fadeInterval);

			var _now = moment().format('HH:mm'),
				_sunrise = moment(data.sys.sunrise*1000).format('HH:mm'),
				_sunset = moment(data.sys.sunset*1000).format('HH:mm');

			var _newWindHtml = ' ' + this.ms2Beaufort(_wind),
				_newSunHtml = ' ' + _sunrise;

			if (_sunrise &lt; _now &amp;&amp; _sunset &gt; _now) {
				_newSunHtml = ' ' + _sunset;
			}

			$(this.windSunLocation).updateWithText(_newWindHtml + ' ' + _newSunHtml, this.fadeInterval);

		}.bind(this),
		error: function () {

		}
	});

}

/**
 * Updates the 5 Day Forecast from the OpenWeatherMap API
 */
weather.updateWeatherForecast = function () {

	$.ajax({
		type: 'GET',
		url: weather.apiBase + '/' + weather.apiVersion + '/' + weather.forecastEndpoint,
		data: weather.params,
		success: function (data) {

			var _opacity = 1,
				_forecastHtml = '';

			_forecastHtml += '&lt;table&gt;';

			for (var i = 0, count = data.list.length; i &lt; count; i++) {

				var _forecast = data.list[i];

				_forecastHtml += '&lt;tr&gt;';

				_forecastHtml += '&lt;td&gt;' + moment(_forecast.dt, 'X').format('ddd') + '&lt;/td&gt;';
				_forecastHtml += '&lt;td&gt;&lt;/td&gt;';
				_forecastHtml += '&lt;td&gt;' + this.roundValue(_forecast.temp.max) + '&lt;/td&gt;';
				_forecastHtml += '&lt;td&gt;' + this.roundValue(_forecast.temp.min) + '&lt;/td&gt;';

				_forecastHtml += '&lt;/tr&gt;';

				_opacity -= 0.155;

			}

			_forecastHtml += '&lt;/table&gt;';

			$(this.forecastLocation).updateWithText(_forecastHtml, this.fadeInterval);

		}.bind(this),
		error: function () {

		}
	});

}

weather.init = function () {

	if (this.params.lang === undefined) {
		this.params.lang = this.lang;
	}

	if (this.params.cnt === undefined) {
		this.params.cnt = 5;
	}

	this.intervalId = setInterval(function () {
		this.updateCurrentWeather();
		this.updateWeatherForecast();
	}.bind(this), this.updateInterval);

},

		
		// A lot of this code is from the original feedToJson function that was included with this project
// The new code allows for multiple feeds to be used but a bunch of variables and such have literally been copied and pasted into this code and some help from here: http://jsfiddle.net/BDK46/
// The original version can be found here: http://airshp.com/2011/jquery-plugin-feed-to-json/
var news = {
	feed: config.news.feed || null,
	newsLocation: '.news',
	newsItems: [],
	seenNewsItem: [],
	_yqURL: 'http://query.yahooapis.com/v1/public/yql',
	_yqlQS: '?format=json&amp;q=select%20*%20from%20rss%20where%20url%3D',
	_cacheBuster: Math.floor((new Date().getTime()) / 1200 / 1000),
	_failedAttempts: 0,
	fetchInterval: config.news.fetchInterval || 60000,
	updateInterval: config.news.interval || 5500,
	fadeInterval: 2000,
	intervalId: null,
	fetchNewsIntervalId: null
}

/**
 * Creates the query string that will be used to grab a converted RSS feed into a JSON object via Yahoo
 * @param  {string} feed The original location of the RSS feed
 * @return {string}      The new location of the RSS feed provided by Yahoo
 */
news.buildQueryString = function (feed) {

	return this._yqURL + this._yqlQS + '\'' + encodeURIComponent(feed) + '\'';

}

/**
 * Fetches the news for each feed provided in the config file
 */
news.fetchNews = function () {

	// Reset the news feed
	this.newsItems = [];

	this.feed.forEach(function (_curr) {

		var _yqUrlString = this.buildQueryString(_curr);
		this.fetchFeed(_yqUrlString);

	}.bind(this));

}

/**
 * Runs a GET request to Yahoo's service
 * @param  {string} yqUrl The URL being used to grab the RSS feed (in JSON format)
 */
news.fetchFeed = function (yqUrl) {

	$.ajax({
		type: 'GET',
		datatype:'jsonp',
		url: yqUrl,
		success: function (data) {

			if (data.query.count &gt; 0) {
				this.parseFeed(data.query.results.item);
			} else {
				console.error('No feed results for: ' + yqUrl);
			}

		}.bind(this),
		error: function () {
			// non-specific error message that should be updated
			console.error('No feed results for: ' + yqUrl);
		}
	});

}

/**
 * Parses each item in a single news feed
 * @param  {Object} data The news feed that was returned by Yahoo
 * @return {boolean}      Confirms that the feed was parsed correctly
 */
news.parseFeed = function (data) {

	var _rssItems = [];

	for (var i = 0, count = data.length; i &lt; count; i++) {

		_rssItems.push(data[i].title);

	}

	this.newsItems = this.newsItems.concat(_rssItems);

	return true;

}

/**
 * Loops through each available and unseen news feed after it has been retrieved from Yahoo and shows it on the screen
 * When all news titles have been exhausted, the list resets and randomly chooses from the original set of items
 * @return {boolean} Confirms that there is a list of news items to loop through and that one has been shown on the screen
 */
news.showNews = function () {

	// If all items have been seen, swap seen to unseen
	if (this.newsItems.length === 0 &amp;&amp; this.seenNewsItem.length !== 0) {

		if (this._failedAttempts === 20) {
			console.error('Failed to show a news story 20 times, stopping any attempts');
			return false;
		}

		this._failedAttempts++;

		setTimeout(function () {
			this.showNews();
		}.bind(this), 3000);

	} else if (this.newsItems.length === 0 &amp;&amp; this.seenNewsItem.length !== 0) {
		this.newsItems = this.seenNewsItem.splice(0);
	}

	var _location = Math.floor(Math.random() * this.newsItems.length);

	var _item = news.newsItems.splice(_location, 1)[0];

	this.seenNewsItem.push(_item);

	$(this.newsLocation).updateWithText(_item, this.fadeInterval);

	return true;

}

news.init = function () {

	if (this.feed === null || (this.feed instanceof Array === false &amp;&amp; typeof this.feed !== 'string')) {
		return false;
	} else if (typeof this.feed === 'string') {
		this.feed = [this.feed];
	}

	this.fetchNews();
	this.showNews();

	this.fetchNewsIntervalId = setInterval(function () {
		this.fetchNews()
	}.bind(this), this.fetchInterval)

	this.intervalId = setInterval(function () {
		this.showNews();
	}.bind(this), this.updateInterval);

},

	]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

	
```&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/4308/config-js-file-syntax</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 14:20:24 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/4308.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Jul 2017 04:01:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 14 Jul 2017 17:16:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jade" aria-label="Profile: jade">@<bdi>jade</bdi></a> said in <a href="/post/25335">Config.js file Syntax</a>:</p>
<blockquote>
<p dir="auto">now I have a working mirror that sporadically gives me game of thrones quotes! My office at work is now much brighter!</p>
</blockquote>
<p dir="auto">Well, you do until he kills off another Stark child.</p>
]]></description><link>https://forum.magicmirror.builders/post/25342</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25342</guid><dc:creator><![CDATA[bhepler]]></dc:creator><pubDate>Fri, 14 Jul 2017 17:16:15 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 14 Jul 2017 12:39:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/anhalter42" aria-label="Profile: Anhalter42">@<bdi>Anhalter42</bdi></a> Ok, it’s all good, I just took the ipWhitelist section from the sample pasted it in and now I have a working mirror that sporadically gives me game of thrones quotes! My office at work is now much brighter!</p>
]]></description><link>https://forum.magicmirror.builders/post/25335</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25335</guid><dc:creator><![CDATA[jade]]></dc:creator><pubDate>Fri, 14 Jul 2017 12:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 14 Jul 2017 12:22:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/anhalter42" aria-label="Profile: Anhalter42">@<bdi>Anhalter42</bdi></a> I’ve got it mostly up and running on Pi 2 now, my only issue now is it’s loading a black screen with no info, the terminal says launching application and then access denied to IP address 0.0.0.0/0 I have no idea what’s going on now!</p>
]]></description><link>https://forum.magicmirror.builders/post/25333</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25333</guid><dc:creator><![CDATA[jade]]></dc:creator><pubDate>Fri, 14 Jul 2017 12:22:35 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 14 Jul 2017 12:06:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jade" aria-label="Profile: jade">@<bdi>jade</bdi></a> several people were struggling with PI0 IIRC. Search the forum (for example start <a href="https://forum.magicmirror.builders/tags/pizero">here</a>).</p>
]]></description><link>https://forum.magicmirror.builders/post/25332</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25332</guid><dc:creator><![CDATA[Anhalter42]]></dc:creator><pubDate>Fri, 14 Jul 2017 12:06:56 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 14 Jul 2017 11:39:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> I’m wondering if the problem was actually that I was using a Pi 0, I’m testing now on a Pi 2 and I’ve run the automatic installer, though it is now just sitting doing absolutely nothing, the last thing it said is:</p>
<pre><code>&gt;node-gyp rebuild &gt; build_log.txt 2&gt;&amp;1 || exit 0
</code></pre>
<p dir="auto">And now it’s just sitting there. It hasn’t bought the prompt back up yet so maybe I’m being impatient.</p>
]]></description><link>https://forum.magicmirror.builders/post/25331</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25331</guid><dc:creator><![CDATA[jade]]></dc:creator><pubDate>Fri, 14 Jul 2017 11:39:39 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 14 Jul 2017 11:33:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jade" aria-label="Profile: jade">@<bdi>jade</bdi></a> said in <a href="/post/25326">Config.js file Syntax</a>:</p>
<blockquote>
<p dir="auto">When I first started using Linux I was taught the very bad habit of switching to the root user and doing everything as root, so I moved the file into where it needs to be in /home/pi but I still have the same problem</p>
</blockquote>
<p dir="auto">Again, I hate to refer to the Complete Setup Tutorial but item #7 of Notes at the very beginning of the tutorial states:<br />
<code>"DO NOT INSTALL MagicMirror² as the root user! Always do it as the regular, non privileged pi user"</code></p>
<p dir="auto">With that said, your config is not the problem. I just tested it and it fired right up.<br />
<img src="/assets/uploads/files/1500031552856-v.jpg" alt="0_1500031554343_v.JPG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Unless, it’s not named correctly (config.js) or MM can’t find it at its proper path</p>
]]></description><link>https://forum.magicmirror.builders/post/25330</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25330</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Fri, 14 Jul 2017 11:33:53 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 14 Jul 2017 08:24:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> said in <a href="/post/25298">Config.js file Syntax</a>:</p>
<blockquote>
<p dir="auto">Your installation of MM belongs as follows, and so the path to your config.js file</p>
<p dir="auto">pi@raspberry ~/MagicMirror/config/config.js</p>
</blockquote>
<p dir="auto">When I first started using Linux I was taught the very bad habit of switching to the root user and doing everything as root, so I moved the file into where it needs to be in /home/pi but I still have the same problem</p>
<pre><code>var config = {
    port: 8080,
    ipWhitelist: [],
    language: "en",
    timeFormat: 24,
    units: "metric",
    modules: [
        {
            module: "clock",
            position: "top_left"
        },
        {
            module: "calendar",
            header: "CWG  Pi",
            position: "top_left",
            config: {
                calendars: [
                    {
                        symbol: "calendar-check-o ",
                        url: "https://calendar.google.com/calendar/ical/cwgpi2017%40gmail.com/private-b287e4ebe0e8f5d66665e0c83f9e3fa0/basic.ics"
                    }
                ]
            }
        },
        {
            module: "compliments",
            position: "lower_third",
            updateInterval: 3600000,
            config: {
                compliments: {
                    morning: [
                        "Valar Morghulis",
                        "Valar Dohaeris",
                        "When You Play The Game Of Thrones You Win Or You Die",
                        "Where Is The God Of Tits And Wine?"
                    ],
                    afternoon: [
                        "Sometimes, Those With The Most Power Have The Least Grace",
                        "A Mind Needs Books Like A Sword Needs A Whetstone",
                        "Chaos Isn't A Pit, Chaos Is A Ladder",
                        "A Lion Doesn't Concern Himself With The Opinions Of Sheep"
                    ],
                    evening: [
                        "The Night Is Dark And Full Of Terrors",
                        "Night Gathers And Now My Watch Begins",
                        "Winter Is Coming",
                        "Power Resides Where Men Believe It Resides. It's A Trick, A Shadow On The Wall, And A Very Small Man Can Cast A Very Large Shadow"
                    ]
                }
            }
        },
        {
            module: "currentweather",
            position: "top_right",
            config: {
                location: "Corby",
                locationID: "2652381",  //ID from http://www.openweathermap.org/help/city_list.txt
                appid: "39ab36a3fa513354fbe406263f175c07"
            }
        }
    ]
};

</code></pre>
<p dir="auto">Everything is ok according to jslint but something has got to be not working. Incidentally if I use the sample file and don’t change anything I have the same problem.</p>
]]></description><link>https://forum.magicmirror.builders/post/25326</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25326</guid><dc:creator><![CDATA[jade]]></dc:creator><pubDate>Fri, 14 Jul 2017 08:24:50 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Thu, 13 Jul 2017 21:46:11 GMT]]></title><description><![CDATA[<p dir="auto">I was referring to this forums very own “Complete Setup Tutorial.” Specifically, this:<br />
<a href="https://forum.magicmirror.builders/topic/236/complete-setup-tutorial/6">https://forum.magicmirror.builders/topic/236/complete-setup-tutorial/6</a></p>
<p dir="auto">I guess I shouldn’t assume that everyone follows the installation procedure.</p>
]]></description><link>https://forum.magicmirror.builders/post/25317</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25317</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Thu, 13 Jul 2017 21:46:11 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Thu, 13 Jul 2017 20:36:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/strawberry-3.141" aria-label="Profile: strawberry-3.141">@<bdi>strawberry-3.141</bdi></a> … except for directories with different read/write permissions. Not a linux expert, but I guess this includes /var/ in its default status!?</p>
]]></description><link>https://forum.magicmirror.builders/post/25316</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25316</guid><dc:creator><![CDATA[Anhalter42]]></dc:creator><pubDate>Thu, 13 Jul 2017 20:36:13 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Thu, 13 Jul 2017 20:32:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> not necessarily, you can install the mirror in every directory you like</p>
]]></description><link>https://forum.magicmirror.builders/post/25315</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25315</guid><dc:creator><![CDATA[strawberry 3.141]]></dc:creator><pubDate>Thu, 13 Jul 2017 20:32:49 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Thu, 13 Jul 2017 11:14:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jade" aria-label="Profile: jade">@<bdi>jade</bdi></a> said in <a href="/post/25297">Config.js file Syntax</a>:</p>
<blockquote>
<p dir="auto">my file is in /var/www/html/MagicMirror/config/config.js,</p>
</blockquote>
<p dir="auto">Your installation of MM belongs as follows, and so the path to your config.js file</p>
<p dir="auto">pi@raspberry ~/MagicMirror/config/config.js</p>
<p dir="auto">Then we can work on your config.js if need be</p>
]]></description><link>https://forum.magicmirror.builders/post/25298</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25298</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Thu, 13 Jul 2017 11:14:09 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Thu, 13 Jul 2017 10:00:15 GMT]]></title><description><![CDATA[<p dir="auto">I’m having this exact problem, but I’ve used a linter to check for errors and there are none, and my file is in /var/www/html/MagicMirror/config/config.js, I have no idea what I’m doing wrong!</p>
]]></description><link>https://forum.magicmirror.builders/post/25297</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25297</guid><dc:creator><![CDATA[jade]]></dc:creator><pubDate>Thu, 13 Jul 2017 10:00:15 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 20:30:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amosh83" aria-label="Profile: amosh83">@<bdi>amosh83</bdi></a> said in <a href="/post/25064">Config.js file Syntax</a>:</p>
<blockquote>
<p dir="auto">all I was missing was that “/”,</p>
</blockquote>
<p dir="auto">Ahh, you missed when you copied and pasted. That’s fairly common.</p>
<blockquote>
<p dir="auto">are you kidding me???</p>
</blockquote>
<p dir="auto">Now where have I heard this before? Oh yeah, I said it!</p>
<p dir="auto">Enjoy your mirror</p>
]]></description><link>https://forum.magicmirror.builders/post/25067</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25067</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Fri, 07 Jul 2017 20:30:12 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 16:33:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/letsirk" aria-label="Profile: letsirk">@<bdi>letsirk</bdi></a> YES!!!<br />
I MADE IT!!! turns out that all I was missing was that “/”, are you kidding me??? ahahah</p>
<p dir="auto">I’m so thankful to ALL of you, I’ve never touched a Terminal in my life and I managed to do this with manual installation all thanks to you geniuses!!!<br />
Thank you<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/bhepler" aria-label="Profile: bhepler">@<bdi>bhepler</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/letsirk" aria-label="Profile: letsirk">@<bdi>letsirk</bdi></a></p>
]]></description><link>https://forum.magicmirror.builders/post/25064</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25064</guid><dc:creator><![CDATA[amosh83]]></dc:creator><pubDate>Fri, 07 Jul 2017 16:33:42 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 14:39:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amosh83" aria-label="Profile: amosh83">@<bdi>amosh83</bdi></a> Did you post the exact config.js file.  If so you’re missing a “/” on the first line.</p>
]]></description><link>https://forum.magicmirror.builders/post/25056</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25056</guid><dc:creator><![CDATA[letsirk]]></dc:creator><pubDate>Fri, 07 Jul 2017 14:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 11:21:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bhepler" aria-label="Profile: bhepler">@<bdi>bhepler</bdi></a> said in <a href="/post/24923">Config.js file Syntax</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amosh83" aria-label="Profile: amosh83">@<bdi>amosh83</bdi></a> - Well, progress. You have a config.js file in the right place and it’s passing the syntax checks.</p>
</blockquote>
<p dir="auto">Maybe I should have paid more attention while reading. I see now that I asked something that you had already established. My bad.</p>
<p dir="auto">I am extremely curious to see how MM can report <code>"Please create a config file. See README for more information. If you get this message while your config file is already created, your config file probably contains an error."</code> when there is a working config in the proper directory.</p>
]]></description><link>https://forum.magicmirror.builders/post/25050</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/25050</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Fri, 07 Jul 2017 11:21:58 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 02:32:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> I just didn’t modify a thing from that file, just to make it work, once I see it up and running I’ll slowly customize it. I’m in Pennsylvania :)</p>
]]></description><link>https://forum.magicmirror.builders/post/24978</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24978</guid><dc:creator><![CDATA[amosh83]]></dc:creator><pubDate>Fri, 07 Jul 2017 02:32:57 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 02:29:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> Yes, the file is there, same directory as the one shown above</p>
]]></description><link>https://forum.magicmirror.builders/post/24974</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24974</guid><dc:creator><![CDATA[amosh83]]></dc:creator><pubDate>Fri, 07 Jul 2017 02:29:42 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 02:29:20 GMT]]></title><description><![CDATA[<p dir="auto">Huh, according to your config you use the same locationID that I do. Welcome to NYC! :-)</p>
]]></description><link>https://forum.magicmirror.builders/post/24972</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24972</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Fri, 07 Jul 2017 02:29:20 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 02:14:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amosh83" aria-label="Profile: amosh83">@<bdi>amosh83</bdi></a></p>
<p dir="auto">That config is fine. I just tested it. I don’t mean to intrude but is your config,js file in the correct directory? MM should have no problem with that config, unless it couldn’t find it.</p>
<p dir="auto"><img src="/assets/uploads/files/1499393676381-help.jpg" alt="0_1499393709814_help.JPG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/24969</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24969</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Fri, 07 Jul 2017 02:14:37 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Fri, 07 Jul 2017 01:56:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bhepler" aria-label="Profile: bhepler">@<bdi>bhepler</bdi></a> hello, Thank you for the detailed instructions so far, that’s exactly the kind of guidance I needed based on my level of knowledge… I did all the steps and everything was going smooth until my last step where I see the usual black screen</p>
<p dir="auto">“Magic Mirror2<br />
Please create a config file.<br />
See README for more information.<br />
If you get this message while your config file is already<br />
created, your config file probably contains an error.<br />
Use a JavaScript linter to validate your file”</p>
<p dir="auto">here’s a copy of my current config.js file with the ipwhitelist edit you suggested…</p>
<pre><code> * MIT Licensed.
 */

var config = {
        port: 8080,
        ipWhitelist: [], // Set [] to allow all IP addresses.

        language: "en",
        timeFormat: 24,
        units: "metric",

        modules: [
                {
                        module: "alert",
                },
                {
                        module: "updatenotification",
                        position: "top_bar"
                },
                {
                        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: "New York",
                                locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
                                appid: "YOUR_OPENWEATHER_API_KEY"
                        }
                },
                {
                        module: "weatherforecast",
                        position: "top_right",
                        header: "Weather Forecast",
                        config: {
                                location: "New York",
                                locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
                                appid: "YOUR_OPENWEATHER_API_KEY"
                        }
               },
                {
                        module: "weatherforecast",
                        position: "top_right",
                        header: "Weather Forecast",
                        config: {
                                location: "New York",
                                locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
                                appid: "YOUR_OPENWEATHER_API_KEY"
                        }
                },
                {
                        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;}

</code></pre>
<p dir="auto">thank you</p>
]]></description><link>https://forum.magicmirror.builders/post/24968</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24968</guid><dc:creator><![CDATA[amosh83]]></dc:creator><pubDate>Fri, 07 Jul 2017 01:56:37 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Thu, 06 Jul 2017 13:22:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amosh83" aria-label="Profile: amosh83">@<bdi>amosh83</bdi></a> - Well, progress. You have a <code>config.js</code> file in the right place and it’s passing the syntax checks. Let’s start at basic functionality and move to a working mirror.</p>
<p dir="auto">First, edit your <code>config.js</code> to allow everyone to connect and see the interface. Change this line:<br />
<code>ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses.</code><br />
to read like this:<br />
<code>ipWhitelist: [],</code></p>
<p dir="auto">Next, let’s turn off pm2 management: <code>pm2 stop mm</code><br />
And finally, let’s start the server and see if you can get an interface:</p>
<pre><code>cd /home/pi/MagicMirror
node serveronly
</code></pre>
<p dir="auto">Watch for any lines that say “error”. Don’t worry about lines that say “warn”. Once the console stops spitting out lines of text, try to view your pi in your browser. If you’re using the browser on the pi, then <code>http://localhost:8080</code> should work. If you’re using the browser on another computer, then <code>http://(pi ip address):8080</code> should work. You should see a basic mirror interface in your web browser.</p>
<p dir="auto">Give it a go and let us know if you have any success. We’ll get the fullscreen interface up afterwards.</p>
]]></description><link>https://forum.magicmirror.builders/post/24923</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24923</guid><dc:creator><![CDATA[bhepler]]></dc:creator><pubDate>Thu, 06 Jul 2017 13:22:25 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Wed, 05 Jul 2017 15:29:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/amosh83" aria-label="Profile: amosh83">@<bdi>amosh83</bdi></a> said in <a href="/post/24878">Config.js file Syntax</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> did that and when I open the Index.html it’s still showing me the same issue " create a config file - if you get this message while your config file is already created, your config file probably contains an error…"</p>
</blockquote>
<p dir="auto">The config.js file I posted works. I just tested it. It’s a copy of the config.js.sample file that comes with the installation of MM. Make a copy of yours and rename it and try that. If what I posted still reports that error then something is going wrong in the way that you are creating the config.js file using it, or where you are putting the file.</p>
<blockquote>
<p dir="auto">I have a Raspberry pi b+<br />
Have all node and npm installed and updated,</p>
<p dir="auto">Trying to run it in server mode only with " node serveronly but when I “point my browser” to ```<br />
<a href="http://localhost:8080" target="_blank" rel="noopener noreferrer nofollow ugc">http://localhost:8080</a> I receive this message " Your device is not allowed to access your mirror, please check you config.js file…"</p>
</blockquote>
<p dir="auto">You likely need to whitelist the IP address of the computer you’re using to access the mirror. See this line in the config.js file that I posted originally.<br />
<code>ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses.</code></p>
<blockquote>
<p dir="auto">Tried  PM2 start mm… and says that "mm’s status is online,  mode is fork, and that process is successfully started but I don’t see any Magic Mirror showing up.</p>
</blockquote>
<p dir="auto"><code>pm2 start mm</code> takes a few moments to run the mirror, maybe longer on a Pi b+. I’d wait 30 seconds before cancelling that command.</p>
<blockquote>
<p dir="auto">tried npm start no luck</p>
</blockquote>
<p dir="auto">Has to be run in the MagicMirror directory only.</p>
<p dir="auto">Really, you should post your terminal errors and console errors.</p>
]]></description><link>https://forum.magicmirror.builders/post/24880</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24880</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Wed, 05 Jul 2017 15:29:03 GMT</pubDate></item><item><title><![CDATA[Reply to Config.js file   Syntax on Wed, 05 Jul 2017 13:56:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> did that and when I open the Index.html it’s still showing me the same issue " create a config file - if you get this message while your config file is already created, your config file probably contains an error…"</p>
<p dir="auto">I have a Raspberry pi b+<br />
Have all node and npm installed and updated,</p>
<ul>
<li>
<p dir="auto">Trying to run it in server mode only with " <code> node serveronly</code> but when I “point my browser” to ```<br />
<a href="http://localhost:8080" target="_blank" rel="noopener noreferrer nofollow ugc">http://localhost:8080</a> I receive this message " Your device is not allowed to access your mirror, please check you config.js file…"</p>
</li>
<li>
<p dir="auto">Tried  PM2 start mm… and says that "mm’s status is online,  mode is fork, and that process is successfully started but I don’t see any Magic Mirror showing up.</p>
</li>
<li>
<p dir="auto">tried npm start no luck</p>
</li>
</ul>
]]></description><link>https://forum.magicmirror.builders/post/24878</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24878</guid><dc:creator><![CDATA[amosh83]]></dc:creator><pubDate>Wed, 05 Jul 2017 13:56:17 GMT</pubDate></item></channel></rss>