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.

    Transit module stopped working

    Scheduled Pinned Locked Moved Troubleshooting
    29 Posts 5 Posters 8.2k Views 5 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.
    • E Offline
      Elaniobro
      last edited by

      @sdetweil what makes you think the API changed? ( I am the author, and am looking into it now)

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @Elaniobro
        last edited by sdetweil

        @Elaniobro I posted a couple messages back the error info. node_helper line 106 called something which threw an error

        2020-06-30 09:41:59.974] [ERROR]  (node:882) UnhandledPromiseRejectionWarning: Error: Error: Illegal group end indicator for Message .transit_realtime.FeedMessage: 7 (not a group)
        0|mm       |     at /home/pi/MagicMirror/modules/MMM-nyc-transit/node_helper.js:106:15
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        E 1 Reply Last reply Reply Quote 0
        • E Offline
          elliob @sdetweil
          last edited by

          @sdetweil how did you get to error message? What’s the CLI?

          S N 2 Replies Last reply Reply Quote 0
          • S Offline
            sdetweil @elliob
            last edited by

            @elliob it was in the pm2 log in the 1st post of this topic

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • N Offline
              nipper2000h @elliob
              last edited by

              @elliob I’m using pm2 to start MM so from the root directory:

              pm2 logs mm
              
              S 1 Reply Last reply Reply Quote 1
              • S Offline
                sdetweil @nipper2000h
                last edited by sdetweil

                @nipper2000h the logs are stored in the users .pm2 folder. doesn’t matter where I issue the pm2 commands

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 1
                • E Offline
                  Elaniobro
                  last edited by

                  The module is getting the data, but its not updating with the this.updateDom method. I am not sure if this was deprecated or not. Looking into it.

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @Elaniobro
                    last edited by

                    @Elaniobro how does it use this.updateDom()

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    E 1 Reply Last reply Reply Quote 0
                    • E Offline
                      Elaniobro @sdetweil
                      last edited by Elaniobro

                      @sdetweil Its called in the socketNotificationReceived() here:
                      https://github.com/Elaniobro/MMM-nyc-transit/blob/master/MMM-nyc-transit.js#L358-L360

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @Elaniobro
                        last edited by

                        @Elaniobro where is self set.? and fadeSpeed?

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        E 1 Reply Last reply Reply Quote 0
                        • E Offline
                          Elaniobro @sdetweil
                          last edited by

                          @sdetweil They aren’t, they can be removed. Issue I am seeing is the payload is not populated indo the getDom()

                          I am setting this.result = payload which on intitial load/start of the module is undefined, which is expected, since the API promise has not been fulfilled. Later on, the socketNotificationReceived() recieves a payload which is set to this.result but in the getDom() var data = this.result is never updated.

                          I am unsure of where/what caused this breakdown, as last time I touched the code was Apr 30. This is leading me to believe something changed in Core, but I am unaware of what that might be.

                          S 1 Reply Last reply Reply Quote 0
                          • S Offline
                            sdetweil @Elaniobro
                            last edited by

                            @Elaniobro are u debugging w the developers window?
                            you can walk thru the code as it executes
                            ctrl-shift-i and select the sources tab, use the tree on the left to find your module, and it’s source

                            then click the left edge of a line of code u want to examine, and a stop will be added.

                            usually a problem like this is because the ‘this.’ pointer doesn’t point where u think it does.

                            sorry, I am in hospital for a few more days and cannot debug from here

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            E 1 Reply Last reply Reply Quote 0
                            • E Offline
                              Elaniobro @sdetweil
                              last edited by

                              @sdetweil Thank you for your feedback. I am/was already debugging in the manner you mentioned. I was able to resolve the bug(s), but now I am still not seeing any data. My best guess is somewhere along the fetch of the data something changed or broke. The application is returning data, but the response is empty.

                              payload = [{ downTown: [] }, { upTown: [] }]

                              For some reason, just not getting any data :/

                              I am still digging in.

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

                                @Elaniobro boooo. always something! let me know if I can help

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                1 Reply Last reply Reply Quote 0
                                • S Offline
                                  sdetweil @Elaniobro
                                  last edited by

                                  @Elaniobro probably another ‘this’ pointer issue

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  E 1 Reply Last reply Reply Quote 0
                                  • E Offline
                                    Elaniobro @sdetweil
                                    last edited by

                                    @sdetweil Welcome to assist, you can find the repo here: https://github.com/Elaniobro/MMM-nyc-transit

                                    I do have it cleaned up a bit locally, but I am thinking my API key is no longer valid and or something changed upstream that I am not aware of. The mirror is doing what it should and returning results array, but the array is empty.

                                    S 1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      sdetweil @Elaniobro
                                      last edited by

                                      @Elaniobro using the default config, i also see the lack of info

                                          client.departures(stations)
                                            .then((responses) => {
                                              var upTown = []
                                              var downTown = []
                                      
                                              console.log("api results="+JSON.stringify(responses))
                                      

                                      actual data

                                       api results=[{"complexId":237,"name":"Carroll St","lines":[{"name":"6th Av - Culver","departures":{"S":[],"N":[]}}]},{"complexId":177,"name":"Clinton - Washington Avs","lines":[{"name":"8th Av - Fulton St","departures":{"S":[],"N":[]}}]}]
                                      

                                      config

                                          config: {
                                            apiKey: '****',   // just granted
                                            displayType: 'marquee',
                                            mtaType: 'train',
                                            stations: [
                                              {
                                                stationId: 237,
                                                walkingTime: 5,
                                                dir: {
                                                    upTown: false,
                                                    downTown: true
                                                }
                                              },
                                              {
                                                stationId: 177,
                                                walkingTime: 5,
                                                dir: {
                                                  upTown: true,
                                                  downTown: false
                                                }
                                              }
                                            ],
                                      

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

                                      1 Reply Last reply Reply Quote 1
                                      • E Offline
                                        Elaniobro
                                        last edited by

                                        We can close this issue, it was resolved on github. The module itself never broke, it was an upstream service that did. A module that I was using, was using deprecated endpoints. I spoke with the developer and the MTA and we were able to isolate and resolve it.

                                        In addition, not only did the endpoints change but any API keys generated on their old site, datamine.mta.info will no longer work.

                                        You will need to create a new one via api.mta.info moving forward.

                                        Thank you for your assist and feed back.

                                        S 1 Reply Last reply Reply Quote 1
                                        • S Offline
                                          sdetweil @Elaniobro
                                          last edited by

                                          @Elaniobro glad I found the cause. sure makes for a deep dive into the stuff we use when something changes…

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

                                          N 1 Reply Last reply Reply Quote 0
                                          • N Offline
                                            Nneuland @sdetweil
                                            last edited by

                                            I’m running into this exact issue today. New install has not resolved. Neither has requesting a new API key. Any suggestions?

                                            S 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
                                            • 1 / 2
                                            • 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