MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED London DLR arrivals

    Requests
    3
    8
    1430
    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.
    • D
      dragon8_uk last edited by dragon8_uk

      Hi,

      Looking for a module that will pull in the arrival times of DLR trains customisable by station and destination.

      i.e.

      next arrival @ (station) to (destination) in (time) (i.e.7mins)

      The data can be pulled from the TFL api.

      https://api.tfl.gov.uk/StopPoint/940GZZDLGAL/Arrivals

      I am happy to try and write the module myself but have no experience scripting with node.js any assistance would be appreciated.

      Thanks

      J.

      lavolp3 2 Replies Last reply Reply Quote 0
      • lavolp3
        lavolp3 Module Developer @dragon8_uk last edited by lavolp3

        @dragon8_uk sounds good and not too difficult:

        I would structure it this way:

        Main.js:
        defaults:

        • station
        • arrivals / departures
        • API Key/

        functions:

        • start: sendSocketNoti (to node_helper.js) including config
        • socketNotiReceived: get json from node_helper and store it in an object. Then call getDom()
        • getDom: create dom and include object elements as table including line and ETA
        • setInterval() to create a loop calling the API with a certain interval.

        Node_helper

        • socketNotiReceived: get config from main.js, call API url, fetch data and send it back to main.js via sendSocketNoti.

        No claim for completeness.
        There is a vast amount of modules here working roughly like this. Take a look around on github for
        third party modules and check the MagicMirror Readme for creating modules.

        It’s really not difficult and much fun to develop!

        How to troubleshoot modules
        MMM-soccer v2, MMM-AVStock

        1 Reply Last reply Reply Quote 0
        • lavolp3
          lavolp3 Module Developer @dragon8_uk last edited by

          @dragon8_uk Have a look at this:

          https://github.com/ryck/MMM-TFL-Arrivals
          Should work for DLR as well!?

          Or this one:
          https://github.com/nwootton/MMM-UKLiveBusStopInfo

          How to troubleshoot modules
          MMM-soccer v2, MMM-AVStock

          1 Reply Last reply Reply Quote 0
          • P
            pumpy266 last edited by

            Has anyone got MMM-TFL-Arrivals running?
            Just shows a blank screen for me.

            The UKLiveBusStopInfo did work, but did some strange things to some buses. Also what is needed is for a ETA not if the bus is late.

            Just spent the evening trying to parse the JSON data using MMM-json-feed. That didn’t behave either, it either displays the whole feed or nothing at all.

            Is there anyone a bit more knowledgeable who can look into this, live bus and train departures for TfL would be awesome.

            lavolp3 2 Replies Last reply Reply Quote 0
            • lavolp3
              lavolp3 Module Developer @pumpy266 last edited by

              @pumpy266 im trying it out at the moment

              How to troubleshoot modules
              MMM-soccer v2, MMM-AVStock

              1 Reply Last reply Reply Quote 0
              • lavolp3
                lavolp3 Module Developer @pumpy266 last edited by

                @pumpy266 tfl-arrivals works for me.
                Have you set

                debug: true
                

                in the config?
                Then you can check for debug messages in the developers console.
                Either by pressing f12 in your browser or by starting the mirror with npm start dev

                How to troubleshoot modules
                MMM-soccer v2, MMM-AVStock

                P 1 Reply Last reply Reply Quote 0
                • P
                  pumpy266 @lavolp3 last edited by

                  @lavolp3 Interesting, many thanks for looking at this.
                  I am running it in MMM-Pages so Alexa can control it, I am new to all of this so just asking in case this has any bearing on things?

                  Can’t look right now, but will in the morning.

                  1 Reply Last reply Reply Quote 0
                  • P
                    pumpy266 last edited by

                    Slightly later than expected.
                    Many thanks for trying the module out and confirming it works.
                    OK, got the TFL-Arrivals working.
                    But not in MMM-Pages.

                    Any thoughts on how to troubleshoot this?

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Enjoying MagicMirror? Please consider a donation!
                    MagicMirror created by Michael Teeuw.
                    Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy