Radio fails to init on W5100



  • I updated to dev branch yesterday, and on my W5100 gateway the radio now fails to initialize:

    0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0-beta)
    0;255;3;0;9;write register, reg=0, value=6
    0;255;3;0;9;write register, reg=3, value=3
    0;255;3;0;9;write register, reg=4, value=95
    0;255;3;0;9;write register, reg=5, value=76
    0;255;3;0;9;write register, reg=6, value=35
    0;255;3;0;9;read register, reg=6, value=255
    0;255;3;0;9;read register, reg=6, value=255
    0;255;3;0;9;Sanity check failed: RF_SETUP register=255 instead of 35, check wiring, replace module or non-P version
    0;255;3;0;9;Radio init failed. Check wiring.

    I've tried three different (confirmed working on my sensebender micro) radios, I've quadruple-checked my wiring, and I haven't changed the pins. So something is funky after the RF24 refactor.


  • Admin

    You're aware that the 5100 gateway sketch enabled SoftSPI (which requires another radio wiring).?



  • Yes. When I say that I haven't changed the pins, I mean that I haven't changed the physical pins (or the CE/CSN numbers in my sketch) compared to when the same setup worked with the previous RF24 driver.

    I love the difference in available space the new driver gives, but I'd love it even more if the radio continued to work 😛


  • Admin

    Guess we have to call in @tekka here. Wonder if he switched/altered some config when using SoftSPI perhaps.


  • Admin

    @ximinez can you describe your exact settings, wiring and hardware, I'll see if I can reproduce the same behaviour here.



  • #define MY_DEBUG
    #define MY_RADIO_NRF24
    #define MY_DEBUG_VERBOSE_RF24
    #define MY_GATEWAY_W5100
    #define MY_SIGNING_SOFT
    #define MY_SIGNING_REQUEST_SIGNATURES
    #define MY_RF24_CE_PIN 5
    #define MY_RF24_CS_PIN 6

    Using an UNO with an ethernet shield, wired up like this: https://www.mysensors.org/build/ethernet_gateway
    A2 MISO
    A1 MOSI
    A0 SCK
    6 CSN
    5 CE


  • Admin

    @ximinez Just tested your setup/settings using an Arduino UNO + W5100 shield and I can confirm, that SOFTSPI (A2=MISO, A1=MOSI, A0=SCK, D6=CSN, D5=CE) and HWSPI (D12=MISO, D11=MOSI, D13=SCK, D6=CSN, D5=CE + #define MY_W5100_SPI_EN 4) work with the refactored RF24 driver.

    Please double check you are using the most recent MySensors 2.0.0-beta lib and GatewayW5100 sketch.



  • @tekka said:

    @ximinez Just tested your setup/settings using an Arduino UNO + W5100 shield and I can confirm, that SOFTSPI (A2=MISO, A1=MOSI, A0=SCK, D6=CSN, D5=CE) and HWSPI (D12=MISO, D11=MOSI, D13=SCK, D6=CSN, D5=CE + #define MY_W5100_SPI_EN 4) work with the refactored RF24 driver.

    Please double check you are using the most recent MySensors 2.0.0-beta lib and GatewayW5100 sketch.

    I just did (for the second time), and lo and behold it works. Absolutely no clue why, but I'm sorry I've wasted your time.

    My gateway can finally have DHCP and signing at the same time 🙂


  • Admin

    @ximinez excellent 👍 HWSPI uses even less space and saves some analog pins.
    @hek, AFAIK the initial issues with shared SPI lines and W5100 seem gone - we can eventually update the ethernet gw build instructions...


  • Admin

    @tekka

    It depends on the module manufacturer. If they use the correct pin for CE, then it's possible. Otherwise the W5100 chip itself hold MISO line low, when the chip is not selected, effectively blocking the spi for other uses

    So to keep things safe, I suggest that we keep the soft spi option.


  • Admin

    @tekka

    found this document http://www.i-vis.co.jp/pdf/wiznet/tcpip_chip/w3150a+/W5100_AN_SPI.pdf

    Look at page 3 "Multiple SPI Slave Usage". It describes the problem with W5100.


  • Contest Winner

    Some W5100 boards also have a SPI-enable signal which can be used to turn off drivers from W5100 when the bus is used elsewhere. That is, enable it only when the W5100 is addressed. I used this in my sketch when I had a W5100-based ethernet gw but I don't think all modules offer this possibility.


  • Admin

    Yeah, I think it's mainly applicable for the "dual" W5100 shield with SD card adapter.



  • Both soft and hard SPI work on my cheap W5100 clone shield (with SD).



  • All,

    Is the content of this topic still valid? All my wiring is according to the intructions (and this topic). I get the following errors:

    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

    Note: I did fiddle around with the radio channel settings in myconfig.h, reinstalled the original myconfig.h though.

    Thx

    Ralph


  • Admin

    @bisschopsr looks like a SPI issue (return value 255 hints to that).

    edit: Is this referring to the same issue: https://forum.mysensors.org/topic/4662/ethernet-gateway-with-w5100-radio-error-solved/3 ?


  • Mod

    @ximinez I also use a w5100 shield with SD card and I need to initialize the cs line of the SD card to high in the before() method, so before mysensors start (when using hardware spi) .
    Otherwise the SD card will also be selected on the spi bus during startup and radio init will fail.



  • @tekka: More or less. I wanted to know if the beta that was used in this thread still sticks with the content (does this make sense). It is supportive to my other question with the refered link.

    Thx

    Ralph



  • @tekka: In addition: the setup is working now, but not flawless. No radio connection between the node and the GW. But of course this is a different topic.


Log in to reply
 

Suggested Topics

69
Online

11.4k
Users

11.1k
Topics

112.7k
Posts