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. Announcements
  3. 💬 Building an Ethernet Gateway

💬 Building an Ethernet Gateway

Scheduled Pinned Locked Moved Announcements
133 Posts 42 Posters 36.1k Views 35 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.
  • R Offline
    R Offline
    Reza
    wrote on last edited by Reza
    #2

    i have this problem:

    0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
    0;255;3;0;9;TSM:INIT
    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;TSM:INIT
    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;TSM:INIT
    0;255;3;0;9;!TSM:RADIO:FAIL
    0;255;3;0;9;!TSM:FAILURE
    0;255;3;0;9;TSM:PDT
    

    i use ENC28J60 module . arduino nano + nrf24 + 4.7uf
    this code:

    #define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    // When ENC28J60 is connected we have to move CE/CSN pins for NRF radio
    #define MY_RF24_CE_PIN 5
    #define MY_RF24_CS_PIN 6
    
    // Enable gateway ethernet module type 
    #define MY_GATEWAY_ENC28J60
    
    // Gateway IP address
    #define MY_IP_ADDRESS 192,168,0,110
    
    // 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, 178, 254   
    
    // 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 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
    
    // Flash leds on rx/tx/err
    #define MY_LEDS_BLINKING_FEATURE
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // 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 
    
    #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  // the PCB, on board LED
    
    #include <SPI.h>
    #include <UIPEthernet.h>
    #include <MySensors.h>
    
    
    void setup()
    {
    }
    
    void loop() {
    }```
    1 Reply Last reply
    2
    • G Offline
      G Offline
      gvorster
      wrote on last edited by
      #3

      Would like to use MQTT gateway using RFM69. The RFM69 cannot be used with W5100 because of soft-spi, is this still the case? Can it then be used with ENC28J60?

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

        @gvorster
        hello, i'm working on rfm69 (refactorization and adding features), which will support softspi and w5100, and uses a lot less memory. might be available soon.

        G E 2 Replies Last reply
        1
        • scalzS scalz

          @gvorster
          hello, i'm working on rfm69 (refactorization and adding features), which will support softspi and w5100, and uses a lot less memory. might be available soon.

          G Offline
          G Offline
          gvorster
          wrote on last edited by
          #5

          @scalz said:

          @gvorster
          hello, i'm working on rfm69 (refactorization and adding features), which will support softspi and w5100, and uses a lot less memory. might be available soon.

          Great, looking forward to it!

          1 Reply Last reply
          0
          • Marek BělušaM Offline
            Marek BělušaM Offline
            Marek Běluša
            wrote on last edited by
            #6

            Hi, i i try compile GatewayW5100.ino on this page then result is compiler error:

            Arduino: 1.6.12 (Windows 10), Board: "Arduino Nano, ATmega328"

            In file included from C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:23:0,

                         from C:\Users\M\Documents\Arduino\libraries\MySensors-master/MySensors.h:261,
            
                         from C:\Users\M\AppData\Local\Temp\arduino_modified_sketch_502474\sketch_oct22a.ino:116:
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:34:31: error: 'SPI_MODE0' was not declared in this scope

            #define MY_RF24_SPI_DATA_MODE SPI_MODE0

                                       ^
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:76: note: in expansion of macro 'MY_RF24_SPI_DATA_MODE'

            SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;

                                                                                    ^
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:97: error: template argument 4 is invalid

            SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;

                                                                                                         ^
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:103: error: invalid type in declaration before ';' token

            SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;

                                                                                                               ^
            

            In file included from C:\Users\M\Documents\Arduino\libraries\MySensors-master/MySensors.h:261:0,

                         from C:\Users\M\AppData\Local\Temp\arduino_modified_sketch_502474\sketch_oct22a.ino:116:
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp: In function 'uint8_t RF24_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)':

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:44:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'

            uint8_t status = _SPI.transfer( cmd );

                                ^
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:47:18: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'

            status = _SPI.transfer( NOP );
            
                          ^
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:49:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'

            } else status = _SPI.transfer(*current++);

                                ^
            

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp: In function 'bool RF24_initialize()':

            C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:261:7: error: request for member 'begin' in '_SPI', which is of non-class type 'int'

            _SPI.begin();

               ^
            

            exit status 1
            Error compiling for board Arduino Nano.

            This report would have more information with
            "Show verbose output during compilation"
            option enabled in File -> Preferences.

            Could you please help?

            Thanks.

            mfalkviddM 1 Reply Last reply
            0
            • Marek BělušaM Marek Běluša

              Hi, i i try compile GatewayW5100.ino on this page then result is compiler error:

              Arduino: 1.6.12 (Windows 10), Board: "Arduino Nano, ATmega328"

              In file included from C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:23:0,

                           from C:\Users\M\Documents\Arduino\libraries\MySensors-master/MySensors.h:261,
              
                           from C:\Users\M\AppData\Local\Temp\arduino_modified_sketch_502474\sketch_oct22a.ino:116:
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:34:31: error: 'SPI_MODE0' was not declared in this scope

              #define MY_RF24_SPI_DATA_MODE SPI_MODE0

                                         ^
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:76: note: in expansion of macro 'MY_RF24_SPI_DATA_MODE'

              SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;

                                                                                      ^
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:97: error: template argument 4 is invalid

              SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;

                                                                                                           ^
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:103: error: invalid type in declaration before ';' token

              SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;

                                                                                                                 ^
              

              In file included from C:\Users\M\Documents\Arduino\libraries\MySensors-master/MySensors.h:261:0,

                           from C:\Users\M\AppData\Local\Temp\arduino_modified_sketch_502474\sketch_oct22a.ino:116:
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp: In function 'uint8_t RF24_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)':

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:44:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'

              uint8_t status = _SPI.transfer( cmd );

                                  ^
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:47:18: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'

              status = _SPI.transfer( NOP );
              
                            ^
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:49:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'

              } else status = _SPI.transfer(*current++);

                                  ^
              

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp: In function 'bool RF24_initialize()':

              C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:261:7: error: request for member 'begin' in '_SPI', which is of non-class type 'int'

              _SPI.begin();

                 ^
              

              exit status 1
              Error compiling for board Arduino Nano.

              This report would have more information with
              "Show verbose output during compilation"
              option enabled in File -> Preferences.

              Could you please help?

              Thanks.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #7

              If anyone answers @Marek-Běluša, please answer in https://forum.mysensors.org/topic/5159/ethernet-gateway-compile-error/ to avoid working in two different threads. Do not answer here.

              @Marek-Běluša please do not post the same question in more than one place.

              1 Reply Last reply
              1
              • rbighouseR Offline
                rbighouseR Offline
                rbighouse
                wrote on last edited by
                #8

                I've spent hours and hours to get the W5100 Ethernet Module working on my Arduino Nano board and unfortunately without success. I'm using the MySensors version 2.0 with the Arduino AVR Boards 1.6.15 installed. I don't understand the issue at all. I cannot ping W5100 should, not if I use a static IP or if I configure to use DHCP. I've tested it with and without the NRF24L01 Radio connected and no luck. I've checked the wires already 10 times. This is the wire-ring info:
                W5100 <=> Arduino Nano
                VDD <=> Pin 27 / +5V
                NSS <=> Pin 13 / D10
                MOSI <=> Pin 14 / D11
                GND <=> Pin 4
                SCK <=> Pin 16 / D13
                MISO <=> Pin 15 / D12

                Is this the correct wire configuration? What else can I do to debug this?

                On the W5100 I see the link led blinking on a regular basis almost at the same time as the Rx led, but I read that this HW issue and doesn't influence the behaviour of the ethernet board. Is this correct? If not, how to resolve this?

                Looking forward to hints and tips as I'm completely lost on this topic.

                mfalkviddM 1 Reply Last reply
                0
                • rbighouseR rbighouse

                  I've spent hours and hours to get the W5100 Ethernet Module working on my Arduino Nano board and unfortunately without success. I'm using the MySensors version 2.0 with the Arduino AVR Boards 1.6.15 installed. I don't understand the issue at all. I cannot ping W5100 should, not if I use a static IP or if I configure to use DHCP. I've tested it with and without the NRF24L01 Radio connected and no luck. I've checked the wires already 10 times. This is the wire-ring info:
                  W5100 <=> Arduino Nano
                  VDD <=> Pin 27 / +5V
                  NSS <=> Pin 13 / D10
                  MOSI <=> Pin 14 / D11
                  GND <=> Pin 4
                  SCK <=> Pin 16 / D13
                  MISO <=> Pin 15 / D12

                  Is this the correct wire configuration? What else can I do to debug this?

                  On the W5100 I see the link led blinking on a regular basis almost at the same time as the Rx led, but I read that this HW issue and doesn't influence the behaviour of the ethernet board. Is this correct? If not, how to resolve this?

                  Looking forward to hints and tips as I'm completely lost on this topic.

                  mfalkviddM Offline
                  mfalkviddM Offline
                  mfalkvidd
                  Mod
                  wrote on last edited by
                  #9

                  @rbighouse have you seen the wiring guide in the page linked in the first post in this thread?

                  1 Reply Last reply
                  0
                  • rbighouseR Offline
                    rbighouseR Offline
                    rbighouse
                    wrote on last edited by
                    #10

                    @mfalkvidd yes I've read that, even multiple times. I've check the wiring 10 times as well and cannot find a difference. Also changed to another W5100 board as well as a different Arduino Uno board to make sure it is not a board issue. The problem stays the same. What I've noticed as a difference is that my W5100 runs on 5V and not on 3.3V as indicated in the wiring table. Connecting the W5100 with 3.3V doesn't start (boot up) the board.

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      Cansher
                      wrote on last edited by
                      #11

                      Just thought I'd mention that I've had good experience with adding a capacitor between GND and VCC for the ethernet module as well.
                      Same approach as for wiring the radio. https://www.mysensors.org/build/connect_radio

                      Previously had problems with GW disconnecting (Eth: disconnect) which is now reduced.

                      1 Reply Last reply
                      1
                      • Sergio Álvarez SanchisS Offline
                        Sergio Álvarez SanchisS Offline
                        Sergio Álvarez Sanchis
                        wrote on last edited by
                        #12

                        Same problem like Reza, same error messages AND I USING ethernet shield, ARDUINO MEGA AND nrf24

                        1 Reply Last reply
                        0
                        • Sergio Álvarez SanchisS Offline
                          Sergio Álvarez SanchisS Offline
                          Sergio Álvarez Sanchis
                          wrote on last edited by
                          #13

                          And using ARDUINO 1 the same problem.
                          0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
                          0;255;3;0;9;TSM:INIT
                          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;TSM:INIT
                          0;255;3;0;9;!TSM:RADIO:FAIL
                          0;255;3;0;9;!TSM:FAILURE
                          0;255;3;0;9;TSM:PDT

                          1 Reply Last reply
                          0
                          • DallieNLD Offline
                            DallieNLD Offline
                            DallieNL
                            wrote on last edited by
                            #14

                            Had lots of issues getting this to work. The issue seems to be with the ethernet part, as I only have an ethernet board attached I removed the lines for the radio and the pin redirection. Still the code kept restarting all the time or just not being able to connect the controller.

                            AVR version of the Arduino 1.8.0 kit needs to be downgraded. I had 1.6.16 and downgraded to 1.6.11.

                            Open Arduino. Tools > Board: xxxxx > Boards manager... > Click "Arduino AVR Boards" > Select Version > 1.6.11

                            Recompile and you are good.

                            1 Reply Last reply
                            2
                            • D Offline
                              D Offline
                              David
                              wrote on last edited by David
                              #15

                              Hi @DallieNL ,
                              thanks for your tips,
                              I got the same issue with serial gateway, 1.6.11 is the best.

                              David.

                              1 Reply Last reply
                              0
                              • mppM Offline
                                mppM Offline
                                mpp
                                wrote on last edited by
                                #16

                                Would it be possible to build an MQTT gateway using the ESP8266 WiFi Gateway?

                                MyController with USB powered WeMos D1/mini ESP8266 MQTT Gateways and battery powered Arduino Pro Mini using the RFM69 radio

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

                                  @mpp said:

                                  Would it be possible to build an MQTT gateway using the ESP8266 WiFi Gateway?

                                  Yes, the MQTT gateway works on ESP as well.

                                  mppM 1 Reply Last reply
                                  1
                                  • LaMB95L Offline
                                    LaMB95L Offline
                                    LaMB95
                                    wrote on last edited by
                                    #18

                                    Anyone have an instruction to set up a W5500 ethernet gateway?

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

                                      @LaMB95
                                      For the moment, i don't think there is an howto regarding w5500 as we're mostly using w5100, but maybe you can find some infos in this topic https://forum.mysensors.org/topic/2901/my-ethernet-gateway-board-w5500

                                      1 Reply Last reply
                                      0
                                      • KiwiHC16K Offline
                                        KiwiHC16K Offline
                                        KiwiHC16
                                        wrote on last edited by
                                        #20

                                        Hi All,
                                        I have an ethernet gateway base on arduino Pro mini with NRF24L01 radio and Funding ethernet card with W5100 chips. (As per description of this page)
                                        All works fine when I'm connected to it with Arduino IDE. Works for hours/days.
                                        If I unplug the IDE (disconnect USB) and run it alone it stop working after for minutes or few hours.
                                        I have only one sensor (temperature) to test. It send Temperature and battery level every 10s (testing). Led attached to Gateway to show the traffic lit up twice each time it receive the information from the sensor. The LED lit up twice like half a second when everything is fine. Easy to see.
                                        When the issue starts, the led lit up time to time but very quickly, and even very difficult to see. Some time I can ping the Gateway, some time not.
                                        Any idea from anybody ?

                                        1 Reply Last reply
                                        0
                                        • KiwiHC16K Offline
                                          KiwiHC16K Offline
                                          KiwiHC16
                                          wrote on last edited by
                                          #21

                                          additional info: Same situation having //#define MY_DEBUG defined or not.

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


                                          13

                                          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