Send Payload but NACK
-
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 sleepDuring 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
-
@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. -
@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 ?) -
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 -
@Tetnobic for now, there is no option to see the queue. But it is good idea to list it.
-
@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); }
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>
Custom wedgit:
Note:
gatewayId
should be integer andnodeEui
should be string. ({"gatewayId":1, "nodeEui":"1" }
)Final result:
-
@jkandasa
OHHHH wonderfull !!! I will try this !
Many thanks !