[solved] new controller with ethernet Gateway on UI7 - unable to enter inclusion mode



  • After moving all my devices from my Vera light UI5 to a Vera Plus with UI7 today I flashed my controller that was working fine on ui5 with the latest mysensors software 2.1.
    I created a MySensor plugin device but seem to be unable to enter inclusion mode. A simple light level node is not included.
    Could you please advise me as to how I could get this going again?
    This is in the log

    ![0_1492806723766_upload-ef244203-7a28-411a-8d39-fb7e4892dea8](/assets/uploads/files/1492806697033-upload-ef244203-7a28-411a-8d39-fb7e4892dea8-resized.png) Insert Code Here
    ```JobHandler_LuaUPnP::HandleActionRequest device: 202 service: urn:upnp-arduino-cc:serviceId:arduino1 action: StartInclusion <0x7057a520>
    JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=202 <0x7057a520>
    JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-arduino-cc:serviceId:arduino1 <0x7057a520>
    JobHandler_LuaUPnP::HandleActionRequest argument action=StartInclusion <0x7057a520>
    luup_log:202: Arduino: Sending: 0;0;3;0;5;1 <0x77270320>
    <Job ID="19" Name="" Device="202" Created="2017-04-21 22:18:22" Started="2017-04-21 22:18:22" Completed="2017-04-21 22:18:22" Duration="0.1657000" Runtime="0.1329000" Status="Successful" LastNote=""/> <0x77270320>
    IOPort::Run RecvFailed 131 close 23 <0x6fff7520>
    

    Edit:
    I built a completely new gw module (uno with 5100 shield) with a diferent IP address and mac address.
    Changed ip settings in the vera plugin.
    reloaded luup engine.
    No errors in lua startup, but still the same problem with inclusion mode.

    I then did some testing on the gw side.
    The debug output from gw seems to be fine:

    output on startup of the gw:

    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.2.155
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    
    

    output when I start inclusion mode from vera ui

    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.2.155
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    

    output when I stop inclusion from vera ui

    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.2.155
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    

    so vera IS communicating with the gw.

    this is the output after starting inclusion mode from vera gui and powering up a new node (measuring light level).

    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=1
    0;255;3;0;9;TSF:CKU:OK,FCTRL
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;!TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    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.2.155
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    

    So the light level node is also talking to the gw.
    I assume the problem is on the vera/ plugin side.
    The mysensors plugin device on Vera UI7 shows only the plugin version, the line for lib is empty.

    0_1492945271550_mysensors_plugin_ui7.PNG

    Any pointers are highly appreciated!


  • Admin

    Did you enable the inclusion mode feature in the gateway sketch?



  • I think it is enabled by default.

    This is how I compiled it

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

    So only inclusion by button press on the gw is disabled?



  • I realized there is a new version 2.1.1, I had used 2.1.0
    I flashed both gw and sensor node with the new version.
    Now on vera gui in the Mysensor plugin both plugin version and lib version are shown correctly.
    Debug output from gw shows communication to the node is ok.
    Still, no inclusion mode.


  • Admin

    Sorry I can't help you more. I still run UI5 on my Vera... making the upgrade with all other plugin dependencies is just too fragile (without risking distress in the family) 😉



  • Na, I would't mess with my system either 😊
    I had mysensors running nicely on ui5, too.
    That changed when Vera Plus moved in.;-)
    Tried building a pi gw, but face the problem. No chance to enter inclusion mode.


  • Hero Member

    @pls90 I have a few Ethernet GWs working on UI7 so I think it should work also for you.

    Maybe you could try rebooting your Vera, then after that also do a few Lua Engine restarts and then finally you do a Ctrl + F5 to get a browser refresh.

    Then try the inclusion again.

    Maybe you could also post your complete GW sketch so I can compare with some of the once I'm using.
    Please also check your Arduino IDE version and AVR Boards Version.



  • @korttoma Thank you for taking your time to have a look.
    I did as you suggested abd did the vera dance (vera reboot, reload luup engine, clear browser cache) to no avail.
    Here's my gw sketch (should be nearly unchanged from the template)

    
    // 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,2,155   // 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 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  0xFE, 0xED, 0xDE, 0xAD, 0xBE, 0xEF
    
    // 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()
    {
    }
    

    Which lib version are you currently using?



  • I did some more testing.
    I downloaded lib version 1.5 and flashed the gateway and sensor node again.
    Inclusion worked right away, but it took me numerous attempts to get the sensor node to include. After it did that communication between the node and gw broke down a couple of times (I am look at the debug output of sensor and gw). The sensor should report temp and lux level, which it has not done so far.
    On 2.1.1 communication seemed to be solid.
    Now I a stuck between 2.1.1 which will not allow inclusion of nodes but has good communication, and 1.5 which created the devices but doesn't update them because of comm issues.
    Sigh.


  • Hero Member

    On the SensebenderGW I have used 2.1.1 (Arduino IDE 1.6.11, AVR board 1.6.11)
    On one ESP8266RFM69 GW I have also 2.1.1 (Arduino IDE 1.6.11, AVR board 1.6.11)
    On another NRF24 Ethernet GW I have used 2.0.0 (Don't remember IDE/AVR version)
    On an RFM69 Ethernet GW I have used 2.1.0 (Don't remember IDE/AVR version)

    All of them are currently in use and working with different sketches of course.

    Sensebender GW sketch:

    /**
     * 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,1,100   // 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 5003
    
    #define MY_GATEWAY_MAX_CLIENTS 3
    
    // 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, 0xFE
    
    // 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()
    {
    }
    

    Please check your IDE and AVR versions.



  • As you confirmed you had your gw / sensors running on 2.x I gave it another try and started from scratch, and wiped the eeproms on both my gw and node.
    New Install of Arduino IDE, new MySensors Library install. I used the ethernet gw sketch example and a temperature sensor node sketch.
    This time it worked, I was able to finally include the sensor, what I can tell from the debug output communication seems to be working flawless.
    Even when cutting power from gw or sensor and powering up again communication is recovering.
    Now I will work on adapting my old sensor node sketch on lib 1.4 to new 2.1 requirements.
    Thank you so much for taking the time to help me get this going 😃


Log in to reply
 

Suggested Topics

  • 6
  • 3
  • 2
  • 5
  • 10

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts