• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Send Payload but NACK

    scheduled pinned locked moved General Discussion
    scriptcustom widgetjavascriptsmartsleepqueue
    7 posts 2 posters 3.8k views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • T offline
      Tetnobic
      global:last-edited-by, jkandasa

      Hi,
      I have a battery node with Option "Smart sleep" enabled. (I use NRF24L01+ with auto ack)
      So my sensor wake up, does his job, send heartbeat wait for smart sleep wait duration (in mysensors/myconfig.h : MY_SMART_SLEEP_WAIT_DURATION_MS (500ul)) then sleep

      During this sleep wait, mycontroller try to send payload (for change status : Message Type:V_STATUS to 1) and sometimes is not fast enought
      I see this log in mysensors :

      mysgw: !TSF:MSG:SEND,0-0-1-1,s=1,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=NACK:1
      
      

      We see that send status is : st=NACK:1, so my node not receive this payload
      But mycontroller keep the new value of this var (1) instead of keep 0 (because NACK)
      Is there a solution for this case ?

      Thanks

      jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
      • jkandasaJ offline
        jkandasa @Tetnobic
        global:last-edited-by,

        @Tetnobic For now MyController will not support for ACK/NACK. Kindly have look at https://github.com/mycontroller-org/mycontroller/issues/290

        So my sensor wake up, does his job, send heartbeat wait for smart sleep wait duration (in mysensors/myconfig.h : MY_SMART_SLEEP_WAIT_DURATION_MS (500ul)) then sleep

        When you increase MY_SMART_SLEEP_WAIT_DURATION_MS duration(example: 2000 ms) this issue may be fixed.

        T one-reply-to-this-post last-reply-time reply quote 0
        • T offline
          Tetnobic @jkandasa
          global:last-edited-by,

          @jkandasa
          Yes it's practically fixed with 2000ms
          99% of payload are send and ACK, sometimes payload are NACK , I think it's my gateway (Raspberry Pi with NRF24L01+ on serial with mycontroller on it too)
          So I still have a way of knowing if payload is ACK (other than show in Mysensors LOG ?)

          one-reply-to-this-post last-reply-time reply quote 1
          • T offline
            Tetnobic
            global:last-edited-by,

            Hi,
            I have only Nodes with Smart sleep enabled. So when I send payloads, they are queued until nodes heartbeat back.
            Is there a way to see this queue ?
            Thanks in advance

            jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
            • jkandasaJ offline
              jkandasa @Tetnobic
              global:last-edited-by,

              @Tetnobic for now, there is no option to see the queue. But it is good idea to list it.

              jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
              • jkandasaJ offline
                jkandasa @jkandasa
                global:last-edited-by,

                @tetnobic I have added this support via the custom widget. You can also perform delete message via script.

                Changes available on SNAPSHOT version.

                Script:
                var myImports = new JavaImporter(java.io, java.lang, java.util, java.text);
                
                with(myImports) {
                 var messages = mcApi.messageQueue().smartSleep().getQueue(gatewayId, nodeEui);
                
                //Perform delete message via index
                //mcApi.messageQueue().smartSleep().removeMessages(gatewayId, nodeEui, 0);//Note: index will be in integer
                
                //Perform delete messages for a perticular sensor id
                //mcApi.messageQueue().smartSleep().removeMessages(gatewayId, nodeEui, "1"); //Note: sensorId will be in string
                
                //Perform delete messages for a node
                //mcApi.messageQueue().smartSleep().removeQueue(gatewayId, nodeEui);
                }
                

                image

                Template:
                <table class="table table-hover table-bordered table-striped mc-table">
                  <thead>
                    <th>Gateway Id</th>
                    <th>{{ 'NODE_EUI' | translate }}</th>
                    <th>{{ 'SENSOR_ID' | translate }}</th>
                    <th>{{ 'TYPE' | translate }}</th>
                    <th>{{ 'SUB_TYPE' | translate }}</th>
                    <th>{{ 'ACK' | translate }}</th>
                    <th>{{ 'PAYLOAD' | translate }}</th>
                    <th>{{ 'TIME' | translate }}</th>
                  </thead>
                  <tbody>
                    <#list messages as item>
                        <td>${(item.gatewayId)!}</td>
                        <td>${(item.nodeEui)!}</td>
                        <td>${(item.sensorId)!}</td>
                        <td>${(item.type)!}</td>
                        <td>${(item.subType)!}</td>
                        <td>${(item.ack)!}</td>
                        <td>${(item.payload)!}</td>
                        <td><span uib-tooltip="{{ ${(item.timestamp?c)!"Never"} | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="${(item.timestamp?c)!"Never"}"></span></td>
                      </tr>
                    </#list>
                  </tbody>
                </table>
                

                image

                Custom wedgit:

                image

                Note: gatewayId should be integer and nodeEui should be string. ({"gatewayId":1, "nodeEui":"1" })

                Final result:

                image

                T one-reply-to-this-post last-reply-time reply quote 0
                • T offline
                  Tetnobic @jkandasa
                  global:last-edited-by,

                  @jkandasa
                  OHHHH wonderfull !!! I will try this !
                  Many thanks !

                  one-reply-to-this-post last-reply-time reply quote 0
                  • first-post
                    last-post

                  0

                  online

                  644

                  users

                  532

                  topics

                  3.4k

                  posts
                  Copyright © 2015-2025 MyController.org | Contributors | Localization