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. Request ACK from node to gateway possible?

Request ACK from node to gateway possible?

Scheduled Pinned Locked Moved Development
9 Posts 3 Posters 4.7k Views 1 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.
  • AndurilA Offline
    AndurilA Offline
    Anduril
    wrote on last edited by
    #1

    Hey,

    is it possible to tell the gateway that it needs an ACK for switching a relay? Only about 75% of my commands reach the node. I already added decoupling caps at gateway and node, no change. If this is completely related to bad wireless connection maybe it will change when my nodemcu arrives as new gateway.

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

      Yes it is possible,

      Look at the api for the send-method. The ack message will pop up in your incoming-callback-metchod.

      1 Reply Last reply
      0
      • AndurilA Offline
        AndurilA Offline
        Anduril
        wrote on last edited by
        #3

        @hek I know how to use the send with ACK for sensor data

        gw.send(msg.set(value), true);
        

        but how to make the gw request an ACK from the node when switching a relay? I had a look at the serial gateway sketch and didn't found an option.
        There is an ACK option when presenting the child-ID to the controller, but I suggest it's only for receiving the presentation, not for all future communication with this child. Is that correct?

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

          Have you looked at the documentation for the serial protocol? It's described there.

          1 Reply Last reply
          0
          • AndurilA Offline
            AndurilA Offline
            Anduril
            wrote on last edited by
            #5

            thanks @hek, I didn't read the serial protocol doc yet. Up to now I only read the API doc.
            Now I know what to change to request ACK, next question is how...
            I use pimatic with mysensors plugin, I suggest thats where to start looking, right? I have had a look at the MySensors.coffee, which seems to define the serial communication standard. At line 500 is the following:

                changeStateTo: (state) ->
                  assert state is on or state is off
                  if state is true then _state = 1  else _state = 0
                  datas = {}
                  datas =
                  {
                    "destination": @config.nodeid,
                    "sensor": @config.sensorid,
                    "type"  : V_STATUS,
                    "value" : _state,
                    "ack"   : 1
                  }
                  @board._rfWrite(datas).then ( () =>
                     @_setState(state)
                  )
            

            Does that mean for a V_STATUS change message there is always an ACK request from gw? I know you can't be familiar with every controller and MySensors plugin, but maybe someone else knows.

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

              Yes, it looks like it requests an ack.

              1 Reply Last reply
              0
              • AndurilA Offline
                AndurilA Offline
                Anduril
                wrote on last edited by
                #7

                ok, what is the behavior if there is no ACK coming back? Trying again for several times before discarding the message? How long is the timeout?

                S 1 Reply Last reply
                1
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #8

                  I don't know if pimatic re-sends message after some timeout or not.

                  1 Reply Last reply
                  0
                  • AndurilA Anduril

                    ok, what is the behavior if there is no ACK coming back? Trying again for several times before discarding the message? How long is the timeout?

                    S Offline
                    S Offline
                    SiLeX
                    wrote on last edited by
                    #9

                    @Anduril said:

                    ok, what is the behavior if there is no ACK coming back? Trying again for several times before discarding the message? How long is the timeout?

                    We are discussing this topic in http://forum.mysensors.org/topic/2189/serial-api-noack-when-sending-with-ack-failed as well.

                    Currently MySensors never resends any messages. You have to program it into your serial application by yourself. It would have to wait for an ACK message and send again, if it didn't come back within time.

                    In the linked thread we are hoping to find a way for implementing this on the hardware of the gateway.

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


                    20

                    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