Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. Get status of connection

Get status of connection

Scheduled Pinned Locked Moved Development
esp8266 sleep
8 Posts 5 Posters 2.9k Views 5 Watching
  • 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.
  • H Offline
    H Offline
    hyla
    wrote on last edited by
    #1

    Hi,

    is it possible to determine the status of a sensor connect?

    I would like to use an ESP8266 module as a gateway/sensor. In order to save air traffic and battery
    I would put the sensor to sleep for most of the time. But I cannot put it to sleep if it hasn't sent its values
    yet, worse: gateway or sensor node may not even have connected yet to my controller.

    So, can I somehow get these informations from MySensors by code? I know of course that informations
    about this are sent to the terminal when debugging mode is used. But I've got no idea how to get this
    data... some variable somewhere I can check? How would You do something like that?

    Thanks,
    Christoph

    B 1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2

      why would you run an esp8266 gateway on battery? You also can't put it to sleep if you need other nodes to send data to it and if you do you will of course loose the sent data from nodes.

      H 1 Reply Last reply
      0
      • gohanG gohan

        why would you run an esp8266 gateway on battery? You also can't put it to sleep if you need other nodes to send data to it and if you do you will of course loose the sent data from nodes.

        H Offline
        H Offline
        hyla
        wrote on last edited by
        #3

        @gohan Hi. I'm actually using it as a sensor node, not as a gateway. I need the WiFi function anyway to connect the sensor to another network device (KEBA Wallbox :) ) and in order not to make things too
        complicated I decided to connect this sensor to Domoticz as a gateway. I could also hook up an NRF module and use that but that would add complexity ;)

        Thing is, connecting a gateway to Domoticz can take a few minutes and sometimes it doesn't work at all.
        So in order to make sure I got the gateway reconnected properly after a nap I have to find out if and
        when reconnection happened. Is there any variable in the MySensors world that lets me find that out?

        Christoph

        mfalkviddM 1 Reply Last reply
        0
        • H hyla

          @gohan Hi. I'm actually using it as a sensor node, not as a gateway. I need the WiFi function anyway to connect the sensor to another network device (KEBA Wallbox :) ) and in order not to make things too
          complicated I decided to connect this sensor to Domoticz as a gateway. I could also hook up an NRF module and use that but that would add complexity ;)

          Thing is, connecting a gateway to Domoticz can take a few minutes and sometimes it doesn't work at all.
          So in order to make sure I got the gateway reconnected properly after a nap I have to find out if and
          when reconnection happened. Is there any variable in the MySensors world that lets me find that out?

          Christoph

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by mfalkvidd
          #4

          @hyla you could fetch the current time from the controller. If you get a response, the controller was working. See requestTime and receiveTime at https://www.mysensors.org/download/sensor_api_20#requesting-data

          Note: the MySensors sleep function does not work on esp8266.

          1 Reply Last reply
          1
          • gohanG Offline
            gohanG Offline
            gohan
            Mod
            wrote on last edited by
            #5

            I think there is a way to see how many connections are open on the gateway, because you can set maximum clients value. In any case domoticz will poll the gateway every few seconds if you are concerned.

            1 Reply Last reply
            0
            • H hyla

              Hi,

              is it possible to determine the status of a sensor connect?

              I would like to use an ESP8266 module as a gateway/sensor. In order to save air traffic and battery
              I would put the sensor to sleep for most of the time. But I cannot put it to sleep if it hasn't sent its values
              yet, worse: gateway or sensor node may not even have connected yet to my controller.

              So, can I somehow get these informations from MySensors by code? I know of course that informations
              about this are sent to the terminal when debugging mode is used. But I've got no idea how to get this
              data... some variable somewhere I can check? How would You do something like that?

              Thanks,
              Christoph

              B Offline
              B Offline
              bilbolodz
              wrote on last edited by
              #6

              @hyla You can use function: isTransportReady(). Confirmed working.

              1 Reply Last reply
              1
              • Boots33B Offline
                Boots33B Offline
                Boots33
                Hero Member
                wrote on last edited by
                #7

                I think isTransportReady() will only test your connection to the gateway not all the way back to the controller.

                Requesting the time as @mfalkvidd has said is a good way to check the controller.

                1 Reply Last reply
                1
                • B Offline
                  B Offline
                  bilbolodz
                  wrote on last edited by
                  #8

                  Sorry you are right. If you need to check "complete path" fetching time from controller is probably good way to do it.

                  1 Reply Last reply
                  1
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  11

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.0k

                  Posts


                  Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular