Ethernet Gateway ....i am lost

  • I am also trying to build the ethernet gateway. I already have built a sensor (humidity and temp sensor) which is working and tested it with the serial gateway. For the gateway I am using a ardruino nano and a W5100 Ethernet module. (arduino 1.8.2 and board 1.6.11)

    The trouble i am having is getting a valid IP-number. In my scetch (it is the default scetch from the mysensors page for the gateway) i defined the following IP

    #define MY_IP_ADDRESS 192,168,1,108   // If this is disabled, DHCP is used to retrieve address

    When i start my scetch, i am see the following information in the serial monitor:

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;Eth: disconnect
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;Eth: disconnect

    as you can see the IP address is not correct, but it is receiving information from my temp/humidity sensor. Each time i reset the arduino i am getting a different value. Sometimes a part of my IP-address and sometimes just zeroes. In the page of my router with connected devices, i see sometimes new device with strange IP and part of de MAC-address.

    does anyone have an idea?

  • Plugin Developer

    @Mister_ik As you have the router, why don't you try with DHCP and lock an IP on Router for this gateway?
    Other solution you may go with MQTT gateway.

  • Probably a stupid question, but thought I'd chime in... Since you don't show it above, are you also #define'ing a MAC address (like below)... Is the MAC address unique on your network? I've seen very odd things happen with duplicate MACs.

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

  • Mod

    You could also try other sketches that use w5100 module and see what they do, but try dhcp first.

  • @jkandasa I already tried to lock an IP address on the router, but that does not change anything

  • @stevebus Yes the MAC address is also defined and i tried already different MAC address, so i know for sure it cant be a duplicate MAC address

  • Mod

    Could be a faulty module... Who knows... Did you try a different ethernet library version?

  • @gohan i am also affraid of a faulty module.....i am already waiting for new one to arrrive. i ordered now a ESP8266 version..hopefully more luck with that one.

Log in to reply

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.