<?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[Use a local JSON file with MMM-JsonTable Module]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I’m trying to access a JSON file on my MM Raspberry Pi to display the data using <a href="https://github.com/timdows/MMM-JsonTable" target="_blank" rel="noopener noreferrer nofollow ugc">MMM-JsonTable</a>.</p>
<p dir="auto">The config asks for a url - and I’ve tried all sorts to find the correct syntax, all to no avail. The latest effort is shown below but it doesn’t work either.</p>
<p dir="auto">This is my current config.js entry for the module:</p>
<pre><code>{
    module: 'MMM-JsonTable',
    position: 'top_left',
    header: 'xxxxxx',
    config: {
	url: 'https://localhost:8080/modules/MMM-JsonTable/xxxxxx.json', // Required
	arrayName: 'xxxx' // Optional
    }
},
</code></pre>
<p dir="auto">I’ve tried loading from another of my Pis after copying the file to the html directory and using the IP address of the Pi plus file name but no joy.</p>
<p dir="auto">I have pasted the JSON data directly into the module’s MMM-JsonTable.js file and it works fine - I just can’t figure out how to get the data from a local file.</p>
<p dir="auto">I wondered if it was a permissions thing. The file attributes are</p>
<pre><code>-rw-r--r-- 1 pi pi 4974 Sep  2 12:17 xxxxxx.json
</code></pre>
<p dir="auto">so every man and his dog can read the file.</p>
<p dir="auto">Thanks in advance for any solution - assuming there is one.</p>
]]></description><link>https://forum.magicmirror.builders/topic/8698/use-a-local-json-file-with-mmm-jsontable-module</link><generator>RSS for Node</generator><lastBuildDate>Tue, 12 May 2026 16:35:09 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/8698.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Sep 2018 18:26:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Use a local JSON file with MMM-JsonTable Module on Wed, 05 Sep 2018 08:08:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> said in <a href="/post/44155">Use a local JSON file with MMM-JsonTable Module</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/reb" aria-label="Profile: reb">@<bdi>reb</bdi></a> those characters are called the BOM (Bill of Material)… added by advanced word processing editors…</p>
<p dir="auto">u can use Notepad++ to remove them too…</p>
<p dir="auto">u need to change editors to make sure you don’t add them back accidentally…</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a><br />
Thanks for the info about removing the BOM (Byte Order Mark).  I use an Explorer replacement program called <a href="https://www.gpsoft.com.au/index.html" target="_blank" rel="noopener noreferrer nofollow ugc">Directory Opus</a> which is awesome and one of the developers wrote a script that can be attached to a toolbar button that can add, remove or toggle the Byte Order Mark.</p>
]]></description><link>https://forum.magicmirror.builders/post/44173</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44173</guid><dc:creator><![CDATA[REB]]></dc:creator><pubDate>Wed, 05 Sep 2018 08:08:23 GMT</pubDate></item><item><title><![CDATA[Reply to Use a local JSON file with MMM-JsonTable Module on Fri, 07 Sep 2018 11:32:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/reb" aria-label="Profile: reb">@<bdi>reb</bdi></a> those characters are called the BOM (Byte Order Mark)… added by advanced word processing editors…</p>
<p dir="auto">u can use Notepad++ to remove them too…</p>
<p dir="auto">u need to change editors to make sure you don’t add them back accidentally…</p>
]]></description><link>https://forum.magicmirror.builders/post/44155</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44155</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 07 Sep 2018 11:32:29 GMT</pubDate></item><item><title><![CDATA[Reply to Use a local JSON file with MMM-JsonTable Module on Tue, 04 Sep 2018 13:17:20 GMT]]></title><description><![CDATA[<p dir="auto">OK, I’ve gotten to the bottom of the 3 extra bytes at the beginning of my json file - they are the utf-8 BOM (EF BB BF).</p>
<p dir="auto">Fortunately, I have a script (on a Directory Opus button) that will remove these bytes (or put them back if need be).</p>
<p dir="auto">Thanks to those that offered advice etc.</p>
]]></description><link>https://forum.magicmirror.builders/post/44152</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44152</guid><dc:creator><![CDATA[REB]]></dc:creator><pubDate>Tue, 04 Sep 2018 13:17:20 GMT</pubDate></item><item><title><![CDATA[Reply to Use a local JSON file with MMM-JsonTable Module on Tue, 04 Sep 2018 10:55:48 GMT]]></title><description><![CDATA[<p dir="auto">OK, I have solved the issue - the json file causes this error:</p>
<pre><code>|mm     | Whoops! There was an uncaught exception...
0|mm     | SyntaxError: Unexpected token  in JSON at position 0
0|mm     |     at JSON.parse (&lt;anonymous&gt;)
0|mm     |     at Request._callback (/home/pi/MagicMirror/modules/MMM-JsonTable/node_helper.js:15:21)
0|mm     |     at Request.self.callback (/home/pi/MagicMirror/node_modules/request/request.js:186:22)
0|mm     |     at emitTwo (events.js:126:13)
0|mm     |     at Request.emit (events.js:214:7)
0|mm     |     at Request.&lt;anonymous&gt; (/home/pi/MagicMirror/node_modules/request/request.js:1163:10)
0|mm     |     at emitOne (events.js:116:13)
0|mm     |     at Request.emit (events.js:211:7)
0|mm     |     at IncomingMessage.&lt;anonymous&gt; (/home/pi/MagicMirror/node_modules/request/request.js:1085:12)
0|mm     |     at Object.onceWrapper (events.js:313:30)
0|mm     | MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
0|mm     | If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
</code></pre>
<p dir="auto">There are three bytes at the beginning of the json file before the first ‘{’. I am using an Excel to JSON converter from where I copy and paste the data.</p>
<p dir="auto">I use VS Code as my code editor and with a blank new file, when I paste the data from the online converter and save, those extra bytes are at the start of the file. Same with Notepad and Editplus.</p>
<p dir="auto">Without these 3 extra bytes, the module loads the file OK. Now I just need to figure out how to save the data without those extra bytes.</p>
<p dir="auto">BTW, the correct url that I used is:</p>
<pre><code> 'http://192.168.1.27:8080/modules/MMM-JsonTable/xxxxxx.json'
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/44147</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44147</guid><dc:creator><![CDATA[REB]]></dc:creator><pubDate>Tue, 04 Sep 2018 10:55:48 GMT</pubDate></item><item><title><![CDATA[Reply to Use a local JSON file with MMM-JsonTable Module on Tue, 04 Sep 2018 07:50:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/reb" aria-label="Profile: reb">@<bdi>reb</bdi></a><br />
You can check Which url is derived from you <code>config.js</code> by this;<br />
<strong>node_helper.js, in  line 11</strong></p>
<pre><code>...
getJson: function (url) {
  var self = this;
  console.log(url)  // add this.
  request({ url: url, method: 'GET' }, function (error, response, body) {
...
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/44144</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44144</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 04 Sep 2018 07:50:41 GMT</pubDate></item><item><title><![CDATA[Reply to Use a local JSON file with MMM-JsonTable Module on Tue, 04 Sep 2018 07:36:24 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><br />
Thanks for the reply.  I had tried that url plus others. I even put the file in a folder within the module folder named ‘public’ but that didn’t work either.</p>
<p dir="auto">I don’t think the module supports local json files - how do I determine this?</p>
<p dir="auto">I think I’ll try to develop my own module - it’ll be a good learning experience if nothing else.</p>
<p dir="auto">Thanks again.</p>
]]></description><link>https://forum.magicmirror.builders/post/44143</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44143</guid><dc:creator><![CDATA[REB]]></dc:creator><pubDate>Tue, 04 Sep 2018 07:36:24 GMT</pubDate></item><item><title><![CDATA[Reply to Use a local JSON file with MMM-JsonTable Module on Tue, 04 Sep 2018 00:40:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/reb" aria-label="Profile: reb">@<bdi>reb</bdi></a></p>
<p dir="auto">Try:</p>
<p dir="auto"><code>url: 'modules/MMM-JsonTable/xxxxxx.json'</code></p>
<p dir="auto">In this case, the xxxxxx.json file must be in the root of the MMM-JsonTable folder. Of course, the module has to support local json files.</p>
]]></description><link>https://forum.magicmirror.builders/post/44133</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/44133</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Tue, 04 Sep 2018 00:40:17 GMT</pubDate></item></channel></rss>