A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
MMM-DarkSkyForecast
-
Hello,
I have updated to 2.23.0.
Now I have a problem with MMM-DarkSkyForecast, which was still working before the update. At the moment nothing is displayed anymore, except loading…The log file tells me:
<!DOCTYPE "... is not valid JSON at JSON.parse (<anonymous>) at Request._callback (/home/pi/MagicMirror/modules/MMM-DarkSkyForecast/node_helper.js:57:29) at self.callback (/home/pi/MagicMirror/modules/MMM-DarkSkyForecast/node_modules/request/request.js:185:22) at Request.emit (node:events:513:28) at Request.<anonymous> (/home/pi/MagicMirror/modules/MMM-DarkSkyForecast/node_modules/request/request.js:1154:10) at Request.emit (node:events:513:28) at IncomingMessage.<anonymous> (/home/pi/MagicMirror/modules/MMM-DarkSkyForecast/node_modules/request/request.js:1076:12) at Object.onceWrapper (node:events:627:28) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at process.processTicksAndRejections (node:internal/process/task_queues:83:21) [06.04.2023 10:45.14.538] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [06.04.2023 10:45.14.540] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [06.04.2023 10:55.11.221] [ERROR] Whoops! There was an uncaught exception... [06.04.2023 10:55.11.224] [ERROR] SyntaxError: Unexpected token '<', "
I have carried out a new update of MMM-DarkSkyForecast, unfortunately without success.
Can anyone help me?
-
dark sky api was switched off on March 31st, 2023
-
@MiPraSo i do not know, as there is some missing info
edit the module node_helper.js
and change this code
// console.log("[MMM-DarkSkyForecast] Getting data: " + url); request({url: url, method: "GET"}, function( error, response, body) { if(!error && response.statusCode == 200) { //Good response var resp = JSON.parse(body); resp.instanceId = payload.instanceId; self.sendSocketNotification("DARK_SKY_FORECAST_DATA", resp); } else { console.log( "[MMM-DarkSkyForecast] " + moment().format("D-MMM-YY HH:mm") + " ** ERROR ** " + error ); } });
to look like this
(just copy/paste after selecting or deleting the old code above)// console.log("[MMM-DarkSkyForecast] Getting data: " + url); request({url: url, method: "GET"}, function( error, response, body) { if(!error){ if(response.statusCode == 200) { //Good response var resp = JSON.parse(body); resp.instanceId = payload.instanceId; self.sendSocketNotification("DARK_SKY_FORECAST_DATA", resp); } else { console.log( "[MMM-DarkSkyForecast] " + moment().format("D-MMM-YY HH:mm") + " ** unexpected response code ** " + response.statusCode + " data="+body ); } } else { console.log( "[MMM-DarkSkyForecast] " + moment().format("D-MMM-YY HH:mm") + " ** ERROR ** " + error ); } });
then run mm again so we can see what the api is complaining about
-
dark sky api was switched off on March 31st, 2023
-