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. Troubleshooting
  3. Serial Gateway Code to Query Node's Payload?

Serial Gateway Code to Query Node's Payload?

Scheduled Pinned Locked Moved Troubleshooting
7 Posts 3 Posters 2.3k Views 2 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.
  • B Offline
    B Offline
    Baran
    wrote on last edited by
    #1

    Greetings All,

    Would someone please give me an example of a line of serial gateway code that would query node x for its payload data? I have around 100 nodes so I do not want them randomly broadcasting data . . . that would lead to much cross-talk and lost data. Rather, I would like my serial gateway to ask, for example, "node 1, give me your data" and node 1 will present its sensor data. I tried to search the database but I could not filter properly to find an example. I feel stupid and lost and a little help here would really lift my spirits and get me moving on this. With great appreciation to all who respond - Baran

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      You can send just send a value (SET) or use use the special request command (REQ) from your controller.
      Keep nodes awake and let them process incoming messages. When you receive the req-command just send a reply back to controller.

      You can look any of the example which processes incoming messages.

      1 Reply Last reply
      1
      • V Offline
        V Offline
        vikasjee
        wrote on last edited by
        #3

        Do we have any "Wake on LAN/WiFi" kind of facility in MySensors to save energy in this kind of scenario? I believe i have read that this kind of functionality is available in nRF24L01...

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          The radio consumes about 13.5mA in RX mode according to datasheet. Not sure about the clones we all use here, probably higher.

          13mA is still a little too much when running node on batteries. Will drain fast. So the question is the usecase for fiddling with interrupts other than speeding up the data transmission (pulling stuff out of the radios FIFO buffers so they don't fill up).

          V 1 Reply Last reply
          1
          • hekH hek

            The radio consumes about 13.5mA in RX mode according to datasheet. Not sure about the clones we all use here, probably higher.

            13mA is still a little too much when running node on batteries. Will drain fast. So the question is the usecase for fiddling with interrupts other than speeding up the data transmission (pulling stuff out of the radios FIFO buffers so they don't fill up).

            V Offline
            V Offline
            vikasjee
            wrote on last edited by
            #5

            @hek said:

            The radio consumes about 13.5mA in RX mode according to datasheet. Not sure about the clones we all use here, probably higher.

            13mA is still a little too much when running node on batteries. Will drain fast. So the question is the usecase for fiddling with interrupts other than speeding up the data transmission (pulling stuff out of the radios FIFO buffers so they don't fill up).

            Tx consumption (though it can be put to sleep) will definitely be higher than Rx consumption, but the question is more about Push vs Pull. So, my question is more towards waking up a loooong sleeping (an hour or more sleep - Ex. a humidity sensor in a bathroom) node say only in Emergency conditions (in the example here, just to check if the bathroom floor of an elderly is dry or not before (s)he uses the bathroom ...)

            1 Reply Last reply
            0
            • B Offline
              B Offline
              Baran
              wrote on last edited by
              #6

              Hek said "You can send just send a value (SET) or use use the special request command (REQ) from your controller."

              Sounds good, but my ignorance is deeper than you imagined. I do not have a controller, as I wish to send a suitable "request node data" through my serial gateway. Would someone please show me an example of serial code that would make such a request?

              Respectfully - Baran

              1 Reply Last reply
              0
              • hekH Offline
                hekH Offline
                hek
                Admin
                wrote on last edited by
                #7

                http://www.mysensors.org/download/serial_api_14

                To do a REQ(uest) set message-type to 2. For example:

                12;1;2;0;0;\n

                This requests a DOOR (0) -variable from sensor 1. Remember you must pick up this request in the callback of your sensors sketch.

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


                12

                Online

                11.7k

                Users

                11.2k

                Topics

                113.1k

                Posts


                Copyright 2025 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