Ethernet gateway example in DEV branch



  • Hello,

    I try to run the Ethernet Gateway example on the DEV branch :

    https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples/GatewayW5100

    The example is really different from the web site:

    http://www.mysensors.org/build/ethernet_gateway

    In fact there is nothing in setup and loop methods. Is it normal ? I tried to copy web site code but seems not correct ...

    Thanks,

    David.


  • Admin

    @carlierd said:

    In fact there is nothing in setup and loop methods. Is it normal ?

    Yes, this is how it should be. No need to modify anything but the defines at the top.



  • Thanks ! Sounds very simple ! But unfortunately, I have not a lot of thing on the serial monitor, just that line:

    0;0;3;0;9;Starting...
    

    I am using NANO Ethernet shield and RFM69HW.
    I enable MY_DEBUG_VERBOSE in MyConfig.h but there is no more thing !

    Perhaps the initialization of RFM69 is blocking ? How I can check ?
    Thanks,


  • Admin

    @carlierd
    MY_DEBUG_VERBOSE is currently only used for the NRF radio.

    Guess you could add a debug print i setup() to see if the internal library setup has finalised.

    Are yo able to ping the gateway?



  • Ah ok ! That's why MY_DEBUG_VERBOSE didn't increase the size of the sketch when using RFM69.
    Ping is not working.

    I will try to add a debug print in setup().

    If not working, how to check if RFM69 is correctly initialized ?


  • Admin

    The RFM69 doesn't have any fancy mis-wired check like RF24.

    The only place I can find where it would "hang" is here:
    https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/drivers/RFM69/RFM69.cpp#L104-L105

    Transport init doesn't do much more than calling it.
    https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/core/MyTransportRFM69.cpp#L29


  • Hardware Contributor

    Hi.
    @hek: you are right it can hang in rfm69 L104-105 and there are some do while just before too..not very cool!
    If it hangs in rfm69.cpp, maybe modifying lib like Charles has done. He has added a timeout in Initialize for each do while loop which make sense I think; otherwise we can't know what is blocking...
    Here if it can help:
    https://github.com/hallard/RFM69/blob/master/firmware/RFM69.cpp


  • Admin

    @scalz
    Yes, looks much better. And more consistent with how the RF24 driver works.



  • Hello,

    I added some println and the first do while in RFM69.cpp at line 93 failed ... Probably due to a connection issue with the RFM69.
    I while check if I can used Charles driver but not sure I can just replace RFM69.h and RFM69.cpp with Charles's files ...
    Not sure my knowledge is enougth to do upgrade the current driver.



  • @all

    The problem of RFM69 initialization was due to the voltage divider (4,7k and 10k resistors), with logic level converter the RFM69 starts ! Not sure to understand as a lot of post on internet suggest the voltage divider ...

    Now I have that debug messages:

    0;0;3;0;9;Starting...
    IP: 0.32.0.96
    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
    

    The IP address change at each start-up and is of course not what I set in the sketch.
    How-to debug ?

    Thanks !


  • Admin

    Are you running the W5100 module? I has some real strange issues before feeding it with a stable power source.



  • Yes, the W5100 but with and external power supply !
    All leds are lit.

    What can I do ?


  • Admin

    I'm suspecting it has to do with collisions/misbehaving by the W5100 on SPI.

    Someone on the forum did some tests using SOFT SPI on the RF69. Not sure what the results were..



  • Hello,

    I read several post and there is forks of LowPowerLab driver which seem to allow using Ethernet gateway and RFM69. I first will try to run them !

    David.



  • Hello,

    I tried the SOFT SPI from Gieemek (see this post) and it's really better ! I done it with a UNO board on pin 7, 6, 5 and 4 (it seems that pin 13, 12, 11 and 10 are not a good choice with the Ethernet shield).

    So now I can ping the Gateway 🙂

    But (yes, there is a but), MYSController is not able to connect and there is no specific message on the serial link of the UNO board:

    0;0;3;0;9;Starting...
    IP: 192.1.1.66
    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
    

    The IP address is the good one.
    What can I do ?

    Thanks !



  • I tried the current branch and it's the same thing.
    I tried using DHCP to be sure the Ethernet shield is working and there is no problem.

    I saw message between MYSController and the Ethernet gateway using Wireshark but I am not able to decode them and MYSController is never really connected ...



  • I finally remove the Ethernet shield and use the initial RFM69 driver and now it's working !
    I will continue on this branch without the Ethernet shield until I got more experience and will come back on the dev branch after !

    David.



  • Hi all
    First of all i apologies for my bad english.

    My GW aruino nan with 5100 shield and RF24 radio using soft SPI

    Using mysensor 1.5 library radio init fail
    Using mysensor dev library the gate a way start with wrong IP adress.

    Note the radio is powerd on battery with common ground connexion while the nano and ethernet shield share the same power supply. the standard ethernet expamle are working so i dont thin its a power problem.

    Any idea what is wrong?



  • I'm testing the DEV branch with MQTT and W5100, I use a shield with an included SD-CARD. I had trouble sending messages using MQTT so I tried to debug using plain Ethernet gateway w5100, the same problem seems to occur.

    Everything seems to work normal in debug log, but I noticed that I never get a "gateway ready" command. Please note that radio init is good, and I get an IP adress that is reachable.

    I tried to enable SOFTSPI and UDP ethernet, but no dice.

    Really looking forward to the new w5100 MQTT client gateway! Any advice appreciated. (trying with a w5100 without SD CARD did not change anything)


Log in to reply
 

Suggested Topics

  • 1
  • 3
  • 198
  • 2
  • 10
  • 2

24
Online

11.2k
Users

11.1k
Topics

112.5k
Posts