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.

    ECONNREFUSED when trying to get JSON from my server (MMM-json-feed)

    Scheduled Pinned Locked Moved Troubleshooting
    10 Posts 4 Posters 3.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.
    • E Offline
      E3V3A
      last edited by E3V3A

      From here:

      ECONNREFUSED (Connection refused): No connection could be made because the target machine 
      actively refused it. This usually results from trying to connect to a service that is inactive on the 
      foreign host.
      

      "Everything I do (here) is for free – altruism is the way!"
      MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

      T 1 Reply Last reply Reply Quote 0
      • cowboysdudeC Offline
        cowboysdude Module Developer
        last edited by

        Here’s an example in my node helper I use to get json

        request({
                    url: "xxxxxxxxxxxx.json",
                    method: 'GET',
                    headers: {
                        'User-Agent': 'MagicMirror/1.0 (' + this.config.email + ')'
                    }
        
        T 1 Reply Last reply Reply Quote 1
        • T Offline
          toh1000 @ninjabreadman
          last edited by

          @ninjabreadman Yes, curl call returns correct json:

          {"Date": "22.02.2018", "Temperature": -0.187, "Time": "22:45:37"}
          
          1 Reply Last reply Reply Quote 0
          • T Offline
            toh1000 @E3V3A
            last edited by

            @E3V3A Any idea what I could do to accept the connection?

            1 Reply Last reply Reply Quote 0
            • T Offline
              toh1000 @cowboysdude
              last edited by

              @cowboysdude I added the header (without the this.config.email) but got the same result.

              1 Reply Last reply Reply Quote 0
              • T Offline
                toh1000
                last edited by

                Solved:
                The problem was that the module translated the server name into an up address and CherryPy was not configured to response to that.
                Reconfiguring did the trick:
                this article explains how this is done
                Thanks for your efforts.

                1 Reply Last reply Reply Quote 0
                • 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