• 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 Bus status

Scheduled Pinned Locked Moved Requests
27 Posts 4 Posters 14.5k 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.
  • S Offline
    soqueen
    last edited by Apr 10, 2017, 6:18 PM

    That certainly helped! The code loads now and now it’s stuck on Loading bus info… time to recheck my api codes?

    1 Reply Last reply Reply Quote 0
    • N Offline
      nwootton Module Developer @strawberry 3.141
      last edited by Apr 10, 2017, 6:46 PM

      @strawberry-3.141 good catch!

      1 Reply Last reply Reply Quote 0
      • S Offline
        soqueen
        last edited by Apr 10, 2017, 6:46 PM

        Thank you both! I have gotten it up and running! Looks GREAT!

        1 Reply Last reply Reply Quote 0
        • S Offline
          soqueen
          last edited by Apr 10, 2017, 6:54 PM

          @nmootton Hi there! Thank you for being so responsive! I had another question. I actually want to load 3 of these. I tried loading the module three separate times, but it just loads 3 of the initial entry, even though the atcocodes are different for each one. Any suggestions?

          N 1 Reply Last reply Apr 10, 2017, 7:04 PM Reply Quote 0
          • N Offline
            nwootton Module Developer @soqueen
            last edited by nwootton Apr 10, 2017, 7:14 PM Apr 10, 2017, 7:04 PM

            @soqueen I have to say I’ve never considered it. Both this and the rail version were something I built more as an experiment than anything else. I’m not even sure I’d know how to handle multiple instances of a module.

            I’ll have to have a think/read and see how it could be done. Perhaps other more experienced devs may be able to chip in here?

            I will say that running three of these could get expensive in terms of api calls per day… if you use the next bus capability that would be 30 points per call or a max of 33 calls per day (~ every 45 minutes), which might not be enough to make the module really useful. You could get three distinct API keys I guess, but I’m not sure how TransportAPI would view that!

            I did consider some form of time range, but again it wasn’t something I needed for the experiment. Perhaps I need to find some time to reconsider that as an option!

            1 Reply Last reply Reply Quote 0
            • S Offline
              strawberry 3.141 Project Sponsor Module Developer
              last edited by Apr 10, 2017, 7:16 PM

              your module has a node_helper

              if there are 3 instances in the config of this module, all 3 share the same node_helper and therefore get the same socketnotifications

              workaround that some users have done is copy the module folder and named it modulename2 also changed the modulename.js to modulename2.js and in the js file the string from modulename to modulename2. this will create a node_helper for modulename and one for modulename2

              what a dev could do is the following, have the updateinterval in the module which is sending the requesturl to the nodehelper, so every instance sends it and gets executed and then you send the result back to the module and also for which station this request was performed, then you check in the module if the result is based on the station of this instance then process the data otherwise ignore that socketnotification.

              Please create a github issue if you need help, so I can keep track

              N 1 Reply Last reply Apr 10, 2017, 7:40 PM Reply Quote 0
              • N Offline
                nwootton Module Developer @strawberry 3.141
                last edited by Apr 10, 2017, 7:40 PM

                @strawberry-3.141 If I get the chance I’ll look at passing an identity to the helper so it knows where to route the response back to.

                1 Reply Last reply Reply Quote 0
                • S Offline
                  soqueen
                  last edited by Apr 11, 2017, 7:44 AM

                  Hm. I tried that. I copied the module and contents to modulename2, changed the .js to 2.js - edited the 2.js to (module.register) to modulename2 .

                  Then I changed my config file - copied the first module to another instance and changed its name to modulename2. (then i changed the atcocode for a new bus stop). --It’s stuck on loading bus info…

                  N 1 Reply Last reply Apr 11, 2017, 2:18 PM Reply Quote 0
                  • N Offline
                    nwootton Module Developer @soqueen
                    last edited by Apr 11, 2017, 2:18 PM

                    @soqueen I’ve just pushed a new version that hopefully allows you to have multiple instances of the module running. It’s been working happily this afternoon running three different bus stops around the area with no complaints.

                    You’ll need to do a git pull to update, then run the

                    cd MMM-UKLiveBusStopInfo
                    npm install 
                    

                    to install the new dependencies.

                    Give it a try and let me know. If it goes pear-shaped I can always roll the old version back and look again later.

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      soqueen
                      last edited by Apr 11, 2017, 3:14 PM

                      It works! Thank you SO VERY much! I really appreciate it! Thank you!

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      2 / 3
                      • First post
                        20/27
                        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