Ethernet Gateway with W5100: radio error [solved]



  • All,

    I know its hasbeen discussed many times on the forum , but I'm completly stuck with my GW.
    I have build the gateway acoording to the instructions https://www.mysensors.org/build/ethernet_gateway.
    The problem I now have is that the radio fails. I checked the wiring many time, changed out all the part, same result over and over again radio fail. I'using the new 2.0.0 library's and took the sketch from the download example.

    My settings are:

    // Enable debug prints to serial monitor
    #include <MyConfig.h>
    #define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    #define MY_DEBUG_VERBOSE_RF24
    //#define MY_RADIO_RFM69
    
    // 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
    

    The error code are:
    Opening port
    Port open
    0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;RF24:write register, reg=0, value=14
    0;255;3;0;9;RF24:write register, reg=3, value=3
    0;255;3;0;9;RF24:write register, reg=4, value=95
    0;255;3;0;9;RF24:write register, reg=5, value=76
    0;255;3;0;9;RF24:write register, reg=6, value=39
    0;255;3;0;9;RF24:read register, reg=6, value=255
    0;255;3;0;9;RF24:read register, reg=5, value=255
    0;255;3;0;9;RF24:Sanity check failed: configuration mismatch! Check wiring, replace module or non-P version
    0;255;3;0;9;!TSM:RADIO:FAIL
    0;255;3;0;9;!TSM:FAILURE
    0;255;3;0;9;TSM:PDT
    0;255;3;0;9;RF24:write register, reg=0, value=12
    0;255;3;0;9;RF24:power down

    I tried to change the myconfig.h (softspi) and without, result the same all the time.

    So questions are:
    Do I need to enable softspi in myconfig.h?
    Is the pinout still as in the instructions?

    Thanks for any help, puzzeling with this for days now.

    Ralph


  • Mod

    I think the problem is that MySensors.h is included before defining what MySensors should do.

    Add

    #include <MySensors.h>
    

    after the defines. And I don't think you should include MyConfig.h at all. It is included by MySensors.



  • @mfalkvidd Thx: sometimes life is so simple. I totally did not notice that this slipped in...
    Problem solved!

    And to answer my other question myself: I don't need to enable softspi in the MyConfig.h I guess. Works without it apperently.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.