My gateway fails to answer



  • Hi! For a long time now I'm having troubles with my gateway. My setup is

    • a Raspberry Pi 3 running RaspberryOS Buster, with
    • an Arduino Nano connected via USB to act as serial gateway, using
    • an nrf24l01 wireless chip.

    The problem is, that when a node tries to connect to the gateway, I see the following messages on the gateway:

    0;255;3;0;9;3128482 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;3128488 TSF:MSG:BC
    0;255;3;0;9;3128492 TSF:MSG:FPAR REQ,ID=1
    0;255;3;0;9;3128495 TSF:CKU:OK,FCTRL
    0;255;3;0;9;3128499 TSF:MSG:GWL OK
    0;255;3;0;9;3128719 !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    

    So, as far as I understand, the gateway receives the initial request from the node and tries to answer. But for some reason the sending fails. This raises some questions for me:

    • Does it mean the sending itself fails on the gateway side? Or does the gateway somehow know that the data is not received by the node?
    • Should the TSF:MSG:SEND work, even if the gateway is not used by a controller (i.e. when connected to the Arduino IDE debug console)?

    What I already did: I replaced already every part:

    • I replaced the nrf24l01 chip with another one.
    • I used the nrf24l01 with and without an external voltage regulator YL-105.
    • I used a NRF24L01+PA+LNA with external antenna for the gateway
    • I used another NRF24L01 module with antenna for the gateway
    • I used a shielded nrf24l01 adapter with antenna like this one
    • I played around with the MY_RF24_PA_LEVEL parameter.
    • I used capacitors on both ends.
    • I replaced the Arduino Nano of the gateway with another one.
    • I cleared the EEPROM for the gateway and the node.
    • I checked the wiring multiple times (including measuring with a multimeter).
    • I used another node.
    • I added step-up boosters to the battery powered nodes.
    • I replaced the raspberry pi.
    • I reinstalled the operating system on the raspberry pi.
    • I switched from MyController to OpenHAB with the same result.
    • I replaced USB cables.
    • And much more.

    The node and the gateway are both on my desk (so no long distance). The gateway code that runs on the gateway:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_RF24
    
    // Set LOW transmit power level as default, if you have an amplified NRF-module and
    // power your radio separately with a good regulator you can turn up PA level.
    #define MY_RF24_PA_LEVEL RF24_PA_LOW
    
    // Enable serial gateway
    #define MY_GATEWAY_SERIAL
    
    // Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    #define MY_BAUD_RATE 38400
    #endif
    
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE
    
    // Inverses behavior of inclusion button (if using external pullup)
    //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
    
    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN  3
    
    // Set blinking period
    //#define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Inverses the behavior of leds
    //#define MY_WITH_LEDS_BLINKING_INVERSE
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    #define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
    #define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
    #define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
    
    #include <MySensors.h>
    
    void setup()
    {
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors
    }
    
    void loop()
    {
    	// Send locally attached sensor data here
    }
    

    So I don't have any ideas anymore and hope that someone here can help me at least for one more step.


  • Mod

    @benhub said in My gateway fails to answer:

    Does it mean the sending itself fails on the gateway side? Or does the gateway somehow know that the data is not received by the node?

    The latter. The gateway expects an ACK message from the node, but did not get it.

    Should the TSF:MSG:SEND work, even if the gateway is not used by a controller (i.e. when connected to the Arduino IDE debug console)?

    Yes.

    Try to increase the distance between the gateway and the node. Yes, they can be too close. Try a distance of 2m/6ft.

    Check the debug log on the node. Does the node see the gateway's reply?



  • Wow! Thank you for your quick answer! That already helped a little bit.

    At least I now saw, that the connection works, when my sensor node is powered via USB. So it seems to be a power issue on the sensor node. I'll dig deeper on this side.



  • Thank you very much! It seems that the (or at least one) reason for my issue was the step up booster on the sensor node.

    This post gave me the hint, that the step up booster might produce noise:
    https://forum.mysensors.org/topic/4796/battery-powered-sensors/67?_=1606408518798

    So, now I power the nrf24l01 directly from the batteries and not through the step up booster anymore. Now the node is able to connect. There are still errors in the communication but not so many.


  • Mod

    Great work @benhub, thanks for reporting back.


Log in to reply
 

Suggested Topics

  • 3
  • 24
  • 2
  • 2
  • 1
  • 3

20
Online

11.2k
Users

11.1k
Topics

112.5k
Posts