MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. REB
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 15
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Use a local JSON file with MMM-JsonTable Module

      OK, I have solved the issue - the json file causes this error:

      |mm     | Whoops! There was an uncaught exception...
      0|mm     | SyntaxError: Unexpected token  in JSON at position 0
      0|mm     |     at JSON.parse (<anonymous>)
      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.<anonymous> (/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.<anonymous> (/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
      

      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.

      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.

      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.

      BTW, the correct url that I used is:

       'http://192.168.1.27:8080/modules/MMM-JsonTable/xxxxxx.json'
      
      posted in Troubleshooting
      REBR
      REB
    • RE: Use a local JSON file with MMM-JsonTable Module

      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).

      Fortunately, I have a script (on a Directory Opus button) that will remove these bytes (or put them back if need be).

      Thanks to those that offered advice etc.

      posted in Troubleshooting
      REBR
      REB
    • 1 / 1