MMM-Ruter (for Oslo and Akershus in Norway)


  • Module Developer

    The ‘MMM-Ruter’ is a module for displaying public transport information for Oslo and Akershus in Norway on Magic Mirror 2. It’s using data from Ruter.no

    0_1477240730716_MMM-Ruter_Simple.png

    Let me know if you have any bugs, suggestions or feature request!


  • Module Developer

    [1.0.1] - 2016-10-24

    • Fixed stupid this/self-bug in the refresh-code that I managed to introduce just before initial commit


  • Great work @Cato!

    Super easy install. Will look forward to playing with the config in the week ahead.

    ruter module

    Proof: https://www.dropbox.com/s/zafm6q8k8hg8e1t/2016-10-24 23.42.24.jpg?dl=0


  • Module Developer

    Glad you liked it, @open_book !

    Just one question to your proof-picture: I know, from previous chats with you, that you are Norwegian speaking but not coming from Norway (?). Is the time on purpose to be shown as 12 hour clock instead of 24 hour?


  • Module Developer

    [1.0.2] - 2016-11-01

    • Added timeToThere config value to stops
    • Fixed duplication of journeys if manually refreshed


  • Hi @Cato sorry for the slow response.

    I’ve pulled v 1.0.2 but haven’t changed my config file. It looks like this:

    {
    module: 'MMM-Ruter',
    header: 'Ruter',
    position: 'bottom_left',
    config: {
    showPlatform: false,
    maxItems: 10,
    stops: [
    { 
    stopId: "3010430",
    platforms: [ ]
    }
    ]
    }
    },
    

    In reply to your previous question: I haven’t changed the time settings on the module. The time in the default clock module is in 24 hour format. So is the Pi. Any guesses as to the reason? It’s not a big problem for me, or it wasn’t, until you pointed it out ;)

    Two other comments:

    The GUI visibly refreshes inconsistently (between every 5 and 20 seconds) but often. Often enough that it’s visually distracting. Not sure what is triggering the refresh - serviceReloadInterval or timeReloadInterval maybe? Have you changed these in your setup? If so maybe post the config so that I can copy those settings and see if the problem fixes.

    See you have down as a point for future improvement the ability to run two instances of the module at the same time. I’d just like to second that! I’d like to have two instances running in two different corners of my mirror for the two nearest transport hubs we use. I would certainly make use of it if/when you get the time to add it.

    Hope to be a bit more available in the week ahead if you have any other questions.


  • Module Developer

    Hi @open_book, sorry for delay, I’ve been quite busy lately.

    1. About the wrong time in your module: Have you configured “language” in the Magic Mirror config? If so, what setting?

    2. The GUI refreshes if a change is triggered from the service with the interval defined in serviceReloadTime (default every 30 seconds) or by the GUI-side (when remaining minutes changes) with the interval of timeReloadTime (default every 1 second). Both service and GUI will only update if there IS a change. This is detected by comparing last output with current using a simple MD5 hash comparison.

    The reason why I picked two intervals was that I wasn’t sure how often I could call Ruter API before they would, in the worst case, block me. I wanted to make sure GUI would show correct number of minutes all the time even if I didn’t call the Ruter API so often.

    If you have many stops or display many items a change will of course happen more often. Could you record a movie if GUI updates even if there aren’t any changes (in remaining minutes, order of items etc)?

    1. Anyway, I will in near future re-write my backend to accommodate multiple instances of the module. Will then also reconsider how I update GUI.

    < Cato />



  • Hi @Cato all good!

    Default config language is “en” (english).

    Here is a film demonstrating the refreshing issue:

    https://www.dropbox.com/s/5n0lkx9z3lhznkn/2016-11-05 18.52.26.mp4?dl=0

    I tried setting the animation speed to 10 to elimate the display flicker. It’s a simple hack, but worked fine. Now it’s barely noticeable.

    :)



  • Hi @Cato ,

    I’ve just updated with MM 2.1.0 and checked that I’m running the latest version of MMM-Ruter.

    When I tried to run the module with two different stops, it crashed the config file.

    ´´´´javascript´´´´

    {
    module: ‘MMM-Ruter’,
    header: ‘Ruter’,
    position: ‘bottom_right’,
    config: {
    showPlatform: true,
    maxItems: 10,
    stops: [
    {
    stopId: “3010430”,
    platforms: [ “1”, “2” ],
    timetoThere: 2
    }
    {
    stopId: “3010425”,
    platforms: [ “1”, “2” ]
    timetoThere: 2
    }
    ]
    }
    },
    ´´´´javascript´´´´

    It runs fine with 1 stop. But I get a config error message with 2 stops. Even if I just copy the exact same information two times.

    Is there an error in the config above? Let me know!


  • Module Developer

    @open_book Seems you are missing a comma between the stops.


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.