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.0k 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.
  • H hoggin

    I just spent a long time troubleshooting my problems trying to set this up and I thought I would share. I followed this tutorial and everything was a breeze except my unit kept rebooting and I couldn't figure out why. I thought for the longest time it was the power supply but it ended up being the version of Arduino IDE I was using. I found some answers https://forum.mysensors.org/topic/4628/solved-mysensors-2-0-ethernet-gateway-enc28j60-restart-ip-issue/46 and https://forum.mysensors.org/topic/4680/mysensors-2-0-ethernet-gateway-atmega-w5100-restart-all-time that got me down the right path. I downgraded to "Arduino IDE 1.6.11" and that worked. I completely uninstalled arduino from my system and just started over with the older version. I assembled everything as I had done before and it just fired right up. The mysensors library I used was 2.0.0 and again it all worked perfectly. I was amazed. I didnt have to comment out the debug or do anything other than follow the tutorial EXCEPT only use 1.6.11 to upload it all.
    Hope this helps someone in the future.

    rejoe2R Offline
    rejoe2R Offline
    rejoe2
    wrote on last edited by
    #33

    @hoggin At least according to my experience, just downgrading the AVR Board Definitions to <=1.6.11 using the Board-Manager within an recent version of the IDE should have done the trick; downgrade of the other libs including mysensors (2.1.1) was not necessary.

    In Addition: For the serial Gateways this kind of trouble seems to be solved since version 1.6.18 of the AVR-Board definitions (shipped since several weeks).

    Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

    H 1 Reply Last reply
    1
    • rejoe2R rejoe2

      @hoggin At least according to my experience, just downgrading the AVR Board Definitions to <=1.6.11 using the Board-Manager within an recent version of the IDE should have done the trick; downgrade of the other libs including mysensors (2.1.1) was not necessary.

      In Addition: For the serial Gateways this kind of trouble seems to be solved since version 1.6.18 of the AVR-Board definitions (shipped since several weeks).

      H Offline
      H Offline
      hoggin
      wrote on last edited by
      #34

      @rejoe2 Perhaps you are correct. I am not nearly as well versed in this stuff as others. I was working on the Ethernet project so I didn't spend much time messing with the serial end of it.

      rejoe2R 1 Reply Last reply
      0
      • H hoggin

        @rejoe2 Perhaps you are correct. I am not nearly as well versed in this stuff as others. I was working on the Ethernet project so I didn't spend much time messing with the serial end of it.

        rejoe2R Offline
        rejoe2R Offline
        rejoe2
        wrote on last edited by
        #35

        @hoggin I don't have experience with the ethernet part and just wanted to point out that your solution may be a little "overdone" (but I'm not sure about that).
        Anyhow: Perhaps you should add a remark wrt. to this to your other post doubling the info you wrote here to avoid others doing tho long round instead of the direct way?

        Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hoggin
          wrote on last edited by
          #36

          @rejoe2 I think you are suggesting that I create a link between this post and the other one. Here Hopefully this will direct people to more information regarding the rebooting issue i faced.

          rejoe2R 1 Reply Last reply
          0
          • H hoggin

            @rejoe2 I think you are suggesting that I create a link between this post and the other one. Here Hopefully this will direct people to more information regarding the rebooting issue i faced.

            rejoe2R Offline
            rejoe2R Offline
            rejoe2
            wrote on last edited by
            #37

            @hoggin The post I had in mind is this one: https://forum.mysensors.org/topic/6149/ethernet-gateway-shows-up-on-vera-but-doens-t-want-to-include-devices/17#
            I am going to post a similar answer also there.

            Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

            1 Reply Last reply
            0
            • H Offline
              H Offline
              hoggin
              wrote on last edited by
              #38

              @rejoe2 Sounds good.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                RWoerz
                wrote on last edited by
                #39

                I have a Vera but I'm moving some of my stuff over to OpenHab. So on one side I was using the standard W5100 GateWay on the other I need the MQTT GateWay. The major difference is in the "define MY_PORT" one is 5003 and the other is 1883. Is there a way to do both? Thanks.

                1 Reply Last reply
                0
                • hekH hek

                  @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 Offline
                  mppM Offline
                  mpp
                  wrote on last edited by
                  #40

                  @hek just tested the gateway sketch on an esp with an rfm69 and it looks really promising. Would it be possible to communicate with moteino's or do I have to create arduino+rfm69 nodes running the mysensor sketch?

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

                  mfalkviddM 1 Reply Last reply
                  0
                  • mppM mpp

                    @hek just tested the gateway sketch on an esp with an rfm69 and it looks really promising. Would it be possible to communicate with moteino's or do I have to create arduino+rfm69 nodes running the mysensor sketch?

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

                    @mpp according to this:

                    Moteino is a low power wireless Arduino compatible development platform based on the popular ATmega328p chip used in the Arduino-UNO, making it 100% compatible with the Arduino IDE (programming environment) ... They are compatible with any other Arduino clones that use the popular HopeRF RFM69 transceiver

                    so they should work just fine. Just upload one of the MySensors example sketches to the moteino and try.

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #42

                      Just for sharing, yesterday I was playing around and I tried to make an ethernet gateway with a UNO with w5100 shield and a nrf24 radio, then I attached a DHT11 sensor to it; when I compiled the sketch I had to disable the MY_DEBUG otherwise the I could not upload it to the UNO as it was using 102% of available memory and even with no debug the Arduino IDE was giving me warning about low ram memory available that could make system unstable. I then removed the NRF24 part as I didn't need it at the moment and the sketch compiled smoothly.
                      It looks like the MEGA2560 could be a better candidate if you want to make a gateway with some sensors.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        Sensibelchen
                        wrote on last edited by Sensibelchen
                        #43

                        Solved: challenge with requesttime

                        Update: mysensors adapter 1.0.7 for ioBroker solved the issue.

                        Challenge:
                        my arduino node20 is requesting epoch time. W5100 gateway forwards message to controller (ioBroker). This is the gateways console in debug:
                        0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=3,t=1,pt=0,l=0,sg=0:
                        0;255;3;0;9;Eth: 20;255;3;1;I_TIME;1491770622
                        0;255;3;0;9;TSF:MSG:SEND,0-0-20-20,s=255,c=3,t=0,pt=0,l=10,sg=0,ft=0,st=OK:1491770622
                        0;255;3;0;9;TSF:MSG:READ,20-20-0,s=255,c=3,t=0,pt=0,l=10,sg=0:1491770622
                        0;255;3;0;9;TSF:MSG:ACK

                        The parser helps with the interpretation:

                        1. request from node20 (Arduino) t=1 (=I_TIME)
                        2. gateway receives epoch time from controller (ioBroker)
                        3. gateway forwards info to node20. BUT: now with t=0 (=I_BATTERY_LEVEL)!!!!!!!!!!!!!!!
                        4. node20 confirms battery level (and still doesn't know the time)

                        I'm using the ordinary gateway for W5100. Sensordata moves flawless to the controller but forwarding the time seems to be broken.

                        Any idea? Thank you in advance.

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          Ed1500
                          wrote on last edited by
                          #44

                          The reason why the 5100 module has problems sharing the SPI interface is because it lacks some hardware compared to the W5100 shield.
                          On (most of) the module(s) the SEN (SPI Enable) pin is pulled HIGH with a resistor, whereas on the W5100 shield it also receives the inverted CS signal.
                          That means that when the chip is deselected (CS=HIGH), the SEN pin receives a LOW and the SPI is switched off.
                          Apparently the state of the SS pin through the CS signal is not enough to Switch off the W5100 SPI: the MISO remains active, the SEN pin neds to be addressed too to shut off SPI completely.
                          If it works with a virtual SPI connection, great, but if you want to "fix" the hardware SPI, all you need to do is to invert the CS signal with a 74xx14 or maybe even a 74xx04 and feed that to the SEN pin of the chip.
                          https://arduinodiy.wordpress.com/2017/04/12/the-w5100-bug/

                          1 Reply Last reply
                          0
                          • Mitja BlazinsekM Offline
                            Mitja BlazinsekM Offline
                            Mitja Blazinsek
                            wrote on last edited by
                            #45

                            i'm using w5100 and mega, checking wiring 10 times and successfully uploaded code didn't change anything in code just copy paste but it seem like is not working i installed domoticz controller and it log to me
                            2017-04-17 21:51:38.438 Error: MySensors: Can not connect to: 192.168.178.66:5003
                            2017-04-17 21:51:38.438 TCP: Connection problem (Unable to connect to specified IP/Port)
                            Also i can't see any new client in router client table, rx led is blinking but tx led on w5100 is always off
                            can anyone tell me how can i see if gw is working, i don't know is the problem on controller or hw? and how can i fix the problem?
                            THX for any help, and excuse for my english please ;)

                            1 Reply Last reply
                            0
                            • gohanG Offline
                              gohanG Offline
                              gohan
                              Mod
                              wrote on last edited by
                              #46

                              Try with any other sketch even not mysensors and check if ip is working, if still not working could be also the Chinese clone shield: I had one that got the wrong termination resistors and I fixed it by soldering 1 100ohms resistor between pin 1-2 and 1 between pin 3-6 below the ethernet socket

                              1 Reply Last reply
                              0
                              • Mitja BlazinsekM Offline
                                Mitja BlazinsekM Offline
                                Mitja Blazinsek
                                wrote on last edited by
                                #47

                                probably dumb question but where can i found any sketch to test the shield i tried ethernet examples from arduino ide but dont know how to connect the right pins it just said like: (Ethernet shield attached to pins 10, 11, 12, 13)

                                E 1 Reply Last reply
                                0
                                • Mitja BlazinsekM Mitja Blazinsek

                                  probably dumb question but where can i found any sketch to test the shield i tried ethernet examples from arduino ide but dont know how to connect the right pins it just said like: (Ethernet shield attached to pins 10, 11, 12, 13)

                                  E Offline
                                  E Offline
                                  Ed1500
                                  wrote on last edited by
                                  #48

                                  @Mitja-Blazinsek https://i0.wp.com/www.jdohnalek.com/wp-content/uploads/2014/10/W5100-Red-Mini-01-e1414707788425.jpg

                                  1 Reply Last reply
                                  0
                                  • numanxN Offline
                                    numanxN Offline
                                    numanx
                                    wrote on last edited by
                                    #49

                                    Could you send us a picture with the module?

                                    1 Reply Last reply
                                    0
                                    • Mitja BlazinsekM Offline
                                      Mitja BlazinsekM Offline
                                      Mitja Blazinsek
                                      wrote on last edited by
                                      #50

                                      look like the Chinese shield is crap i try to test the web server example and nothing displayed

                                      E 1 Reply Last reply
                                      0
                                      • Mitja BlazinsekM Mitja Blazinsek

                                        look like the Chinese shield is crap i try to test the web server example and nothing displayed

                                        E Offline
                                        E Offline
                                        Ed1500
                                        wrote on last edited by
                                        #51

                                        @Mitja-Blazinsek can you check your lineresistors? It is the spider like, 8 legged rrsistor array as in this picture https://arduinodiy.files.wordpress.com/2017/04/w5100bug2.png?w=768&h=332
                                        what is the value?

                                        1 Reply Last reply
                                        0
                                        • numanxN Offline
                                          numanxN Offline
                                          numanx
                                          wrote on last edited by
                                          #52

                                          Maybe you have the ENC28J60 module which is different than w5100.

                                          try this code at the beginning of your sketch(using a mysensor's example)

                                          you have to change the ip to match your subnet and try to ping it.

                                          You can find the correct pinout here http://s3.electrodragon.com/wp-content/uploads/2011/11/172004eierrfwri9xsfamq-11.jpg

                                          #define MY_GATEWAY_ENC28J60
                                          #define MY_IP_ADDRESS 192,168,1,66  
                                          #define MY_PORT 5003   
                                          #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
                                          #include <UIPEthernet.h>```
                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          19

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          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