You can limit your calls as well. For example, I have mine set to 2,000. I get the 1,000 for free, and allow for another 1,000. This happened once while I was troubleshooting my issue here. I got to just over 1,900 calls total and the charge was $1.35 USD. You can set the max call limit to whatever you want.
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-OpenWeatherMapForecast 3.0 API calls and freeze issue
-
RE: MMM-OpenWeatherMapForecast 3.0 API calls and freeze issue
@sdetweil
I turned two more MMM-OpenWeatherMapForecast sections for a couple days and left it running. No issues that I could see. Your script seems to have fixed it. I’ll probably go back to 4 standard weather sections and one MMM-OpenWeatherMapForecast. Thank you for your help though.
Here are the logs.0|mm | > magicmirror@2.28.0 start
0|mm |
0|mm | [2024-08-01 21:20:05.292] [LOG] Loading config …
0|mm | [2024-08-01 21:20:05.299] [LOG] Loading module helpers …
0|mm | [2024-08-01 21:20:05.301] [LOG] No helper found for module: alert.
0|mm | [2024-08-01 21:20:05.310] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.312] [LOG] No helper found for module: clock.
0|mm | [2024-08-01 21:20:05.445] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.445] [LOG] Module helper loaded: calendar
0|mm | [2024-08-01 21:20:05.447] [LOG] No helper found for module: weather.
0|mm | [2024-08-01 21:20:05.447] [LOG] No helper found for module: weather.
0|mm | [2024-08-01 21:20:05.479] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.771] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.772] [LOG] All module helpers loaded.
0|mm | [2024-08-01 21:20:05.782] [LOG] Starting server on port 8080 …
0|mm | [2024-08-01 21:20:06.923] [LOG] Server started …
0|mm | [2024-08-01 21:20:06.929] [LOG] Connecting socket for: calendar
0|mm | [2024-08-01 21:20:06.930] [LOG] Starting node helper for: calendar
0|mm | [2024-08-01 21:20:06.936] [LOG] Sockets connected & modules started …
0|mm | [2024-08-01 21:20:07.302] [LOG] Launching application.
0|mm | [2024-08-01 21:20:08.895] [INFO] System information:
0|mm | ### SYSTEM: manufacturer: ; model: ; raspberry: undefined; virtual: false
0|mm | [2024-08-01 21:20:11.736] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-01 21:20:13.338] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.0|mm | > magicmirror@2.28.0 start
0|mm | > DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js
0|mm |
0|mm | [2024-08-01 21:20:05.264] [LOG] Starting MagicMirror: v2.28.0
0|mm | [2024-08-01 21:20:05.292] [LOG] Loading config …
0|mm | [2024-08-01 21:20:05.295] [LOG] config template file not exists, no envsubst
0|mm | [2024-08-01 21:20:05.299] [LOG] Loading module helpers …
0|mm | [2024-08-01 21:20:05.301] [LOG] No helper found for module: alert.
0|mm | [2024-08-01 21:20:05.310] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.311] [LOG] Module helper loaded: updatenotification
0|mm | [2024-08-01 21:20:05.312] [LOG] No helper found for module: clock.
0|mm | [2024-08-01 21:20:05.445] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.445] [LOG] Module helper loaded: calendar
0|mm | [2024-08-01 21:20:05.447] [LOG] No helper found for module: weather.
0|mm | [2024-08-01 21:20:05.447] [LOG] No helper found for module: weather.
0|mm | [2024-08-01 21:20:05.479] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.479] [LOG] Module helper loaded: MMM-OpenWeatherMapForecast
0|mm | [2024-08-01 21:20:05.771] [LOG] Initializing new module helper …
0|mm | [2024-08-01 21:20:05.772] [LOG] Module helper loaded: MMM-SunRiseSet
0|mm | [2024-08-01 21:20:05.772] [LOG] All module helpers loaded.
0|mm | [2024-08-01 21:20:05.782] [LOG] Starting server on port 8080 …
0|mm | [2024-08-01 21:20:06.923] [LOG] Server started …
0|mm | [2024-08-01 21:20:06.926] [LOG] Connecting socket for: updatenotification
0|mm | [2024-08-01 21:20:06.927] [LOG] Starting module helper: updatenotification
0|mm | [2024-08-01 21:20:06.929] [LOG] Connecting socket for: calendar
0|mm | [2024-08-01 21:20:06.930] [LOG] Starting node helper for: calendar
0|mm | [2024-08-01 21:20:06.930] [LOG] Connecting socket for: MMM-OpenWeatherMapForecast
0|mm | [2024-08-01 21:20:06.931] [LOG] ====================== Starting node_helper for module [MMM-OpenWeatherMapForecast]
0|mm | [2024-08-01 21:20:06.932] [LOG] Connecting socket for: MMM-SunRiseSet
0|mm | [2024-08-01 21:20:06.933] [LOG] Starting node_helper for: MMM-SunRiseSet
0|mm | [2024-08-01 21:20:06.936] [LOG] Sockets connected & modules started …
0|mm | [2024-08-01 21:20:07.302] [LOG] Launching application.
0|mm | [2024-08-01 21:20:08.895] [INFO] System information:
0|mm | ### SYSTEM: manufacturer: ; model: ; raspberry: undefined; virtual: false
0|mm | ### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.31+rpt-rpi-v8
0|mm | ### VERSIONS: electron: 31.1.0; used node: 20.14.0; installed node: 20.15.0; npm: 10.7.0; pm2: 5.4.1
0|mm | ### OTHER: timeZone: America/Los_Angeles; ELECTRON_ENABLE_GPU: undefined
0|mm | [2024-08-01 21:20:10.636] [LOG] Create new calendarfetcher for url: https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics - Interval: 7200000
0|mm | [2024-08-01 21:20:10.779] [LOG] Create new calendarfetcher for url: https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics - Interval: 7200000
0|mm | [2024-08-01 21:20:10.802] [INFO] updatenotification: Updater Class Loaded!
0|mm | [2024-08-01 21:20:10.803] [INFO] updatenotification: Checking PM2 using…
0|mm | [2024-08-01 21:20:10.981] [INFO] Checking git for module: MMM-OpenWeatherMapForecast
0|mm | [2024-08-01 21:20:11.025] [INFO] Checking git for module: MMM-SunRiseSet
0|mm | [2024-08-01 21:20:11.046] [INFO] Checking git for module: MagicMirror
0|mm | [2024-08-01 21:20:11.104] [INFO] updatenotification: [PM2] You are not using pm2
0|mm | [2024-08-01 21:20:11.736] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-01 21:20:13.338] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-01 23:20:12.320] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-01 23:20:15.036] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 01:20:12.733] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 01:20:16.007] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 03:20:13.161] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 03:20:16.894] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 05:20:13.547] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 05:20:17.909] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 07:20:13.922] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 07:20:18.813] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 09:20:14.301] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 09:20:19.727] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 11:20:14.714] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 11:20:20.683] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 13:20:15.100] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 13:20:21.534] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 15:20:15.498] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 15:20:22.471] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 17:20:15.885] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 17:20:23.362] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 19:20:16.281] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 19:20:24.207] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 21:20:16.685] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 21:20:25.164] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-02 23:20:17.133] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-02 23:20:26.039] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-03 01:20:17.538] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-03 01:20:26.948] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-03 03:20:17.938] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-03 03:20:27.814] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-03 05:20:18.339] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-03 05:20:28.745] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics.
0|mm | [2024-08-03 07:20:18.699] [INFO] Calendar-Fetcher: Broadcasting 5 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics.
0|mm | [2024-08-03 07:20:29.567] [INFO] Calendar-Fetcher: Broadcasting 122 events from https://calendar.google.com/calendar/ical/mycalhex%40group.calendar.google.com/private-number/basic.ics. -
RE: MMM-OpenWeatherMapForecast 3.0 API calls and freeze issue
@sdetweil Hello, been away for a bit. I ran the curl and added a couple of the OpenWeatherMapForecast calls back in. They’re showing nominally, time is updating regularly. No issues right now. I opened the browser developer window and it’s showing 3 errors and the count is not incrementing. Does this fixloading script stop errant calls? I’m not sure where to look for the logs. I’m using pm2 to start/stop/restart.
-
RE: MMM-OpenWeatherMapForecast 3.0 API calls and freeze issue
@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.
-
RE: MMM-OpenWeatherMapForecast 3.0 API calls and freeze issue
@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.
API calls
pm2 status
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.
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/QXU5SzIThe longer it goes, the more errors I see.
One of the POST error messages
-
MMM-OpenWeatherMapForecast 3.0 API calls and freeze issue
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.