Repository navigation
Local Weather Slow to Update on Kiosk (Fix included) #1196
Closed
brstiefel1
started this conversation in
Ideas
Replies: 1 comment
|
Added to Issues, as I feel this is something that should be looked at in a future update. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Running in a client/server mode: Server installed on Linux LXC and webpage is accessed on a Pi4 client using Chromium browser in kiosk mode.
I've noticed that it can take hours for the local weather panel to update under your DE LOCATION. If I reboot the Pi that's accessing the webpage from the server it will update the weather section with the latest information. If go to the webpage from another PC it will display the current refreshed weather data. But on the kiosk display that's running 24/7, it can take hours for that panel to refresh on its own.
Is there a way to make the dashboard refresh the weather data from the openhamclock server more often when being displayed 24/7 on a kiosk?
EDIT: I found what is causing the issue. I tracked this down to the client-side poll interval in src/hooks/useWeather.js:
const POLL_INTERVAL = 2 * 60 * 60 * 1000; // 2 hours — matches server cache TTLOn a long-running display, like a Raspberry Pi kiosk that stays on 24/7, the DE panel weather only refreshes every 2 hours. It can go hours out of date. Any fresh page load (manual refresh, reboot, opening it on another PC) shows current weather right away, because the hook fetches immediately on mount. That's why the problem only shows up on always-on displays.
The inline comment says the interval "matches server cache TTL," but .env.example says weather is fetched from Open-Meteo directly in each user's browser. If that's still the case, the 2-hour server cache no longer applies, and the client interval is the only thing controlling freshness.
Local change that fixed it:
- const POLL_INTERVAL = 2 * 60 * 60 * 1000; // 2 hours — matches server cache TTL+ const POLL_INTERVAL = 15 * 60 * 1000; // 15 minutesI rebuilt the frontend (npm run build) and restarted the service. The kiosk now keeps the DE weather current. 15 minutes lines up with how often Open-Meteo updates its current conditions, and it's only about 96 requests per client per day.
Suggestion: it might be worth lowering the default, or making the interval configurable (for example with a .env setting). Since scripts/update.sh resets local changes, users running kiosk displays currently have to reapply this edit after every update.
All reactions