• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Default Weather module still not displaying

Scheduled Pinned Locked Moved Solved Troubleshooting
39 Posts 6 Posters 10.0k Views 6 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.
  • J Offline
    Jarhead96097 @sdetweil
    last edited by Aug 5, 2022, 8:11 PM

    @sdetweil sorry, already using your installation script (but no “npm audit fix” this time around).

    Jarhead96097

    1 Reply Last reply Reply Quote 0
    • B Offline
      Blackeye @sdetweil
      last edited by Aug 5, 2022, 8:25 PM

      @sdetweil On my RPi4 it’s 16.16.0, and I’m getting the same problems as Jarhead. After an upgrade there’s now just no reaction to starting mm.

      S 1 Reply Last reply Aug 5, 2022, 8:34 PM Reply Quote 0
      • S Offline
        sdetweil @Blackeye
        last edited by Aug 5, 2022, 8:34 PM

        @Blackeye can u show the output of the npm start or, if using pm2 , then

        pm2 logs --lines=50

        how did u do the upgrade?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S B 2 Replies Last reply Aug 5, 2022, 8:43 PM Reply Quote 0
        • S Offline
          sdetweil @sdetweil
          last edited by Aug 5, 2022, 8:43 PM

          @Blackeye also, can u show me the contents of line 159 from

          ~/MagicMirror/modules/default/weather/weather.js
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          J 1 Reply Last reply Aug 5, 2022, 9:48 PM Reply Quote 0
          • J Offline
            Jarhead96097 @OldSunGuy
            last edited by Aug 5, 2022, 9:43 PM

            @OldSunGuy I use the MMM-ModuleScheduler 3rd party module to control when my MM turns off everything except the clock and dims the display at night. “daytime_scheduler” is the class I used to turn off those modules at night.

            Jarhead96097

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jarhead96097 @sdetweil
              last edited by Aug 5, 2022, 9:48 PM

              @sdetweil here is what my weather.js (newly rebuilt, but not yet configured) has on lines 148 to 166:

              	// What to do when the weather provider has new information available?
              	updateAvailable: function () {
              		Log.log("New weather information available.");
              		this.updateDom(0);
              		this.scheduleUpdate();
              
              		if (this.weatherProvider.currentWeather()) {
              			this.sendNotification("CURRENTWEATHER_TYPE", { type: this.weatherProvider.currentWeather().weatherType.replace("-", "_") });
              		}
              
              		const notificationPayload = {
              			currentWeather: this.weatherProvider?.currentWeatherObject?.simpleClone() ?? null,
              			forecastArray: this.weatherProvider?.weatherForecastArray?.map((ar) => ar.simpleClone()) ?? [],
              			hourlyArray: this.weatherProvider?.weatherHourlyArray?.map((ar) => ar.simpleClone()) ?? [],
              			locationName: this.weatherProvider?.fetchedLocationName,
              			providerName: this.weatherProvider.providerName
              		};
              		this.sendNotification("WEATHER_UPDATED", notificationPayload);
              	},
              

              Jarhead96097

              J S 2 Replies Last reply Aug 5, 2022, 10:57 PM Reply Quote 0
              • J Offline
                Jarhead96097 @Jarhead96097
                last edited by Aug 5, 2022, 10:57 PM

                @sdetweil Sam, thanks for all of your help. I’ve finished rebuilding without running ‘npm audit fix’ and everything is working as it should! I used your installation script and everything worked fine. I also took the opportunity to move things around and try a couple of new 3rd party modules… everything is back to normal!

                Thanks again,
                Jarhead96097

                Jarhead96097

                S 1 Reply Last reply Aug 5, 2022, 11:10 PM Reply Quote 1
                • S Offline
                  sdetweil @Jarhead96097
                  last edited by Aug 5, 2022, 11:10 PM

                  @Jarhead96097 said in Default Weather module still not displaying:

                    const notificationPayload = {
                    	currentWeather: this.weatherProvider?.currentWeatherObject?.simpleClone() ?? null,
                  

                  thats line 158 and159.

                  the only thing i can think of is the ?. (optional chaining) operator…
                  but its been long supported… and it works on my 16.9.1 node version

                  see item 2 in the list here
                  https://www.freecodecamp.org/news/how-the-question-mark-works-in-javascript/

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @Jarhead96097
                    last edited by Aug 5, 2022, 11:10 PM

                    @Jarhead96097 great news!!!

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      Blackeye @sdetweil
                      last edited by Aug 6, 2022, 8:10 AM

                      @sdetweil Moin, line 159 of weather-js looks like this:

                      currentWeather: this.weatherProvider?.currentWeatherObject?.simpleClone() ?? null,
                      

                      The pm2 error log shows:

                      /home/<myusername>/.pm2/logs/MagicMirror-error.log last 50 lines:
                      1|MagicMir | failed to load swrast driver
                      1|MagicMir | [06.08.2022 09:46.00.374] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: The module '/home/lookyhere/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node'
                      1|MagicMir | was compiled against a different Node.js version using
                      1|MagicMir | NODE_MODULE_VERSION 73. This version of Node.js requires
                      1|MagicMir | NODE_MODULE_VERSION 107. Please try re-compiling or re-installing
                      1|MagicMir | the module (for instance, using `npm rebuild` or `npm install`).
                      

                      Looks like I should re-install. Which is the best method, in your opinion?
                      Many thanks for your help - I want to get this thing on the wall soon!

                      S 1 Reply Last reply Aug 6, 2022, 12:07 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 3 / 4
                      3 / 4
                      • First post
                        26/39
                        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