Ethernet Gateway using NRF 2401+ radio and W5100 stopped working



  • I am using the ver 2.2 libraries now and sice my 3 year old gateway just stopped working yesterday, I decided to replace it with the new and improved ver 2.2. But low and behold it worked for about a hour today then stopped and now can not get it to work at all.
    The serial monitor info states:
    Fellas
    I am using the Ethernet gateway program that came with update ver 2.2
    According to the serial port info the board is working fine.
    I have built a sensor using the same 2.2 library and the GW sees the sensor and report and acknowledges the sensor.
    The problem is that, MYSController will not connect to the GW thru the ip address of the GW it says "Connection Refused".
    Does anyone know why that would happen?

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    // Enable gateway ethernet module type
    #define MY_GATEWAY_W5100
    
    // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
    // #define MY_W5100_SPI_EN 4
    
    // Enable Soft SPI for NRF radio (note different radio wiring is required)
    // The W5100 ethernet module seems to have a hard time co-operate with
    // radio on the same spi bus.
    #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
    #define MY_SOFTSPI
    #define MY_SOFT_SPI_SCK_PIN 14
    #define MY_SOFT_SPI_MISO_PIN 16
    #define MY_SOFT_SPI_MOSI_PIN 15
    #endif
    
    // When W5100 is connected we have to move CE/CSN pins for NRF radio
    #ifndef MY_RF24_CE_PIN
    #define MY_RF24_CE_PIN 5
    #endif
    #ifndef MY_RF24_CS_PIN
    #define MY_RF24_CS_PIN 6
    #endif
    
    // Enable UDP communication
    #define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    #define MY_IP_ADDRESS 192,168,xxx,xxx
    
    // If using static ip you can define Gateway and Subnet address as well
    //#define MY_IP_GATEWAY_ADDRESS 192,168,xxx,xxx
    // #define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // Renewal period if using DHCP
    // #define MY_IP_RENEWAL_INTERVAL 60000
    
    // The port to keep open on node server mode / or port to contact in client mode
    #define MY_PORT 5003
    // Controller ip address. Enables client mode (default is "server" mode).
    // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
    #define MY_CONTROLLER_IP_ADDRESS 192,168,xxx,xxx
    
    // The MAC address can be anything you want but should be unique on your network.
    // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
    // Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
    #define MY_MAC_ADDRESS 0x00, 0x09, 0xca, 0x28, 0x06, 0x6c //0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
    
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    #define MY_INCLUSION_BUTTON_FEATURE
    // 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
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    #define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
    #define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
    #define MY_DEFAULT_TX_LED_PIN  9  // Transmit led pin
    
    #if defined(MY_USE_UDP)
    #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    
    void setup()
    {
    }
    
    void presentation()
    {
    }
    void loop()
    {
    }
    

    and I can ping the gateway no problem

    0 MCO:BGN:INIT GW,CP=RNNGA---,VER=2.2.0
    3 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    12 TSM:INIT:GW MODE
    14 TSM:READY:ID=0,PAR=0,DIS=0
    17 MCO:REG:NOT NEEDED
    319 GWT:TIN:IP=192.168.254.166
    1324 GWT:TIN:ETH OK
    1328 MCO:BGN:STP
    1329 MCO:BGN:INIT OK,TSP=1
    1332 TSF:MSG:READ,21-21-0,s=21,c=1,t=16,pt=0,l=1,sg=0:0
    2280 TSF:MSG:READ,27-27-0,s=27,c=1,t=16,pt=0,l=1,sg=0:0
    2994 TSF:MSG:READ,22-22-0,s=22,c=1,t=16,pt=0,l=1,sg=0:0
    6363 TSF:MSG:READ,21-21-0,s=21,c=1,t=16,pt=0,l=1,sg=0:0
    7567 TSF:MSG:READ,3-3-0,s=3,c=1,t=23,pt=3,l=2,sg=0:2438
    8308 TSF:MSG:READ,22-22-0,s=22,c=1,t=16,pt=0,l=1,sg=0:0
    9474 TSF:MSG:READ,25-25-0,s=25,c=1,t=16,pt=0,l=1,sg=0:0
    11475 TSF:MSG:READ,21-21-0,s=21,c=1,t=16,pt=0,l=1,sg=0:0
    13012 TSF:MSG:READ,27-27-0,s=27,c=1,t=16,pt=0,l=1,sg=0:0
    13622 TSF:MSG:READ,22-22-0,s=22,c=1,t=16,pt=0,l=1,sg=0:0
    14763 TSF:MSG:READ,23-23-0,s=23,c=1,t=16,pt=0,l=1,sg=0:0
    15128 TSF:MSG:READ,1-1-0,s=1,c=1,t=23,pt=3,l=2,sg=0:391
    16588 TSF:MSG:READ,21-21-0,s=21,c=1,t=16,pt=0,l=1,sg=0:0
    17720 TSF:MSG:READ,27-27-0,s=27,c=1,t=16,pt=0,l=1,sg=0:0
    18936 TSF:MSG:READ,22-22-0,s=22,c=1,t=16,pt=0,l=1,sg=0:0
    20161 TSF:MSG:READ,25-25-0,s=25,c=1,t=16,pt=0,l=1,sg=0:0
    21701 TSF:MSG:READ,21-21-0,s=21,c=1,t=16,pt=0,l=1,sg=0:0
    22427 TSF:MSG:READ,27-27-0,s=27,c=1,t=16,pt=0,l=1,sg=0:0
    22464 TSF:MSG:READ,24-24-0,s=24,c=1,t=16,pt=0,l=1,sg=0:0
    23859 TSF:MSG:READ,9-9-0,s=9,c=1,t=23,pt=3,l=2,sg=0:755
    24251 TSF:MSG:READ,22-22-0,s=22,c=1,t=16,pt=0,l=1,sg=0:0
    26815 TSF:MSG:READ,21-21-0,s=21,c=1,t=16,pt=0,l=1,sg=0:0
    29565 TSF:MSG:READ,22-22-0,s=22,c=1,t=16,pt=0,l=1,sg=0:0
    

    and can ping the gateway.
    All components work as you can see, so I know the boards are good and the wiring is correct
    Can anyone help?

    Bob


  • Mod

    @mntlvr

    !TSM:INIT:TSP FAIL
    

    This means the Arduino is unable to communicate with the nrf24. So the nrf24 is either broken, or incorrectly wired. Could you post photos of your wiring?



  • Thanks
    But as you can see I have the radio working by just choosing different lines of code to use, but I can not get W5100 to send and transmit and provide Ethernet connection so I can ping address.
    It seems no matter what combination of lines of code I choose it will not activate the W5100 board, but it was working and now does not. I even swapped W5100 board but same thing. I know I can not load the enable pin 4 because then the TSP fails.
    Bob


 

339
Online

7.8k
Users

8.7k
Topics

93.0k
Posts