Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. Ethernet gateway example in DEV branch

Ethernet gateway example in DEV branch

Scheduled Pinned Locked Moved Development
19 Posts 5 Posters 4.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • carlierdC Offline
    carlierdC Offline
    carlierd
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      @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.

      1 Reply Last reply
      0
      • carlierdC Offline
        carlierdC Offline
        carlierd
        wrote on last edited by
        #3

        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,

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          @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?

          1 Reply Last reply
          0
          • carlierdC Offline
            carlierdC Offline
            carlierd
            wrote on last edited by
            #5

            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 ?

            1 Reply Last reply
            0
            • hekH Offline
              hekH Offline
              hek
              Admin
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • scalzS Offline
                scalzS Offline
                scalz
                Hardware Contributor
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • carlierdC Offline
                    carlierdC Offline
                    carlierd
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    • carlierdC Offline
                      carlierdC Offline
                      carlierd
                      wrote on last edited by
                      #10

                      @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 !

                      1 Reply Last reply
                      0
                      • hekH Offline
                        hekH Offline
                        hek
                        Admin
                        wrote on last edited by
                        #11

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

                        1 Reply Last reply
                        0
                        • carlierdC Offline
                          carlierdC Offline
                          carlierd
                          wrote on last edited by
                          #12

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

                          What can I do ?

                          1 Reply Last reply
                          0
                          • hekH Offline
                            hekH Offline
                            hek
                            Admin
                            wrote on last edited by
                            #13

                            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..

                            1 Reply Last reply
                            0
                            • carlierdC Offline
                              carlierdC Offline
                              carlierd
                              wrote on last edited by
                              #14

                              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.

                              1 Reply Last reply
                              0
                              • carlierdC Offline
                                carlierdC Offline
                                carlierd
                                wrote on last edited by
                                #15

                                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 !

                                1 Reply Last reply
                                1
                                • carlierdC Offline
                                  carlierdC Offline
                                  carlierd
                                  wrote on last edited by
                                  #16

                                  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 ...

                                  1 Reply Last reply
                                  0
                                  • carlierdC Offline
                                    carlierdC Offline
                                    carlierd
                                    wrote on last edited by
                                    #17

                                    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.

                                    1 Reply Last reply
                                    0
                                    • J Offline
                                      J Offline
                                      jacquot
                                      wrote on last edited by
                                      #18

                                      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?

                                      1 Reply Last reply
                                      0
                                      • C Offline
                                        C Offline
                                        cdr
                                        wrote on last edited by
                                        #19

                                        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)

                                        1 Reply Last reply
                                        0
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        17

                                        Online

                                        11.7k

                                        Users

                                        11.2k

                                        Topics

                                        113.1k

                                        Posts


                                        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • MySensors
                                        • OpenHardware.io
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular