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

MMM-OpenWeatherMapForecast 3.0 API calls and freeze issue

Scheduled Pinned Locked Moved Solved Troubleshooting
21 Posts 5 Posters 1.7k Views 5 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
    jfields
    last edited by Jul 9, 2024, 6:21 AM

    I have been using MMM-OpenWeatherMapForecast for a few months without issue. I have showDailyForecast in one section with maxHourliesToShow set to 24. I also have 4 different daily update sections, including the same location as the showDailyForecast updates. So 5 calls/sections total. The daily updates pull every 12 hours and the hourly pulls every hour.
    I upgraded my MMM-OpenWeatherMapForecast configs to 3.0 onecall a couple weeks ago. I also recently updated that module, the magicmirror base, and the Raspberry Pi software around the same time. I’m having a hard time pinning down the root cause. I’ve since renamed my MagicMirror folder and redownloaded in case I made a mistake somewhere else.

    I recently found that my hourly weather was not updating. Looking at it further, it appears to have gone stale around July 2nd, I found this on the 5th or 6th. When I logged into my Raspberry Pi 4, I took the regular OS updates that were waiting, rebooted, and restarted the Magic Mirror software and configured modules. I assumed something was hung and needed a reboot I then noticed an unusually high number of calls going to onecall_30. My normal amount is 60-70 calls per day but I was close to 1,000 by late afternoon.

    A lot of troubleshooting later I’ve found that having the hourly and daily calls running at the same time causes the system to slowly freeze up. Having more than one call/section enabled causes an unusually high number of calls to go out. Having just the showDailyForecast section enabled runs fine and registers one call in the openweathermap usage logs per attempt. Having this hourly plus one of the daily calls running results in 8 calls per attempt. Having three sections enabled results in 27 calls, 4 sections enabled results in 64 calls, and having all five sections running results in 100-152 calls. These counts are recorded at startup; I don’t have the data on refresh rates.

    When I have more than one instance of the weather call in my config, I get an unusual number of calls being recorded at https://home.openweathermap.org/statistics/onecall_30. If I have the hourly instance and any daily instance enabled at the same time, it seems like each new API call bogs the system down more. It’s evident in the clock. I start seeing time update every 2 seconds, then every 3-4, then more. Eventually my calendar wouldn’t display, flashing briefly for a moment before going away again - maybe it was trying to refresh and not getting through? Having more daily instances enabled along with the hourly causes it degrade faster. Eventually it just stops updating and appears frozen. When it gets to this point, the openweathermap statistics stops bumping like the calls are never going out.

    config.js
    
    modules: [
    		{
    			module: "alert",
    		},
    		{
    			module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left",
    			timeFormat: 12
    		},
    		{
    			module: "calendar",
    			header: "Calendar",
    			position: "top_left",
    			config: {
    				fetchInterval: 3600000 * 12, // 12 hours
    				customEvents: [{keyword: 'Birthday', symbol: 'birthday-cake', color: 'Gold'}, {keyword: 'Anniversary', symbol: 'fas fa-solid fa-face-kiss-wink-heart', color: 'Red'}], 
    				coloredText: true,
    				coloredSymbol: true,
    				calendars: [
    					{
    						symbol: "calendar-check",
    						url: "https://calendar.google.com/calendar/ical/myhashnumber%40group.calendar.google.com/private-mycalendarnumber/basic.ics"
    					},
    					{
    						symbol: "calendar-check",
    						url: "https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics"
    					}
    				]
    			}
    		},
    
    		{
    			module: "MMM-OpenWeatherMapForecast",
    			header: "Kent, WA",
    			position: "top_left",
    			config: {
    				apikey: "myapikey",
    				latitude: "47.394788",
    				longitude: "-122.214061",      
    				updateInterval: 15,  // 720 = 12 hrs
    				requestDelay: 500,  // ms
    				units: "imperial",
    				showCurrentConditions: false,
    				showSummary: false,
    				showForecastTableColumnHeaderIcons: false,
    				showHourlyForecast: false,
    				maxDailiesToShow: 5,
    				concise: false,
    				iconset: "4c", 
    				forecastLayout: "table"
    				
    			}
    		},
    		
    		{
    			module: "MMM-OpenWeatherMapForecast",
    			header: "Dade City, FL",
    			position: "top_left",
    			config: {
    				apikey: "myapikey",
    				latitude: "28.32506",
    				longitude: "-82.30354",      
    				updateInterval: 30,  // 12 hrs
    				requestDelay: 4500,  // ms
    				colored: false,
    				units: "imperial",
    				showCurrentConditions: false,
    				showSummary: false,
    				showForecastTableColumnHeaderIcons: false,
    				showHourlyForecast: false,
    				maxDailiesToShow: 5,
    				forecastLayout: "table"
    			}
    		},
    		  
    		{
    			module: "MMM-OpenWeatherMapForecast",
    			header: "Lawndale, CA",
    			position: "top_left",
    			config: {
    				apikey: "myapikey",
    				latitude: "33.90011",
    				longitude: "-118.35854",      
    				updateInterval: 60,  // 720 = 12 hrs
    				requestDelay: 3500,  // ms
    				colored: false,
    				units: "imperial",
    				showCurrentConditions: false,
    				showSummary: false,
    				showForecastTableColumnHeaderIcons: false,
    				showHourlyForecast: false,
    				maxDailiesToShow: 5,
    				forecastLayout: "table"
    			}
    		},
    		
    		{
    			module: "MMM-OpenWeatherMapForecast",
    			header: "Toulouse",
    			position: "top_left",
    			config: {
    				apikey: "myapikey",
    				latitude: "43.6033738",
    				longitude: "1.4307561",
    				updateInterval: 60,  // 12 hrs
    				requestDelay: 1500,  // ms
    				colored: false,
    				units: "imperial",
    				showCurrentConditions: false,
    				showSummary: false,
    				showForecastTableColumnHeaderIcons: false,
    				showHourlyForecast: false,
    				maxDailiesToShow: 5,
    				forecastLayout: "table"
    			}
    		},
    		
    		{
    			disabled: false,
    			module: "MMM-SunRiseSet",
    			position: "top_right",
    			config: {
    				lat: "47.394788",   
    				lng: "-122.214061",    
    				imageOnly: "no",      
    				timeFormat: "h:mm a", 
    				maxWidth: "515px"
    			}
    		},
    		
    		{
    			module: "MMM-OpenWeatherMapForecast",
    			header: "Today's Hourly Weather",
    			position: "top_right",
    			config: {
    				apikey: "myapikey",
    				latitude: "47.394788",
    				longitude: "-122.214061",      
    				updateInterval: 15,  // minutes
    				requestDelay: 2500,  // ms
    				units: "imperial",
    				hourlyForecastInterval: 1,
    				maxHourliesToShow: 24,
    				showDailyForecast: true,
    				maxDailiesToShow: 5,
    				concise: false,
    				iconset: "4c",
    				forecastLayout: "table"
    			}
    		},
    
    	]
    
    

    Raspberry Pi 4 top results while system appears locked up. I am ssh’ing from another computer’s terminal.
    Pi top.png

    karsten13K S 2 Replies Last reply Jul 9, 2024, 9:58 PM Reply Quote 0
    • S Offline
      sdetweil @jfields
      last edited by Jul 13, 2024, 5:27 PM

      @jfields good debug on the multiple problem

      lets try this temp fix

      in the MM/js folder do

      curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror/fixloading/js/app.js >app.js
      

      stop and restart MM

      this adds a hash to check for loading or already loading the node_helper for this module

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      S J 2 Replies Last reply Jul 23, 2024, 9:37 PM Reply Quote 0
      • karsten13K Offline
        karsten13 @jfields
        last edited by Jul 9, 2024, 9:58 PM

        @jfields

        without knowing if it is related to this we have another odd behaviour here which sounds similiar

        1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @jfields
          last edited by Jul 11, 2024, 12:33 PM

          @jfields I don’t know the cause of the unexpected multiples, but the ‘freeze’ is because you hit the 1000 calls per day
          limit of the free plan.

          can we see your config.js?
          xxx out any api key or url etc that is
          private but don’t change anything else, use the code block wrapper

          weather is done all in browser , so any messages are logged there

          ctrl-shift-i to open the developers window and then select the console tab.
          add weather to the files field to see messages just from the weather module

          you can change filter to cal for Calendar
          as well.
          Calendar fetching is done server side, so the output of

           pm2 logs --lines=100 
          

          might be helpful
          as well as the output of

          pm2 status
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          J 1 Reply Last reply Jul 12, 2024, 7:02 AM Reply Quote 1
          • J Offline
            jfields @sdetweil
            last edited by Jul 12, 2024, 7:02 AM

            @sdetweil Thanks for the response. The freezing is not from exceeding the 1,000 API calls. The system is bogging down. I can watch it get worse over time by watching how often the seconds update on the clock. Also, I have a credit card on file and allow up to 2,000 call. I haven’t exceeded that but I have gone up to 1,700.
            I have reverted to using MMM-OpenWeatherMapForecast for just one call and that is working fine. I’m using the standard weather module for the rest of the calls.
            be885357-aba2-4a58-909f-47e51f2e95b6-image.png

            API calls
            f68551bc-00a3-4233-ba72-bb86977a5b67-image.png

            pm2 status
            b909fbb8-f6d0-4144-a5a5-78986bf8e808-image.png

            For the config.js, I copied the module section and pasted it above. Do you need more than that?

            I wasn’t sure what to grab from the console tab, but I did see some errors and grabbed those.

            a85d4c18-22cb-4758-a480-7bc9cc3770c0-image.png

            Video of some error messages popping up. They were really flashing fast at first, hard to get a screen grab so I made a video. The longer it went, the more errors, and the longer you could see them. Something is compounding.
            https://imgur.com/a/QXU5SzI

            The longer it goes, the more errors I see.
            e19f524b-68bb-415a-b7f7-048059f17c29-image.png

            One of the POST error messages
            bd95e4da-e553-482c-a361-b9c02738cee1-image.png

            S 2 Replies Last reply Jul 12, 2024, 8:40 AM Reply Quote 0
            • S Offline
              sdetweil @jfields
              last edited by Jul 12, 2024, 8:40 AM

              @jfields which version of MMM-OpenWeatherMapForecast are you using?

              in the module folder do
              git remote -v

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              J 1 Reply Last reply Jul 12, 2024, 3:03 PM Reply Quote 0
              • J Offline
                jfields @sdetweil
                last edited by Jul 12, 2024, 3:03 PM

                @sdetweil
                origin https://github.com/MarcLandis/MMM-OpenWeatherMapForecast.git (fetch)
                origin https://github.com/MarcLandis/MMM-OpenWeatherMapForecast.git (push)

                S 1 Reply Last reply Jul 12, 2024, 3:21 PM Reply Quote 0
                • S Offline
                  sdetweil @jfields
                  last edited by Jul 12, 2024, 3:21 PM

                  @jfields that one is quite old

                  I’d try this one, as the author is active
                  https://github.com/Tom-Hirschberger/MMM-OpenWeatherForecast

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  J 1 Reply Last reply Jul 13, 2024, 2:54 PM Reply Quote 0
                  • J Offline
                    jfields @sdetweil
                    last edited by Jul 13, 2024, 2:54 PM

                    @sdetweil Thanks. I haven’t tried that one. I honestly only thought there were two, one that was way old and the one I’m using (MarcLandis). The one I’m using did get a recent update so it is somewhat supported, although I cannot open an Issue on it.

                    From where I’m at now, I have a good working solution but using the MarcLandis version on one side and the built-in for everything else. If I do change, I will look at the Tom-Hirschberger version. It’s getting updates and has a tab to open Issues.

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @jfields
                      last edited by Jul 13, 2024, 5:27 PM

                      @jfields good debug on the multiple problem

                      lets try this temp fix

                      in the MM/js folder do

                      curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror/fixloading/js/app.js >app.js
                      

                      stop and restart MM

                      this adds a hash to check for loading or already loading the node_helper for this module

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      S J 2 Replies Last reply Jul 23, 2024, 9:37 PM Reply Quote 0
                      • S Offline
                        Socrates @sdetweil
                        last edited by Jul 23, 2024, 9:37 PM

                        Sorry to hijack this post. I can create a new one if needed. I’ve been using the “MMM-OpenWeatherMapForecast” module for a while, but for the past few weeks, it hasn’t been showing up on my MM. I’ve rebooted MM several times and made sure the module is up to date, but no luck.

                        S 1 Reply Last reply Jul 23, 2024, 9:42 PM Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 1 / 3
                        • 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