Comments (6)
Update: 2 minutes later board started running again, all 3 entries showing “delayed” or “cancelled”.
from train-departure-display.
I believe I have added a try
block for this error, however as it doesn't happen that often there isn't much real world testing that can be done here!
I made a few changes to how the drawBlankSignage
function works, allowing it to display that there has been an error parsing the data, if the newly added debug mode is enabled.
If debug isn't enabled, it falls back to the Out of Hours station name, as we can't fetch the actual station name as there has been an error getting data from the API.
I did originally show this error message at any time, but I would imagine real departure displays wouldn't be verbose unless there was a debugging mode enabled, so added an if for debug.
It also should log the error to the console too.
I did consider writing a routine to temporarily speed up the refreshTime
if an error like this occurs, but that might be out of the scope of this bug so decided against it for now!
I haven't submitted this a pull request yet, but feel free to check out the changes on my branch: https://github.com/CalamityJames/train-departure-display/tree/handle-openldbws-error
Will wait for @chrisys input to submit a PR!
from train-departure-display.
Can I suggest that if we go down this route we put it behind a config? I'd much prefer my display to not update so that there's a more graceful degredation
from train-departure-display.
That's a fair point, as it stands I think that by the point the loop has got here the old departure data will have been unset, I will try to have a play around this evening to see if there's anything that can be done
from train-departure-display.
@BeauAgst I have added a variable that gets written to each time there is good data which can be used in the event of API failure.
I left the original error handling in, in case the display gets started and there is no good data at all
Obviously if there is an extended downtime this data just plain won't update until there is any more data, but I don't think there's an easy way to sanity check that.
I guess you could add an indicator in an unused part of the display to indicate it's not using live data, maybe just an asterisk on the clock line or something. Open to suggestions!
from train-departure-display.
I think I'm of the view here that if we have good data (even if outdated) we can show it, but like you say if we start the display and there's no good data at all it's good to show the error message.
from train-departure-display.
Related Issues (20)
- firstDepartureBold variable not working HOT 2
- Screen glitch HOT 1
- Ability to filter by multiple platforms HOT 2
- Feature Request: London Underground Departures HOT 1
- Stuck on welcome screen HOT 2
- GPIO In Use Error HOT 1
- unable to boot Pi
- Delayed trains re-order HOT 1
- More than one screenBlankHours
- Add RealTimeTrains API HOT 2
- Screen stuck on 'UK Train Departure Display' HOT 2
- Change station without logging in HOT 1
- Successful use of 5.5" OLED (documentation) HOT 3
- Calling at stops showing HOT 3
- Platforms > 10 doesn't show HOT 1
- Dual display calling at not showing all stations HOT 1
- Letters on platforms not showing correctly for half platform stations HOT 1
- Pretty sure this is NOT a code issue...
- Multiple destinationStation variable - London
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from train-departure-display.