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-Rest

    Scheduled Pinned Locked Moved Utilities
    resturltemperature
    25 Posts 6 Posters 21.4k Views 7 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
      balthaz
      last edited by

      Hello,

      In my config it stay in “loading mode” an idea ?

      my config :

      {
      module: ‘MMM-Rest’,
      position: ‘bottom_right’, // This can be any of the regions.
      // Best results in one of the side regions like: top_left
      config: {
      sections: [
      {
      suffix: ‘°C’,
      digits: 1,
      url: ‘http://www.dirk-melchers.de/echo.php?text=22.54’,
      },
      {
      suffix: ‘%’,
      digits: 1,
      url: ‘http://www.dirk-melchers.de/echo.php?text=59.1’,
      },
      {
      suffix: ‘°C’,
      digits: 1,
      url: ‘http://www.dirk-melchers.de/echo.php?text=23.10’,
      },
      {
      suffix: ‘%’,
      digits: 1,
      url: ‘http://www.dirk-melchers.de/echo.php?text=62.1’,
      },
      {
      suffix: ‘°C’,
      digits: 1,
      url: ‘http://www.dirk-melchers.de/echo.php?text=-19.73’,
      },
      ],
      output: [
      [‘Livingroom’,‘@1’,‘@2’],
      [‘Kitchen’,‘@3’,‘@4’],
      [‘Fridge’,‘@5’],
      ],
      }
      },

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        Tuxdiver @balthaz
        last edited by

        @balthaz Config looks good. Strange…

        I will add some debugging messages to the code later to make it easier to find the problem.

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

          @Tuxdiver said in MMM-Rest:

          @balthaz Config looks good. Strange…

          I will add some debugging messages to the code later to make it easier to find the problem.

          OK, I added some debugging code. Please pull the current version and set

          debug: true;
          

          to the modules config section.

          I’m not sure, which is the best way to debug the version on the Raspi, but I think you could simply use a browser and connect to the Raspi. Maybe the console.log messages will be visible somewhere when using the electron app, but I don’t know where…

          strawberry 3.141S B 2 Replies Last reply Reply Quote 0
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @Tuxdiver
            last edited by

            @Tuxdiver you can open the console in electron with cmd+shift+I or start the mirror with npm start dev, then the console will be open from start

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

            1 Reply Last reply Reply Quote 0
            • B Offline
              balthaz @Tuxdiver
              last edited by

              @Tuxdiver
              I add debug mode, but where can i find the log ?

              I try a tcpdump, and they arre no connection to the url :

              pi@mirror:~/MagicMirror/modules/MMM-Rest $ sudo tcpdump |grep dirk
              tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
              listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes

              Stay in loading mode
              Thanks in advance

              T 1 Reply Last reply Reply Quote 0
              • T Offline
                Tuxdiver @balthaz
                last edited by

                @balthaz Sorry for the delay… The problem is the same-origin-policy of JavaScript: you must not call any other server than the one, where the mirror is running.

                I will change the module to use a node helper, but that might take some time.

                T B 2 Replies Last reply Reply Quote 0
                • T Offline
                  Tuxdiver @Tuxdiver
                  last edited by

                  @Tuxdiver said in MMM-Rest:

                  @balthaz Sorry for the delay… The problem is the same-origin-policy of JavaScript: you must not call any other server than the one, where the mirror is running.

                  I will change the module to use a node helper, but that might take some time.

                  Module is updated on Github. Please try again. Now it uses a node_helper.js to fetch the remote data. Should solve the security “bug” of AJAX…

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    Jopyth Moderator
                    last edited by

                    @Tuxdiver What kind of sensors are you using for this internally (your openHAB)?

                    Helpful sticky: How to troubleshoot

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

                      Hello,
                      I am currently on vacation, I will try on my return.
                      Thanks

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        Tuxdiver @Jopyth
                        last edited by

                        @Jopyth said in MMM-Rest:

                        @Tuxdiver What kind of sensors are you using for this internally (your openHAB)?

                        I have an ESP8266 / NodeMCU sensors in every room, which send temperate and humidity values via MQTT to the mirror running mosquitto MQTT broker and openHAB. The values from the openHAB - API are then displayed on the mirror using my module.

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