MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-DarkSkyForecast

    Scheduled Pinned Locked Moved Solved Troubleshooting
    4 Posts 4 Posters 1.0k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      MiPraSo
      last edited by

      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?

      S 1 Reply Last reply Reply Quote 0
      • karsten13K Offline
        karsten13 @sdetweil
        last edited by

        dark sky api was switched off on March 31st, 2023

        swvalentiS 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @MiPraSo
          last edited by

          @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

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          karsten13K 1 Reply Last reply Reply Quote 0
          • karsten13K Offline
            karsten13 @sdetweil
            last edited by

            dark sky api was switched off on March 31st, 2023

            swvalentiS 1 Reply Last reply Reply Quote 0
            • swvalentiS Offline
              swvalenti Project Sponsor @karsten13
              last edited by

              https://github.com/jclarke0000/MMM-OpenWeatherForecast

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy