Node without radio



  • HI, I'd like to prepare node on mega+ethShield5100 without radio. Arduino 1.6.9; mysensor 2.1.1.
    So I commented in the sketch line #define MY_RADIO_NRF24.
    At the moment system startup with IP, but halted o the:
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
    After that system restart startup procedure.
    What I should change?


  • Mod

    @Gumers that depends on what you have 😉 Did you use the ethernet gateway sketch? or something else?

    What typ of sensor do you want to create?

    Could you post the entire log?



  • I try to prepare GW sketch for node with relays.
    I'v got problems with NRF (a lot of transmission problems) but I can use LAN for communications.
    All log from node:
    0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
    0;255;3;0;9;MCO:BGN:BFR
    IP: 192.168.0.172
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
    0;255;3;0;9;MCO:BGN:BFR
    IP: 192.168.0.172
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA

    IMHO it's a problem with initialize radio and sketch halted before Presentation procedure.
    But why?


  • Mod

    @Gumers could you post your presentation function?



  • Sure
    Part of relay code, same I use now with NRF:

    
    #define RELAY_1  22 
    #define NUMBER_OF_RELAYS 8 // Total number of attached relays
    #define RELAY_ON 1  // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0// GPIO value to write to turn off attached relay
    
    void before()
    {
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
        // Then set relay pins in output mode
        pinMode(pin, OUTPUT);
        digitalWrite(pin, RELAY_OFF);
        // Set relay to last known state (using eeprom storage)
        //digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
      }
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Mega_eth", "1.0");
    
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
        // Register all sensors to gw (they will be created as child devices)
        present(sensor, S_BINARY);
      }
    }```

  • Mod

    @Gumers looks like the node resets itself, so we'll need to figure out why/when.
    If you comment out the pinMode and digitalWrite statements, does it still reset?
    Could you add a serial print at end of before() and at start of presentation, to check if the code reaches those lines?
    Do you have a setup function? If so, could you post it?
    How is the mega powered?


  • Mod

    Could be a similar problem as in https://forum.mysensors.org/post/72423 - maybe check your Arduino AVR board version?



  • This node is controled by Domoticz. I saw this hardware in controler without presentation name and childrens. When I turnoff this hardware in Domoticz, node doesen' reset. Log in Domo with hardware up:
    2017-08-19 23:38:37.109 TCP: Reconnecting...
    2017-08-19 23:38:38.109 MySensors: connected to: 192.168.0.172:5003
    2017-08-19 23:38:46.940 (ethGet1) Humidity (SOL 2 Hum)
    2017-08-19 23:38:47.037 (ethGet1) General/Voltage (SOL 2 Vcc )
    2017-08-19 23:38:47.110 MySensors: Connection reset!
    2017-08-19 23:38:47.110 TCP: Reconnecting in 30 seconds...
    2017-08-19 23:38:54.939 (ethGet1) Temp (STA Temp)

    IMHO connection reset concerning presentation problem.
    But still I don't understand why node doesn't present name and relay childs in Domo.
    Version of motherboard 1.6.19. powered by ac adapter.
    At the end of before() serial printed text to debuger - befor() is ok.
    I commented all lines. Save only presentation sketch name.
    Setup and loop are empty.
    Still the same. I'm going creazy...
    All of source:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // 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
    
    // 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_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEE, 0xEE, 0xED // zarezerwowane na 192.168.0.172
    
    // 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
    
    
    #include <Ethernet.h>
    #include <MySensors.h>
    #include <SPI.h>
    
    
    
    #define RELAY_1  22 
    #define NUMBER_OF_RELAYS 8 // Total number of attached relays
    #define RELAY_ON 1  // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0// GPIO value to write to turn off attached relay
    /*
    void before()
    {
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
        // Then set relay pins in output mode
        pinMode(pin, OUTPUT);
        digitalWrite(pin, RELAY_OFF);
        // Set relay to last known state (using eeprom storage)
        //digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
      }
    }
    */
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Mega_eth", "1.0");
    
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
        // Register all sensors to gw (they will be created as child devices)
        present(sensor, S_BINARY);
      }
    }
    
    void setup()
    {
    }
    
    void loop()
    {
    }```

  • Mod

    @Gumers 1.6.19 is the same version as in the thread I linked. Downgrading seems to solve the problem for people.



  • OMG, thats it.
    Downgrade to 1.6.11 solved problem.
    Thanks for your time. Y'r great!


 

287
Online

7.5k
Users

8.4k
Topics

90.4k
Posts