MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-ResRobot - Public transport information for Sweden

    Scheduled Pinned Locked Moved Transport
    138 Posts 27 Posters 199.5k Views 28 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V Offline
      Von Sudden @Alvinger
      last edited by

      @Alvinger Almost there. The type symbols are gone, and some tracks are still undefined.

      https://www.dropbox.com/s/zbxs418ax24p90w/DSC_0977.JPG?dl=0

      1 Reply Last reply Reply Quote 0
      • O Offline
        off112
        last edited by

        @Alvinger Thank you for your good work :)

        1 Reply Last reply Reply Quote 0
        • V Offline
          Von Sudden @Alvinger
          last edited by

          @Alvinger I made a quick fix of line 120 in MMM-ResRobot.js

          depLineCell.innerHTML = departure.track || " ";

          That made the odd “undefined” tracks disappear from the track column if Västtrafik does not provide that field.

          The FontAwesome symbol is still missing in the type column, though.

          Thanks for the awesome work.

          AlvingerA 1 Reply Last reply Reply Quote 2
          • AlvingerA Offline
            Alvinger @Von Sudden
            last edited by

            @Von-Sudden thank you for helping out. I will look into the font awedome issue.

            1 Reply Last reply Reply Quote 0
            • L Offline
              leanro
              last edited by sdetweil

              Hej!

              I’m trying to get the MMM-Resrobot to work but … no success. In my MM, it permanently says “Fetching Departures …”

              I have an API-key which seems to work, I checked at https://api.resrobot.se/v2/departureBoard?key=WITH-MY-API-KEY-HERE&id=740015972.

              My config.js looks like this:

              {
                                      module: "MMM-ResRobot",
                                      position: "top_right",
                                      header: "Departures",
                                      config: {
                                              routes: [ // stations from: 
                                                      {from: "740015972", to: ""}, 
                                              ],
                                              apiKey: "WITH-MY-API-KEY-HERE"
                                      },
                              },
              

              The MMM-ResRobot.js looks like this:

                  ```
              

              defaults: {
              updateInterval: 5 * 60 * 1000,
              animationSpeed: 2000,
              fade: true,
              fadePoint: 0.25, // Start on 1/4th of the list.
              apiBase: “https://api.resrobot.se/v2/departureBoard?format=json&passlist=0”,
              skipMinutes: 0, // Number of minutes to skip before showing departures
              maximumEntries: 6, // Maximum Entries to show on screen
              truncateAfter: 5, // A value > 0 will truncate direction name at … … …
              iconTable: {
              “B”: “fa fa-bus”,
              “S”: “fa fa-subway”,
              “J”: “fa fa-train”,
              “U”: “fa fa-subway”,
              “F”: “fa fa-ship”,
              },
              },

              
              Anyone who has an idea?
              Appreciated! Tack!
              L 1 Reply Last reply Reply Quote 0
              • L Offline
                leanro @leanro
                last edited by leanro

                @leanro said in MMM-ResRobot - Public transport information for Sweden:

                Hej!

                I’m trying to get the MMM-Resrobot to work but … no success. In my MM, it permanently says “Fetching Departures …”
                …
                …
                …

                Anyone who has an idea?
                Appreciated! Tack!

                After angrily restarting the RPi, the module works. Can’t tell you, why it didn’t work in the first place but I can confirm that the configs i posted before work.

                Good luck!

                Update: whenever sth is changed in the configs, a reload does not help I need to totally stop MM and restart for the changes to be effective.

                AlvingerA 1 Reply Last reply Reply Quote 0
                • AlvingerA Offline
                  Alvinger @leanro
                  last edited by

                  @leanro great to hear it works. I had one or two of these “fetching departures” when I ran MagicMirror on my Rpi 1 with 256MB memory but since switching to a VM I haven’t seen it. As you have noticed, the solution is to restart MagicMirror.

                  1 Reply Last reply Reply Quote 1
                  • L Offline
                    leanro
                    last edited by

                    Hej!

                    Now I do have another problem which could not be solved by restarting.

                    I wanted to apply two sections for two different routes. Unfortunately, the settings from the second modules are taken over also for the first module. I have two identical timetables instead of two different ones.

                    Do you know what the problem/solution could be?

                    I have other modules which are used twice (e.g., calendar, weather), no problems there.

                    1 Reply Last reply Reply Quote 0
                    • AlvingerA Offline
                      Alvinger
                      last edited by Alvinger

                      Yes, I think I know what the issue is. Currently, only one section is supported due to the fact that the node helper only supports one set of data. As the daily request limits for ResRobot bronze are a bit low I try to cache data and reduce the number of calls as much as possible. And one of the design decisions I made was to only do one section. (You can have multiple routes in the same section which is my use case)

                      However, I do realize the need for multiple sections and it is on my todo list. Unfortunately I’been bitten by the home automation bug and haven’t spent so much time on MagicMirror lately So there is no ETA for it.

                      1 Reply Last reply Reply Quote 0
                      • L Offline
                        leanro
                        last edited by leanro

                        @Alvinger Thanks for the quick answer! Now I know at least what the problem was/is.
                        Good luck for other projects!

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          jocke.almgren
                          last edited by

                          Hi

                          I hope this forum still is active ;)

                          I just started my Magic Mirror project, and of course i need bus departures to be on the mirror.
                          But i can’t figure out why it never shows on the screen… it’s not the whole screen that is black, the ResRobot module just doesn’t show.
                          this is my config.js

                          			{
                          			module: "MMM-ResRobot",
                          			position: "top_center",
                          			header: "Departures",
                          			config: {
                          				routes: [
                          					{from: "740054292", to: "740040961"},
                          					{from: "740053855", to: "740010956"}
                          				],
                          				skipMinutes: 0,
                          				maximumEntries: 6,
                          				truncateAfter: 5,
                          				apiKey: "XXXXXX"
                          			}
                          

                          Any help so much appreciated

                          AlvingerA 1 Reply Last reply Reply Quote 0
                          • AlvingerA Offline
                            Alvinger @jocke.almgren
                            last edited by

                            @jocke-almgren just to make sure: you have registered for an API key at Trafiklab?

                            J 1 Reply Last reply Reply Quote 0
                            • J Offline
                              jocke.almgren @Alvinger
                              last edited by

                              @Alvinger Hi - thanks for your reply. Turns out i was a total idiot and placed the module in the “modules/default” directory instead of the modules root :man_facepalming: Moved the folder and all is good.
                              Thanks for the support anyways

                              1 Reply Last reply Reply Quote 0
                              • sweupS Offline
                                sweup
                                last edited by

                                Hi, how do i update?, i tried
                                cd ~/MagicMirror/modules/MMM-ResRobot
                                git pull
                                npm install

                                But frontend still says a newer update is found…

                                S AlvingerA 2 Replies Last reply Reply Quote 0
                                • S Offline
                                  sdetweil @sweup
                                  last edited by

                                  @sweup what was the output of git pull?

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  sweupS 1 Reply Last reply Reply Quote 0
                                  • AlvingerA Offline
                                    Alvinger @sweup
                                    last edited by

                                    @sweup did you restart the MagicMirror service after you updated?

                                    1 Reply Last reply Reply Quote 0
                                    • sweupS Offline
                                      sweup @sdetweil
                                      last edited by sweup

                                      @sdetweil - I only got this

                                      pi@raspberrypi:~ $ cd ~/MagicMirror/modules/MMM-ResRobot
                                      pi@raspberrypi:~/MagicMirror/modules/MMM-ResRobot $ git pull
                                      Updating 1618fcc..695f70d
                                      error: Your local changes to the following files would be overwritten by merge:
                                      	package.json
                                      Please commit your changes or stash them before you merge.
                                      Aborting
                                      pi@raspberrypi:~/MagicMirror/modules/MMM-ResRobot $ npm install
                                      npm WARN npm npm does not support Node.js v10.21.0
                                      npm WARN npm You should probably upgrade to a newer version of node as we
                                      npm WARN npm can't make any promises that npm will work with this version.
                                      npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
                                      npm WARN npm You can find the latest version at https://nodejs.org/
                                      up to date in 1.083s
                                      pi@raspberrypi:~/MagicMirror/modules/MMM-ResRobot $ 
                                      
                                      

                                      @Alvinger - I did a sudo reboot

                                      AlvingerA 1 Reply Last reply Reply Quote 0
                                      • AlvingerA Offline
                                        Alvinger @sweup
                                        last edited by

                                        @sweup it seems you have changed the file package.json

                                        Stash it away with “git stash” and try the update again.

                                        sweupS 1 Reply Last reply Reply Quote 0
                                        • sweupS Offline
                                          sweup @Alvinger
                                          last edited by sweup

                                          @Alvinger said in MMM-ResRobot - Public transport information for Sweden:

                                          git stash

                                          Like this?

                                          cd ~/MagicMirror/modules/MMM-ResRobot
                                          git stash
                                          npm install
                                          

                                          Edit:misspell

                                          AlvingerA 1 Reply Last reply Reply Quote 0
                                          • AlvingerA Offline
                                            Alvinger @sweup
                                            last edited by Alvinger

                                            @sweup
                                            git stash
                                            git pull
                                            npm install

                                            sweupS 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 5 / 7
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy