saml-dev / MMM-Traffic

This a module for the MagicMirror. It displays travel time between two locations, using the Mapbox directions API to factor in current traffic conditions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module not appearing

FyLapS opened this issue · comments

Hey thanks for this module! The old version was working great for me, but since updating it never starts. In other words, my MM works fine but the traffic times never show up from this module. I've been looking at my code and can't find anything - if my code seems ok could it be that I missed something when registering with Mapbox even tho I have an API? Did I need to do something with them after I have that API key?

Here's my code:
image

I've double check the API key and the whole thing is typed correctly (not all shown here)

i am getting the same kind of thing,

i can see it on the magic mirror the car icon but stays on 'loading'

this similar to you ?

Hey there, sorry for the delayed response. I haven't been able to reproduce this issue. I added error handling so that when an invalid API key is used, the module shows that (see pic). So I'm not sure what's going on in your case. Are you able to look at the logs and see if there's any other info?
image

Same. Not working for me either. Could it be that i didn't instal the dependencies? How do I do that?

To install the dependencies, just navigate into the MMM-traffic directory and run npm install

cool. now its showing up but i'm getting an error stating "API Error - InvalidInput Coordinate is invalid". I reversed the google maps coordinates though as you mention. Anything you can think of?

i got it! i had a space between the coordinates. thanks Sam!

@Gr1dL0ck23 to install the dependencies, navigate into the MMM-Traffic directory on your device and run npm install

Going back to my comment from a couple weeks ago, are you able to provide any logs or additional info about your setup? A config or anything? Otherwise I'm afraid I can't help you

Thanks for this @Gr1dL0ck23 . I'm very confused where that error is coming from but it at least gives me a place to start. Can you do me a favor, run git pull inside your MMM-Traffic directory just to confirm you're on the latest version?

hey @FyLapS @Gr1dL0ck23 I just pushed a new version that fixes the error that was in the logs that @Gr1dL0ck23 posted in his link above. It's a very odd error so I'm a bit skeptical that this is actually a fix, but run git pull inside your MMM-Traffic directory to pull the latest version, then fire it up and see if it works for you now. Let me know if it does please.

Okay after some more thought and another tweak, I am now more confident in this fix. I believe this issue is being caused by a different third party module and that's why I haven't been able to reproduce it. @Gr1dL0ck23 please send me a list of the other third party modules you are using so that I can narrow down which one is causing the problem and reach out to the developer to help them get a fix. Or if you'd like, you can disable your other modules one by one until your MMM-Traffic works to see which one is the culprit and then let me know.

If you git pull, I'm confident MMM-Traffic will start working for you.

@Gr1dL0ck23 you're absolutely right! I went to the code for that module, and spotted the problem immediately. It looks like there has been a PR open for 2 years to delete the line that is breaking other people's code but hasn't been merged by the owner unfortunately. May be best to stay away from that module unfortunately until the owner is able to invest the time to fix it.

If you want to continue using that module, let me know and I'll tell you what to delete to make sure it doesn't interfere with other modules.

Yep, that's right. In the file MMM-GoogleMapsTraffic.js, delete line 106 down at the bottom of the file. It's the line that says

console.log = this.styledMapType;

If you delete that line, you should be able to use both modules. Let me know if that works for you.