mazim-co / MMM-MyVolvo

MagicMirror Module for Volvo Cars
1 stars 0 forks source link

Unexpected non-whitespace character after JSON at position 3 #1

Open Justheretoreportanissue opened 1 year ago

Justheretoreportanissue commented 1 year ago

Hi!

I get an error running this in MM. I'm not very good at JS so I need to file it here to get some help. <- Might be me doing something wrong too.

I get no trip information in my MM. This is my config part, which I believe to be correct:

{ module: "MMM-MyVolvo", header: "MyVolvo XC60 D4 AWD", position: "bottom_left", config: { display: { info: true, graphic: "xc60.png", status: true, trip: true, notice: true } } },

Still this is showing in my MM log: 0|MagicMir | [04.10.2023 12:02.11.202] [ERROR] Whoops! There was an uncaught exception... 0|MagicMir | [04.10.2023 12:02.11.202] [ERROR] SyntaxError: Unexpected non-whitespace character after JSON at position 3 0|MagicMir | at JSON.parse () 0|MagicMir | at ChildProcess. (/home/XXX/MagicMirror/modules/MMM-MyVolvo/node_helper.js:140:39) 0|MagicMir | at ChildProcess.emit (node:events:514:28) 0|MagicMir | at maybeClose (node:internal/child_process:1105:16) 0|MagicMir | at ChildProcess._handle.onexit (node:internal/child_process:305:5) 0|MagicMir | [04.10.2023 12:02.11.202] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|MagicMir | [04.10.2023 12:02.11.203] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

How can I get rid of this error?

Regards,

/Jonas...

Justheretoreportanissue commented 1 year ago

Hmm...

Could not resist in digging a bit deeper here.

Turns out that the response from ´voc trips --json' in my case was '[]'. This might be the reason for the errors. Furthermore I found out that I had not activated 'driving record' (is that what it's called in English?) in the app. Now, I have done that. Let's see after my next trip if some information shows up and the errors go away.

Regards,

/Jonas...