nwootton / mmm-uklivebusstopinfo Goto Github PK
View Code? Open in Web Editor NEWMagic Mirror Module for UK bus information. Returns real-time info about a SPECIFIC bus stop
License: MIT License
Magic Mirror Module for UK bus information. Returns real-time info about a SPECIFIC bus stop
License: MIT License
Allows saving credits when using MMM-ModuleScheduler to hide the module, by checking if the module is hidden before querying the transport API.
Having successfully got the bus stop and train modules working a week or so ago, I've noticed that the Bus modules now shows that there are "No departures scheduled". I've queried the TransportAPI and think it is giving the required info.
I had a notification that the module was two commits behind and so I ran a git pull and installed, but to no avail.
I haven't really tinkered with the settings within the module and so it is running all the standard settings...
{
module: 'MMM-UKLiveBusStopInfo',
position: 'bottom_left',
header: 'Departures'
config: {
atcocode: '490005445C',
app_id: '.....',
app_key: '.....',
limit: 5,
nextBuses: 'no'
showRealTime: false,
showDelay: false,
}
As I say, my AppId and AppKey are working fine on the train module, so I know that's not a factor.
I am a complete RaspPi, Linux and MM noob, so apologies if I've made a simple goof. I am also aware that you are no longer working on this module, but if anyone else has any ideas, it'd be much appreciated. My son likes to see when his next buses are due!
In order to get more use of the NextBuses API, would it be possible to implement start/stop time ranges to set nextBuses=yes on a schedule? I expect most people have a regular commute where they'd like more accurate bus times for a short period of each day ...
e.g.
nextBusesStart: 07.45
nextBusesStop: 08.15
If that could be combined with a general start/stop time for all updates then you could stop polling the API completely overnight (our buses don't run overnight anyway).
e.g.
start: 07.30
stop: 19.30
Based on those examples I think you could have it updating every 1 minute and still keep under the 1000 requests per day ...
Hi,
This is possibly me being a complete newbie at this. I can see the module works (I've tried using another atcocode)
I'm trying to use the Atco code for my stop, which I believe is 73723972 but this doesn't load.
I'm posting here in the hope someone can help and tell me what I'm doing wrong.
If this isn't the best place to post... Then please accept my apologies.
Report from user via forum:
"I use it for two bus routes (44 and 344) and what I noticed during the weekend is that very early buses (like 01:00 in the morning or so) got delayed. BUT they got delayed more and more according to the module which causes the timing to be off. Eventually the timer showed something like “1756 Minutes late”. These late runners did not disappear but would always stay on top of the list.
I understand that this might be a bug on TFL’s side but is there a way to have buses that are, lets say more than 60 minutes delayed, shown as cancelled or have them faded out? For routes that are running like every 5-10 minutes usually this might make sense I think."
Throws an error about updating the DOM when used with certain other modules.
Uncaught TypeError: Cannot read property 'getElementsByClassName' of null
at moduleNeedsUpdate (main.js:134)
at updateDom (main.js:104)
at Object.updateDom (main.js:472)
at Class.updateDom (module.js:296)
at Class.processBuses (MMM-UKLiveBusStopInfo.js:220)
at XMLHttpRequest.busInfoRequest.onreadystatechange (MMM-UKLiveBusStopInfo.js:151)
I noticed you're including the app id & key from our docs in the README here. Just to let you know this one will be stopping working quite soon.
I don't think it really matters actually. Your README does a good a job of linking where folks need to go to register their own app id & key ( https://developer.transportapi.com ) . But just to note that soon they will need to do that, because that sample key won't work.
....
This looks neat by the way! So d'you have a mirror which tells you when the bus is coming? I want to see it!
Hi,
My Pi is constantly on and I noticed that the module stops loading the bus times between midnight-1am and it won't refresh it until a restart the mirror.
Can you fix this issue or is it because of my particular bus?
I have noticed that the bus info from transportapi costs 10 requests. Wondering if its worth noting that here anywhere?
Hi,
I did the step by step and everything seemed to install fine, but I'm stuck on loading and the console is telling me there is an error on line 206 of the .js file? I got this module working a few days ago but since updating it's stopped working and given me that error, any help is greatly appreciated
-Dave
Hi, I closed my other ticket (#9) as it had gone way off the original topic and I have better debug info now. I've removed MMM-Schedule from the equation entirely and the issue still occurs so it's nothing to do with that.
To recap, I'm having trouble getting the nextbus times to work reliably. Running MM in dev mode I can see console errors along these lines (sorry as MM is running on another machine via ssh I can't screengrab or copy and paste the errors):
Uncaught TypeError: Cannot read property 'split' of null
Expanding the object above that error in the console, I can see that expected_departure_date
and expected_departure_time
are both null
.
There are values for aimed_departure_time
, best_departure_estimate
, and date
Here's my config.js:
{
module: 'MMM-UKLiveBusStopInfo', //Accurate times to Leeds
position: 'bottom_left',
header: 'To Leeds (realtime)', //Optional - delete this line to turn OFF the header completely
config: {
atcocode: '3200YNA00515', // ATCO code for specific bus stop
app_id: '###', // TransportAPI App ID
app_key: '###', // TransportAPI App Key
limit: 5, // Optional - Maximum results to display.
nextBuses: 'yes',
updateInterval: 60000,
showRealTime: true, // Optional - show realtime departure info
showDelay: true, // Optional - show delay in minutes based on Real Time info vs Time table
showBearing: true,
debug: true
}
},
... let me know if there's anything I should look for in the console output that might help here?
Hi,
When I set the following:
showRealTime: true, // Optional - show realtime departure info
showDelay: true, // Optional - show delay in minutes based on Real Time info vs Time table
It gets stuck at 'loading'
When removed, it appears fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.