• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

London DLR arrivals

Scheduled Pinned Locked Moved Unsolved Requests
8 Posts 3 Posters 2.0k Views 3 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.
  • D Offline
    dragon8_uk
    last edited by dragon8_uk Nov 20, 2019, 1:08 PM Nov 20, 2019, 1:07 PM

    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.

    L 2 Replies Last reply Nov 20, 2019, 3:11 PM Reply Quote 0
    • L Offline
      lavolp3 Module Developer @dragon8_uk
      last edited by lavolp3 Nov 20, 2019, 3:12 PM Nov 20, 2019, 3:11 PM

      @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
      • L Offline
        lavolp3 Module Developer @dragon8_uk
        last edited by Nov 20, 2019, 11:10 PM

        @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 Offline
          pumpy266
          last edited by Nov 22, 2019, 11:41 PM

          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.

          L 2 Replies Last reply Nov 23, 2019, 7:25 PM Reply Quote 0
          • L Offline
            lavolp3 Module Developer @pumpy266
            last edited by Nov 23, 2019, 7:25 PM

            @pumpy266 im trying it out at the moment

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

            1 Reply Last reply Reply Quote 0
            • L Offline
              lavolp3 Module Developer @pumpy266
              last edited by Nov 23, 2019, 8:36 PM

              @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 Nov 23, 2019, 8:49 PM Reply Quote 0
              • P Offline
                pumpy266 @lavolp3
                last edited by Nov 23, 2019, 8:49 PM

                @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 Offline
                  pumpy266
                  last edited by Nov 24, 2019, 5:05 PM

                  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
                  1 / 1
                  • First post
                    1/8
                    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