-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception handling for weather fetching failures #10
Comments
@surak I'd recommend the latter (using try/catch statements) in the script as it's better suited for debugging than a watchdog that keeps relaunching the script. Unfortunately, I'm not too good at exceptions handling so I'll have to ask you for help on that.
It's probably better to have seperate issues for different topics than mixing them all up in the suggestions/improvement issue. Pull requests are fine too and you've made a good point that the config file should be kept seperately. |
I thought about something that would make it CLEAR on the screen that it's not being updated. Like a warning in some corner, or just a huge X crossing the whole thing, making us both annoyed and wishing to fix it. What do you think? |
Yes, that‘s a good idea. As the Openweathermap server is available for ~95% a day for free users, it‘s possible there was a server error than a network problem. In that case, retrying to access the API will fix it. I’d prefer the second option, a small warning somwhere on the display. What do you say about a crossed out Wifi icon in the place of the weather icon when the server returned an error? |
That's a good one. Together with a warning on the console, like you have on the pull request. |
@surak I'll also add a warning on the console to show that there is an error. |
It is somehow resized here (appears as a 95x95 jpeg), but I'm thinking if this isn't somewhat misleading: That is clearly the wifi, which might lead the user to think that there is, in fact, a problem with the wifi, not with the OpenWeather. How about a "broken" cloud? Something like this (I just googled, and I can't upload svg here): |
@surak Also, just modified your comment to make the pictures a bit smaller |
@surak |
I'm with you on the latter! |
I've tested out a few improvements to the main file:
Here is the link for the improved stable.py: The corresponding additional files (icon: 'cloud-no-response' and file: 'icons_positions_locations.py') have been added to the repo's 'Calendar' directory. Could you please also test the improved stable.py file? If you're content with that, I'll replace the current stable.py file with the improved one. |
@surak By the way, what do you think of the current output of the main file (see picture above)? |
Hi! Sorry for my lack of communication. I’m preparing for a conference right now. My rig is working nonstop since the last time I sent you a picture (It updates itself every five minutes). I’ve been thinking a lot about the upper part. Turns out that we look at it to check the temperature. Always. And it’s too small. So I’ll play around with some designs that give some proheminence to the temperature and weather for the rest of the day. Which is what matters. The weather of the day and tomorrow. The rest can be small. Turns out that time is useless, when you have so many clocks around! And even more when you burn the e-ink with it. About the main file, I was doing something similar already. I think that everything of interest should go to the console as well. It’s “free” anyway :) |
@surak It's good to hear that your rig is working fine. It also means that this issue is resolved so I'll be closing this. If you feel a need to re-open this issue, please do so. If the space above the Calendar section is too small, you can always create a new page. For example, after touching a capactive sensor, the programm will switch to the other page. Another idea would be to add an OLED display via the GPIOs and fetch real-time data from a sensor. In the former case, I can help you by publishing an example 'template' file which shows how to create a new page, add functions etc. Although the idea of showing the time on the E-Paper display is a good one, for this specific E-Paper display, it's not a good idea. The reason is that, as you mentioned, ghosting of the display which requires more 'calibrations'. If you have any more suggestions on the main file (like a console output I might have forgotten), please use the improvement ideas issue for that purpose. |
When the weather service fails, the code throws an exception and dies.
As there is no watchdog to relaunch the process (should I write one?), a better handling of the possible exceptions (fetching ics file, fetching weather, drawing the screen) should have try/catch statements.
I am creating issues separately, should I just use the suggestion/improvements? Or just pull requests (complicated, since the api key, city name and ics url are on the main code file). Which leads me to the next issue...
The text was updated successfully, but these errors were encountered: