Node does not receive messages from GW with SIMPLE_PASSWD



  • Hello!
    I have a test environment with two Arduino UNO bords with nRF24 modules connected. One board is configured as a GW, another - a node with static ID = 1. Without any encryption everything works fine.
    With encryption enabled node just does not receive any messages from GW.

    GW configuration:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    // Enable serial gateway
    #define MY_GATEWAY_SERIAL
    
    // Security
    #define MY_SIGNING_SOFT
    #define MY_SIGNING_SIMPLE_PASSWD "a68PHafobmV8jeXN" 
    #define MY_DEBUG_VERBOSE_SIGNING
    
    #include <MySensors.h>
    

    Node configuration:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    // Static node id
    #define MY_NODE_ID 1
    
    // Security
    #define MY_SIGNING_SOFT
    #define MY_SIGNING_SIMPLE_PASSWD "a68PHafobmV8jeXN" 
    #define MY_DEBUG_VERBOSE_SIGNING
    #define MY_SIGNING_WEAK_SECURITY
    
    #include <MySensors.h>
    

    I found thread here saying that SIMPLE_PASSWD signing should work wih 2.2. So, what is wrong with my setup?

    GW log:

    0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RNNGAS-X,VER=2.2.0
    0;255;3;0;9;36 SGN:INI:BND OK
    0;255;3;0;9;38 TSM:INIT
    0;255;3;0;9;41 TSF:WUR:MS=0
    0;255;3;0;9;50 TSM:INIT:TSP OK
    0;255;3;0;9;53 TSM:INIT:GW MODE
    0;255;3;0;9;56 TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;59 MCO:REG:NOT NEEDED
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.2.0
    0;255;3;0;9;64 MCO:BGN:STP
    0;255;3;0;9;70 MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;44149 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;44155 TSF:MSG:BC
    0;255;3;0;9;44158 TSF:MSG:FPAR REQ,ID=1
    0;255;3;0;9;44162 TSF:PNG:SEND,TO=0
    0;255;3;0;9;44165 TSF:CKU:OK
    0;255;3;0;9;44168 TSF:MSG:GWL OK
    0;255;3;0;9;44310 SGN:SGN:NREQ=1
    0;255;3;0;9;44315 TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    0;255;3;0;9;46187 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;46193 TSF:MSG:BC
    0;255;3;0;9;46196 TSF:MSG:FPAR REQ,ID=1
    0;255;3;0;9;46199 TSF:CKU:OK,FCTRL
    0;255;3;0;9;46202 TSF:MSG:GWL OK
    0;255;3;0;9;46330 SGN:SGN:NREQ=1
    0;255;3;0;9;46337 TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    0;255;3;0;9;48225 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;48231 TSF:MSG:BC
    0;255;3;0;9;48234 TSF:MSG:FPAR REQ,ID=1
    0;255;3;0;9;48238 TSF:CKU:OK,FCTRL
    0;255;3;0;9;48241 TSF:MSG:GWL OK
    0;255;3;0;9;48360 SGN:SGN:NREQ=1
    0;255;3;0;9;48365 TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    0;255;3;0;9;50264 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;50270 TSF:MSG:BC
    0;255;3;0;9;50272 TSF:MSG:FPAR REQ,ID=1
    0;255;3;0;9;50276 TSF:CKU:OK,FCTRL
    0;255;3;0;9;50279 TSF:MSG:GWL OK
    0;255;3;0;9;50388 SGN:SGN:NREQ=1
    0;255;3;0;9;50432 !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    0;255;3;0;9;62249 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    

    Node log:

    16 MCO:BGN:INIT NODE,CP=RNNNAS-X,VER=2.2.0
    25 MCO:BGN:BFR
    153 SGN:INI:BND OK
    155 TSM:INIT
    156 TSF:WUR:MS=0
    163 TSM:INIT:TSP OK
    165 TSM:INIT:STATID=1
    172 TSF:SID:OK,ID=1
    173 TSM:FPAR
    175 SGN:SGN:NREQ=255
    217 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2224 !TSM:FPAR:NO REPLY
    2226 TSM:FPAR
    2227 SGN:SGN:NREQ=255
    2269 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4277 !TSM:FPAR:NO REPLY
    4279 TSM:FPAR
    4280 SGN:SGN:NREQ=255
    4322 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6330 !TSM:FPAR:NO REPLY
    6332 TSM:FPAR
    6333 SGN:SGN:NREQ=255
    6375 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8383 !TSM:FPAR:FAIL
    8384 TSM:FAIL:CNT=1
    8386 TSM:FAIL:DIS
    8388 TSF:TDI:TSL
    18390 TSM:FAIL:RE-INIT
    18392 TSM:INIT
    18399 TSM:INIT:TSP OK
    18401 TSM:INIT:STATID=1
    18403 TSF:SID:OK,ID=1
    18405 TSM:FPAR
    18407 SGN:SGN:NREQ=255
    18449 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    18456 !TSM:FPAR:NO REPLY
    18458 TSM:FPAR
    18459 SGN:SGN:NREQ=255
    18502 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    20509 !TSM:FPAR:NO REPLY
    20511 TSM:FPAR
    20512 SGN:SGN:NREQ=255
    20555 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    22562 !TSM:FPAR:NO REPLY
    22564 TSM:FPAR
    22565 SGN:SGN:NREQ=255
    22608 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    24616 !TSM:FPAR:FAIL
    24617 TSM:FAIL:CNT=7
    24620 TSM:FAIL:DIS
    24622 TSF:TDI:TSL
    84625 TSM:FAIL:RE-INIT
    84627 TSM:INIT
    84634 TSM:INIT:TSP OK
    84636 TSM:INIT:STATID=1
    84638 TSF:SID:OK,ID=1
    84640 TSM:FPAR
    84642 SGN:SGN:NREQ=255
    84684 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    84691 !TSM:FPAR:NO REPLY
    84694 TSM:FPAR
    84695 SGN:SGN:NREQ=255
    84738 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    86745 !TSM:FPAR:NO REPLY
    

    All logs repeat infinitely.


  • Contest Winner

    @boresexpress as discussed in other threads, if you use the simple password flag, you must not use other signing flags like MY_SIGNING_SOFT. It is implicit with the simple password flag.


  • Contest Winner

    @boresexpress also, could you please check that you are not close to limits on memory use?



  • @anticimex said in Node does not receive messages from GW with SIMPLE_PASSWD:

    @boresexpress as discussed in other threads, if you use the simple password flag, you must not use other signing flags like MY_SIGNING_SOFT. It is implicit with the simple password flag.

    I've included this flag because according to MySigning.cpp MY_SIGNING_SOFT or MY_SIGNING_ATSHA204 must be defined for signing to work (macros like signerBackendGetNone are defined to function names only if of one of the flags above are defined).
    It's really not clear from documentation that _SOFT is automatically defined with _SIMPLE_PASSWD.


  • Contest Winner

    @boresexpress then there is room for improvement on that topic. But nevertheless, simple password will enable soft signing. Could be that it only complains if you attempt to use it with atsha204 signing.



  • @anticimex said in Node does not receive messages from GW with SIMPLE_PASSWD:

    @boresexpress also, could you please check that you are not close to limits on memory use?

    That's true. On the node I was using 88% of SRAM according to compiler report. After I refactor some code and lower memory usage node starts receiving messages. So, the problem was not in the signing exactly.

    Thank you! For me it was hard to figure that out without your help.


  • Contest Winner

    @boresexpress you are welcome. Unfortunately we are reaching limits on atmega328p with security and mysensors.



  • @anticimex said in Node does not receive messages from GW with SIMPLE_PASSWD:

    @boresexpress you are welcome. Unfortunately we are reaching limits on atmega328p with security and mysensors.

    Debugging layer of MySensors is very have actually.


  • Contest Winner

    @boresexpress true, but debugging is kind of nice to have.


  • Contest Winner

    @boresexpress another thing to consider is that memory is severely affected by the features you include and any 3rd party drivers/libraries used.

    That said, "simple security" is pretty much the worst setting one can use with respect to memory use and security features. Using an atsha and RFM69 which has hw accelerated crypto, for instance, gives a smaller memory footprint.



  • @anticimex said in Node does not receive messages from GW with SIMPLE_PASSWD:

    @boresexpress another thing to consider is that memory is severely affected by the features you include and any 3rd party drivers/libraries used.

    That said, "simple security" is pretty much the worst setting one can use with respect to memory use and security features. Using an atsha and RFM69 which has hw accelerated crypto, for instance, gives a smaller memory footprint.

    Sounds good. But RFM69 is much more expensive compared to nRF24. 🙂
    ATSHA is OK to have. Will order it to try.


  • Contest Winner

    @boresexpress not really. But if you accept to use cheap clones and take the hit in debugging and trying to get them to work reliably, then yes, you get more nrf24 for your money than other radios 🙂



  • @anticimex said in Node does not receive messages from GW with SIMPLE_PASSWD:

    @boresexpress not really. But if you accept to use cheap clones and take the hit in debugging and trying to get them to work reliably, then yes, you get more nrf24 for your money than other radios 🙂

    nRF24 is not so awful as you are saying! 🙂


  • Contest Winner

    @boresexpress then you are lucky with your clones (or you use genuine). Just take a search here on the forum 😉
    99% of all signing issues is due to the nrf24 radio is unable to transmit full size payloads over reasonable distances (bad fakes).



  • @anticimex said in Node does not receive messages from GW with SIMPLE_PASSWD:

    @boresexpress then you are lucky with your clones (or you use genuine). Just take a search here on the forum 😉
    99% of all signing issues is due to the nrf24 radio is unable to transmit full size payloads over reasonable distances (bad fakes).

    I believe, most nRF24 problems are because of poor power. Radio needs 3V3 but 5V Arduinos cannot give enough power on that line for radio to work on maximal transmit power. It leads to random communication error because radio starts up but drops connection on transmit/receive.
    I'm using nRF24 with special power adapters like this. They have own 5V->3V3 converters so I connect them directly to power supply, not to Arduino. And they give enough power for radio to work in any transmit mode.


  • Contest Winner

    @boresexpress indeed that is a common issue, but it is well known and documented that some clones are inferior and a common source for issues.
    But if they work for you, that's just great 🙂


 

285
Online

7.6k
Users

8.5k
Topics

91.1k
Posts