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-Departures - Public transport departures based on Oeffi data

    Scheduled Pinned Locked Moved Transport
    24 Posts 5 Posters 17.9k 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.
    • B Offline
      BenGig
      last edited by BenGig

      Description:

      I started a module for public transport data which uses the same data as the popular Oeffi smartphone app. Data sources from 13 cities and almost 20 countries are available, see https://oeffi.schildbach.de/ for an overview of available data providers.

      • no API key needed
      • no realtime information provided
      • can display several stations

      Read the documentation on how to determine the provider name and station id’s you want to use.

      Download:

      [card:BenGig/MMM-Departures]

      Version

      Version 0.2.1 (Fixed problem when using relative time)
      Version 0.2 (Options to limit lines and output width)
      Version 0.1 (Initial release)

      Screenshots:

      0_1490896843079_MMM-Departures-1.png

      S 1 Reply Last reply Reply Quote 1
      • S Offline
        sindbad6 @BenGig
        last edited by sindbad6

        @BenGig Great thing, you did. Was also trying to program a module based on the code the Andreas Schildbach provide. But to say the truth, this job is much more, as I can do. So I’m very happy to find your anouncement.

        I haven’t installed the module, but still have a question. I have no idea, how you implement the module, but Andreas often provide updates in his “Oeffi” to support changes in the APIs of the integrated data provider. So my question is, do your module take automatically advantage of his changes or do you have to reimplement it in your code?

        1 Reply Last reply Reply Quote 0
        • A Offline
          Ashidian
          last edited by

          Nice! I really love the oeffi app and always thought it’s a pity that it’s not available through an webpage.

          I will definitly test this out and maybe make contributions. Could you provide some screenshots? That would be awesome.

          1 Reply Last reply Reply Quote 0
          • B Offline
            BenGig
            last edited by

            I can only guess, but I don’t think the module will need changes. The providers data is fetched through the REST wrapper initially provided for a FHEM home automation module, and I thankfully may use it too. As I understand, behind the wrapper runs a instance of https://github.com/schildbach/public-transport-enabler which is actively maintained by Andreas Schildbach. And this enabler is the core unifier for the different providers.

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sindbad6 @BenGig
              last edited by

              @BenGig I know the repository from Andreas, if your module use this code, I suppose his changes will also work on your module. In between, I installed your module and it works perfect for my home town, what else could I need. It’s great.

              1 Reply Last reply Reply Quote 0
              • S Offline
                sindbad6
                last edited by

                After updating of MM to 2.1.1 and updating your module I get no data anymore. I get only the information “Lade” means load or wait. Any idea why this happens?

                Both was installed with git hub && npm install
                Anything I have to do?

                1 Reply Last reply Reply Quote 0
                • B Offline
                  BenGig
                  last edited by

                  No idea yet. I just upgraded to 2.1.1 and have no issues.

                  Do you see any error messages in the browser console?

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sindbad6 @BenGig
                    last edited by

                    @BenGig No, there are no messages belonging your module.

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      BenGig
                      last edited by

                      I added a global config option which will give some output to the browser console:

                          {
                            module: 'MMM-Departures',
                            position: 'bottom_left',
                            config: {
                              debug: true,
                            ...
                      

                      Results should look like this:

                      Processing station Aazopf
                      - Departures found: 5
                      -- Processing departure: NFB21,Arth-Goldau, Bahnhof,333
                      -- Processing departure: NFB21,Arth-Goldau, Bahnhof,374
                      

                      Well, should…

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sindbad6 @BenGig
                        last edited by

                        @BenGig I tried the debug mode. The only things I get is
                        Module helper loaded: MMM-Departure and
                        Connecting socket for: MMM-Departure
                        nothing else to see. Sorry! :disappointed_relieved:

                        1 Reply Last reply Reply Quote 0
                        • B Offline
                          BenGig
                          last edited by

                          I have added more debugging output, and an error output on the system console if a call to the web service fails.

                          And: most debugging output appears in the browser console. Hit F12 to open the development panel (Firefox or Chrome), and switch to the tab “Console” if not initially active.

                          S 1 Reply Last reply Reply Quote 0
                          • S Offline
                            sindbad6 @BenGig
                            last edited by

                            @BenGig Find out, that the error only occurs if I set

                            absoluteTime: false,
                            

                            If the parameter is set to true or the parameter is commented out the module works fine. Before the updates this setting works fine.

                            1 Reply Last reply Reply Quote 0
                            • B Offline
                              BenGig
                              last edited by

                              Great, that helped, problem found and fixed!

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                sindbad6 @BenGig
                                last edited by

                                @BenGig Yeah, here the same, it works now. Thanks to you. Just for curiosity, what did you change? What was the problem I have no idea in javascript programming and would like to learn something about it.

                                B 1 Reply Last reply Reply Quote 0
                                • B Offline
                                  BenGig @sindbad6
                                  last edited by

                                  @sindbad6 I refactored part of the main routine into a subroutine. A variable which was defined in the moved part was also used in the main routine, in the part for absolute time calculation.

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    sindbad6 @BenGig
                                    last edited by

                                    @BenGig Ok, I understand. At the moment I have two other issues.

                                    The first is, that even, if I switch off the debug mode, I get dozen of messages in the terminal, where I start the mirror. I suppose the parameter is not handled properly.

                                    The second is, that the time values for the relative time display flickers for maybe a tenth of a second to another value.

                                    Can you evaluate this?

                                    B 2 Replies Last reply Reply Quote 0
                                    • lucallmonL Offline
                                      lucallmon
                                      last edited by

                                      I’m looking through the git and I don’t see Washington DC listed as a possible sight, am I missing something?

                                      B 1 Reply Last reply Reply Quote 0
                                      • B Offline
                                        BenGig @lucallmon
                                        last edited by

                                        @lucallmon maybe a suitable provider can be found, here https://oeffi.schildbach.de/ I can see a general “USA (local and regional, e.g. Philadelphia, Chicago)”. Maybe Washington DC is supported? Since there are so many providers I don’t know in detail what is provided.

                                        Here in Switzerland the main provider aggregates national and local information for train, bus and tramway, so there is no city specific provider.

                                        1 Reply Last reply Reply Quote 0
                                        • B Offline
                                          BenGig @sindbad6
                                          last edited by

                                          @sindbad6 Can you paste some of the output? I can see general output from all modules but no debug from mine (and I checked with absoluteTime: false too ;). And the part of the configuration with the debug turned off.

                                          S 1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            sindbad6 @BenGig
                                            last edited by

                                            @BenGig You find the output below. It’s allways the same. :slight_smile:

                                            MMM-Departures error: null
                                            MMM-Departures error: null
                                            MMM-Departures error: null
                                            MMM-Departures error: null
                                            MMM-Departures error: null
                                            MMM-Departures error: null
                                            
                                            B 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