Gw-node communication on I_ID_Request and I_Pong



  • Hi,
    i have several problems and strange issues with the gw-node communication.

    First configuration
    GW: esp8266 1.0 + nrf24 clone (epoxy blob), powered by pc usb. Sketch: mysensors 2.0, examples/gatewayesp8266
    Node : nano + nrf24 clone (epoxy blob), powered by pc usb. Sketch : mysensors 2.0, examples/lightsensor, modified to send a counter value every 3 seconds.
    Distance gw-node: about 60cm

    First test: no communication GW-node, no matter how i set power and speed.
    Second test: using[getting started example]( https ://codebender.cc/example/RF24/GettingStarted#GettingStarted.ino), GW and node communicate.
    Third Test: after some investigation, i modified the Rf24.cpp, replacing enablefeatures with:
    csn(LOW);
    SPI.transfer( ACTIVATE );
    SPI.transfer( 0x73 );
    csn(HIGH);.
    Setting MY_NODE_ID, Gw and node now can communicate, node presents itself and send counter value. i can see the log of messages on gw and on controller. I can also place the node at 6 meters away from the GW, behind a wall, and see the GW logging the counter values received (250kbps, PA_LOW or PA_MAX).
    Fourth Test: Trying to remove my_debug from node -> no more communication GW-node. Trying to add rf24 debug on GW -> no more communication GW-node
    Fifth test: trying to remove my_node_id, to get id from controller. Node send find_parent, GW responds, node then send four times i_id_request, no response from GW ( and no log), then node resend find_parent, no more response from GW and no log, it only log sanchk ok. Restarting the GW i get the same situation.

    Second configuration
    GW: uno + nrf24 clone (epoxy blob), powered by pc usb. Sketch: mysensors 2.0, examples/gatewayesp8266
    Node : nano + nrf24 clone (epoxy blob), powered by pc usb. Sketch : mysensors 2.0, examples/lightsensor, modified to send a counter every 3 seconds.
    Distance GW-node: about 60cm

    First test: no communication GW-node, no matter how i set power and speed.
    Second test: using[getting started example]( https ://codebender.cc/example/RF24/GettingStarted#GettingStarted.ino), GW and node communicates
    Third Test: using rf24.cpp modified, without my_node_id define, node send find_par, GW responds, node send i_id_req, controller assign an id, node receive the id and send ping. GW receives and fails to send i_pong , with a MAX_RT message. The node resend find_parent and ping, but the GW fails every time on the I_pong message with MAX_RT. (setting my_node_id i get the same situation).
    Fourth test: also in this case, adding/removing debug define influences the gw-node communication.

    i can't see any logic in this. The error on i_id_request and i_pong is systematic.
    if the problem is the radio module, why they are working with the gettingstarted example, or in the first configuration just defining node_id?
    And why adding or removing the debug define, cause the gw-node communication to working (or not)? I read about this issue also in another topic (i don't remember which one).

    Thanks in advance for your help.


  • Hardware Contributor

    Hi,

    are you using Mysensors 2 Beta ?



  • @scalz
    Mysensors 2.0.0, from master branch


  • Hardware Contributor

    oki. if i remember well, multiple of issues you got, may be already fixed in the dev branch



  • @scalz
    i have just tested the 2.1.0-beta from dev branch. Sketch from examples/gatewayserial and example/lightsensors
    no communication gw-node. gw doesn't receive anything from node. same result if i try to modify the rf24.cpp as in the test above.
    And if i enable #define MY_DEBUG_VERBOSE_RF24 on gw, i get an infinite print of this message on the gw serial:
    0;255;3;0;9;RF24:read register, reg=23, value=17

    This is the debug from node

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.0-beta
    47 TSM:INIT
    60 TSF:WUR:MS=0
    76 RF24:write register, reg=0, value=14
    123 RF24:write register, reg=3, value=3
    164 RF24:write register, reg=4, value=95
    207 RF24:write register, reg=5, value=76
    250 RF24:write register, reg=6, value=39
    293 RF24:write register, reg=29, value=6
    336 RF24:read register, reg=6, value=39
    378 RF24:read register, reg=5, value=76
    419 RF24:write register, reg=2, value=2
    461 RF24:write register, reg=1, value=0
    503 RF24:write register, reg=28, value=3
    546 RF24:flushRX
    564 RF24:flushTX
    582 RF24:write register, reg=7, value=112
    626 TSM:INIT:TSP OK
    647 TSM:INIT:STATID=3
    670 RF24:write register, reg=2, value=3
    711 RF24:write register, reg=1, value=1
    753 RF24:STRT LIS
    773 RF24:write register, reg=0, value=15
    815 RF24:write register, reg=10, value=3
    858 TSF:SID:OK,ID=3
    879 TSM:FPAR
    892 RF24:STP LIS
    911 RF24:write register, reg=0, value=14
    953 RF24:OPEN WPIPE,RCPT=255
    984 RF24:write register, reg=10, value=255
    1029 RF24:write register, reg=16, value=255
    1075 RF24:SND:TO=255,LEN=7
    1102 RF24:flushTX
    3111 RF24:write register, reg=7, value=48
    3155 RF24:STRT LIS
    3175 RF24:write register, reg=0, value=15
    3219 RF24:write register, reg=10, value=3
    3263 TSF:MSG:SEND,3-3-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3336 RF24:read register, reg=23, value=17
    3380 RF24:read register, reg=23, value=17
    3424 RF24:read register, reg=23, value=17
    3468 RF24:read register, reg=23, value=17
    3512 RF24:read register, reg=23, value=17
    3556 RF24:read register, reg=23, value=17
    3600 RF24:read register, reg=23, value=17
    3643 RF24:read register, reg=23, value=17
    3687 RF24:read register, reg=23, value=17
    3731 RF24:read register, reg=23, value=17
    3775 RF24:read register, reg=23, value=17
    3819 RF24:read register, reg=23, value=17
    3863 RF24:read register, reg=23, value=17
    3907 RF24:read register, reg=23, value=17
    3951 RF24:read register, reg=23, value=17
    3994 RF24:read register, reg=23, value=17
    4038 RF24:read register, reg=23, value=17
    4082 RF24:read register, reg=23, value=17
    4126 RF24:read register, reg=23, value=17
    4170 RF24:read register, reg=23, value=17
    4214 RF24:read register, reg=23, value=17
    4258 RF24:read register, reg=23, value=17
    4302 RF24:read register, reg=23, value=17
    4345 RF24:read register, reg=23, value=17
    4389 RF24:read register, reg=23, value=17
    4433 RF24:read register, reg=23, value=17
    4477 RF24:read register, reg=23, value=17
    4521 RF24:read register, reg=23, value=17
    4566 RF24:read register, reg=23, value=17
    4610 RF24:read register, reg=23, value=17
    4654 RF24:read register, reg=23, value=17
    4697 RF24:read register, reg=23, value=17
    4741 RF24:read register, reg=23, value=17
    4785 RF24:read register, reg=23, value=17
    4829 RF24:read register, reg=23, value=17
    4873 RF24:read register, reg=23, value=17
    4917 RF24:read register, reg=23, value=17
    4961 RF24:read register, reg=23, value=17
    5005 RF24:read register, reg=23, value=17
    5048 RF24:read register, reg=23, value=17
    5092 RF24:read register, reg=23, value=17
    5136 RF24:read register, reg=23, value=17
    5180 RF24:read register, reg=23, value=17
    5224 RF24:read register, reg=23, value=17
    5268 RF24:read register, reg=23, value=17
    5312 RF24:read register, reg=23, value=17
    5356 !TSM:FPAR:NO REPLY
    5381 TSM:FPAR
    5396 RF24:STP LIS
    5414 RF24:write register, reg=0, value=14
    5458 RF24:OPEN WPIPE,RCPT=255
    5490 RF24:write register, reg=10, value=255
    5536 RF24:write register, reg=16, value=255
    5582 RF24:SND:TO=255,LEN=7
    5610 RF24:flushTX
    7619 RF24:write register, reg=7, value=48
    7663 RF24:STRT LIS
    7683 RF24:write register, reg=0, value=15
    7727 RF24:write register, reg=10, value=3
    7771 TSF:MSG:SEND,3-3-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    

    Debug from gw

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0-beta
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;0;0;18;2.1.0-beta
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.1.0-beta
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    

  • Hardware Contributor

    @rhaymo said:

    Second test: using[getting started example]( https ://codebender.cc/example/RF24/GettingStarted#GettingStarted.ino), GW and node communicate.
    Third Test: after some investigation, i modified the Rf24.cpp, replacing enablefeatures with:
    csn(LOW);
    SPI.transfer( ACTIVATE );
    SPI.transfer( 0x73 );
    csn(HIGH);.

    This was your first mistake i think, I didn't pay attention, but regarding the link you posted above with your changes??
    Why did you link the rf24 original lib? Because the code lines you posted were not part of mysensors nrf24 driver. You don't need to do this, mysensors already includes a custom nrf24 driver. As you can see now.

    About your errors in log, for the moment i can't really tell you, I'm not using nrf24 (but rfm69) so i don't know well its flow, but the "infinite loop" you see is i think, simply waiting (polling registers) for an ack. As you don't get any ACK back, you get a NOREPLY...



  • @scalz
    in the second test i used that getting started code to test the radio modules with a library other than mysensors. and they worked. (That code is not mine, i suppose it use the maniacbug library).
    So i did investigate to find the differences between mysensors and that library. Only after replacing, in mysensors, the enablefeatures with that code, i got the communication gw-node.



Suggested Topics

10
Online

11.4k
Users

11.1k
Topics

112.7k
Posts