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-Fuel error ECONNREFUSED

    Scheduled Pinned Locked Moved Solved Troubleshooting
    12 Posts 2 Posters 2.9k Views 2 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
      db1mso
      last edited by

      Can`t connect to tankerkoenig.

      Hello, this is my first try to use MMM-Fuel. Dependencies already installed with npm install
      I get this error every seconds in the MM-Logfile:

      0|MagicMirror | { FetchError: request to https://creativecommons.tankerkoenig.de/json/list.php?lat=47.551609&lng=10.251099&rad=3&type=all&apikey=API_KEY&sort=dist failed, reason: connect ECONNREFUSED 188.68.35.147:443
      0|MagicMirror | at ClientRequest. (/home/pi/MagicMirror/modules/MMM-Fuel/node_modules/node-fetch/lib/index.js:1455:11)
      0|MagicMirror | at ClientRequest.emit (events.js:182:13)
      0|MagicMirror | at TLSSocket.socketErrorListener (_http_client.js:382:9)
      0|MagicMirror | at TLSSocket.emit (events.js:182:13)
      0|MagicMirror | at emitErrorNT (internal/streams/destroy.js:82:8)
      0|MagicMirror | at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
      0|MagicMirror | at process._tickCallback (internal/process/next_tick.js:63:19)
      0|MagicMirror | message:
      0|MagicMirror | ‘request to https://creativecommons.tankerkoenig.de/json/list.php?lat=47.123456&lng=10.123456&rad=3&type=all&apikey=API_KEY&sort=dist failed, reason: connect ECONNREFUSED 188.68.35.147:443’,
      0|MagicMirror | type: ‘system’,
      0|MagicMirror | errno: ‘ECONNREFUSED’,
      0|MagicMirror | code: ‘ECONNREFUSED’ }

      The URL works just fine in a Browser and shows up the Gas-Stations near to me.

      My config file:

      {
      			module: "MMM-Fuel",
      			disabled: false,
      			position: "top_left",
      			config: {
      				provider: "tankerkoenig",
      				api_key: "API_KEY",
      				lat: 47.123456,
      				lng: 10.123456,
      				types: ["e5"],
      				sortBy: "e5",
      				radius: 3,
      				max: 3,
      				updateInterval: 15,
      			}
      		},
      

      Thanks for any hint.

      Sincerly Olli

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

        @db1mso i used your url string above (with the fake api_key), and i got a good string back, says ‘bad api_key’

        {“status”:“error”,“ok”:false,“message”:“apikey nicht angegeben, falsch, oder im falschen Format”

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        D 3 Replies Last reply Reply Quote 0
        • D Offline
          db1mso @sdetweil
          last edited by db1mso

          @sdetweil sorry i can`t fully reply. AKISMET SPAM :-(

          Sincerly Olli

          1 Reply Last reply Reply Quote 0
          • D Offline
            db1mso @sdetweil
            last edited by

            @sdetweil Thanks for testing.
            Yes, the url works perfekt in a Browser - but not in MMM-Fuel.
            Best of all: it works perfekt and show up in MM.
            Maybe it runs too often and was rejected by tankerkoenig.de. The Logfile from tankerkoenig API shows up the massive requests --i can’t append the logfile–

            UpdateInterval: 15 says 15 Minutes - right?

            Sincerly Olli

            1 Reply Last reply Reply Quote 0
            • D Offline
              db1mso @sdetweil
              last edited by

              @sdetweil see Attached Picture 0_1571737115017_logfile_TankerkoenigAPI#.JPG

              Sincerly Olli

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

                @db1mso but your apikey=“API_KEY” is the wrong info

                you need to register on the site to get a key that allows you to connect
                https://creativecommons.tankerkoenig.de/

                my api=_key looks like this
                b0f70ce4-6ac6-bbed-67fd-225db01208be

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                D 1 Reply Last reply Reply Quote 0
                • D Offline
                  db1mso @sdetweil
                  last edited by

                  @sdetweil i never publish my own API_KEY :winking_face:
                  As i mentioned before, the url (with the right key in it) works perfekt in a Browser.

                  Sincerly Olli

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

                    @db1mso ok, those requests are returning rc=200, which is good.

                    the apikey shown doesn’t work, as I modified the numbers.

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    D 1 Reply Last reply Reply Quote 0
                    • D Offline
                      db1mso @sdetweil
                      last edited by

                      @sdetweil modifiying is another method :winking_face:
                      I think the problem was the number of request at a time. There list up to 9 Request at the same Timestamp.

                      EDIT: Error found by myself!
                      The value for UpdateInterval must set to 900000 //15min
                      RTFM!

                      Thanks for your time!

                      Sincerly Olli

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

                        @db1mso cool… the doc doesn’t say MUST… but the code allows something shorter…

                        I opened an issue on MMM-Fuel
                        https://github.com/fewieden/MMM-Fuel/issues/38

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        D 1 Reply Last reply Reply Quote 0
                        • D Offline
                          db1mso @sdetweil
                          last edited by

                          @sdetweil Thanks!
                          The option UpdateInterval is optional.

                          Anyway. Shorter than 5 min makes no sense because the database on tankerkoenig updates every 4 min.

                          Sincerly Olli

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

                            @db1mso said in MMM-Fuel error ECONNREFUSED:

                            The option UpdateInterval is optional.

                            understood… but if shorter causes an error, then the module should enforce the minimum

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

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