[Solved] W5100 Ethernet Gateway with NRF24 stable MySensors 2.1.0 problem



  • Hi Guys,
    Today I decided to upgrade my MySenors Arduino UNO with W5100 shield + NRF PA version on it to the newer stable version 2.1.0. Unfortunately I am having problem with establishing connection to Domoticz stable release 3.5877.

    I have run it for quite long time using MySensors beta 2.0.0 (I did it around half year ago) and beta's Domoticz without any issues.

    Problem now is updated ethernet gateway keeps all the time reseting and cannot be seen properly in Domoticz hardware page. When I am checking debug logs I do not see anything suspicious:

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 192.168.0.5
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    

    Logs from Domoticz:

    2017-01-05 21:01:18.665 Domoticz V3.5877 (c)2012-2016 GizMoCuz
    2017-01-05 21:01:18.666 Build Hash: 15b013c, Date: 2016-11-10 16:44:33
    2017-01-05 21:01:18.666 System: Raspberry Pi
    2017-01-05 21:01:18.667 Startup Path: /home/pi/domoticz/
    2017-01-05 21:01:18.744 WebServer(HTTP) started on address: :: with port XXXX (hide)
    2017-01-05 21:01:18.754 WebServer(SSL) started on address: :: with port XXXX (hide)
    2017-01-05 21:01:18.757 Proxymanager started.
    2017-01-05 21:01:18.760 TCPServer: shared server started...
    2017-01-05 21:01:18.761 RxQueue: queue worker started...
    2017-01-05 21:01:20.140 Incoming connection from: 192.168.0.1
    2017-01-05 21:01:20.763 EventSystem: reset all events...
    2017-01-05 21:01:20.764 EventSystem: reset all device statuses...
    2017-01-05 21:01:20.765 EventSystem: Started
    2017-01-05 21:01:21.762 MySensors: trying to connect to: 192.168.0.5:5005
    2017-01-05 21:01:22.763 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:01:31.765 MySensors: Connection reset!
    2017-01-05 21:01:31.765 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:02:01.769 TCP: Reconnecting...
    2017-01-05 21:02:02.769 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:02:11.771 MySensors: Connection reset!
    2017-01-05 21:02:11.771 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:02:41.775 TCP: Reconnecting...
    2017-01-05 21:02:42.776 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:02:51.777 MySensors: Connection reset!
    2017-01-05 21:02:51.777 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:03:21.781 TCP: Reconnecting...
    2017-01-05 21:03:22.782 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:03:31.783 MySensors: Connection reset!
    2017-01-05 21:03:31.784 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:03:53.281 Incoming connection from: 139.162.34.160
    2017-01-05 21:04:01.788 TCP: Reconnecting...
    2017-01-05 21:04:02.789 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:04:11.790 MySensors: Connection reset!
    2017-01-05 21:04:11.790 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:04:41.795 TCP: Reconnecting...
    2017-01-05 21:04:42.796 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:04:51.797 MySensors: Connection reset!
    2017-01-05 21:04:51.797 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:05:21.801 TCP: Reconnecting...
    2017-01-05 21:05:22.802 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:05:31.803 MySensors: Connection reset!
    2017-01-05 21:05:31.804 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:06:01.808 TCP: Reconnecting...
    2017-01-05 21:06:02.808 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:06:11.810 MySensors: Connection reset!
    2017-01-05 21:06:11.810 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:06:41.814 TCP: Reconnecting...
    2017-01-05 21:06:41.815 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:06:51.816 MySensors: Connection reset!
    2017-01-05 21:06:51.817 TCP: Reconnecting in 30 seconds...
    2017-01-05 21:07:21.820 TCP: Reconnecting...
    2017-01-05 21:07:22.821 MySensors: connected to: 192.168.0.5:5005
    2017-01-05 21:07:31.823 MySensors: Connection reset!
    2017-01-05 21:07:31.823 TCP: Reconnecting in 30 seconds...
    

    As you can see it keeps all the time reseting. When I see output in Domoticz "MySensors: Connection reset!" I can see Arduino Uno is being reseted at this time (from Serial Monitor output)

    I really tried to install beta 2.2.0 and also 2.0.0 from mysensors page on both stable and beta domoticz and still it is getting same error. Did anyone face any issue like this before?

    To add, W5100 is normally pingable from Raspberry:

    pi@raspberrypi ~/domoticz $ ping 192.168.0.5
    PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data.
    64 bytes from 192.168.0.5: icmp_seq=1 ttl=128 time=0.351 ms
    64 bytes from 192.168.0.5: icmp_seq=2 ttl=128 time=0.236 ms
    64 bytes from 192.168.0.5: icmp_seq=3 ttl=128 time=0.274 ms
    ^C
    --- 192.168.0.5 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 1998ms
    rtt min/avg/max/mdev = 0.236/0.287/0.351/0.047 ms
    

    Code for W5100 is default (just IP and port changed):

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     * Contribution by a-lurker and Anticimex,
     * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
     * Contribution by Tomas Hozza <thozza@gmail.com>
     *
     *
     * DESCRIPTION
     * The EthernetGateway sends data received from sensors to the ethernet link.
     * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
     *
     * The GW code is designed for Arduino 328p / 16MHz.  ATmega168 does not have enough memory to run this program.
     *
     * LED purposes:
     * - To use the feature, uncomment MY_DEFAULT_xxx_LED_PIN in the sketch below
     * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
     * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
     * - ERR (red) - fast blink on error during transmission error or recieve crc error
     *
     * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
     *
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    // Enable gateway ethernet module type
    #define MY_GATEWAY_W5100
    
    // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
    //#define MY_W5100_SPI_EN 4
    
    // Enable Soft SPI for NRF radio (note different radio wiring is required)
    // The W5100 ethernet module seems to have a hard time co-operate with
    // radio on the same spi bus.
    #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
    #define MY_SOFTSPI
    #define MY_SOFT_SPI_SCK_PIN 14
    #define MY_SOFT_SPI_MISO_PIN 16
    #define MY_SOFT_SPI_MOSI_PIN 15
    #endif
    
    // When W5100 is connected we have to move CE/CSN pins for NRF radio
    #ifndef MY_RF24_CE_PIN
    #define MY_RF24_CE_PIN 5
    #endif
    #ifndef MY_RF24_CS_PIN
    #define MY_RF24_CS_PIN 6
    #endif
    
    // Enable to UDP
    //#define MY_USE_UDP
    
    #define MY_IP_ADDRESS 192, 168, 0, 5   // If this is disabled, DHCP is used to retrieve address
    // Renewal period if using DHCP
    //#define MY_IP_RENEWAL_INTERVAL 60000
    // The port to keep open on node server mode / or port to contact in client mode
    #define MY_PORT 5005
    
    // 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
    
    // 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
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    //#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  // Transmit led pin
    
    
    #if defined(MY_USE_UDP)
    #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    
    
    void setup()
    {
    }
    
    void loop()
    {
    }
    

    Thank you in advance for help 🙂



  • @macieiks I got an identical Error last week after upgrading to Arduino 1.8.0. Solution is:
    https://forum.mysensors.org/topic/4680/mysensors-2-0-ethernet-gateway-atmega-w5100-restart-all-time/4

    simple: If you are running AVR board defs > 1.6.11, downgrade to 1.6.11 and the issue should be solved. (from @tekka).

    If someone is interested: same Error for ENC28J60 Ethernet module, resolved with downgrading board definitions to 1.6.11.



  • @tboha

    Hi, thank you for the update

    EDIT::
    Yes, I downgraded AVR boards to lower version and its working. Thanks ! you saved me tons of hours 😄



  • @macieiks
    for the sake of completeness - you do not have to downgrade your complete Arduino IDE, just "tweak" boards definitions. Board versions are not necessarily numbered according to Arduino version.

    0_1483650780654_boards1.PNG
    Sorry - I couldn´t get Enlish version at speed.
    I probably reads "Tools"->"Board"->"Boardmanager"

    0_1483650881796_board2.PNG

    I got 1.6.11 installed- so it is not available in drop down list.
    Choose your desired version, hit "Install", wait a fairly long time and you are done.



  • @tboha
    Yes I got it, Thank you very much for help! 🙂


Log in to reply
 

Suggested Topics

  • 3
  • 1
  • 2
  • 6
  • 6

55
Online

11.4k
Users

11.1k
Topics

112.7k
Posts