!MCO:SND:NODE NOT REG - what does it mean? [solved]



  • Hi,

    I understand the the subject means "Node is not registered, cannot send message" , but I do not understand why? This is a rfm69 node running 2.2.0 beta. The subj appears in the log many times and the GW cannot see the node. Do I have to change some default settings? I have now used a new rfm69 driver.

    Thanks
    Alex

    PS I must also add that the GW is running a stable 2.1.1


  • Mod

    @alexsh1 the debug messages before the error message are likely to give some clues

    If you want to look at the code, the message is printed here: https://github.com/mysensors/MySensors/blob/28c4f3f19e7026f56fd9bbc61d566f770fd7a9d2/core/MySensorsCore.cpp#L312



  • @mfalkvidd Thanks, but it does not give me any clues for now. I cannot get 2.1.1 GW to see 2.2.0 beta node unfortunately.


  • Mod

    @alexsh1 if you posted the debug messages someone might be able to help.



  • @mfalkvidd I had to revert to 2.1.1 on this node as it has an important PIR use. I have setup a new node (Moteino Mega with rfm69hcw), uploaded the test sketch and this is the log:

    0 MCO:BGN:INIT NODE,CP=RRNNA---,VER=2.2.0-beta
    4 TSM:INIT
    5 TSF:WUR:MS=0
    7 TSM:INIT:TSP OK
    8 TSM:INIT:STATID=6
    10 TSF:SID:OK,ID=6
    12 TSM:FPAR
    1231 TSF:MSG:SEND,6-6-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    1888 TSF:MSG:READ,0-0-6,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    1892 TSF:MSG:FPAR OK,ID=0,D=1
    3239 TSM:FPAR:OK
    3240 TSM:ID
    3241 TSM:ID:OK
    3244 TSM:UPL
    3251 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    3272 TSF:MSG:READ,0-0-6,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    3277 TSF:MSG:PONG RECV,HP=1
    3279 TSM:UPL:OK
    3281 TSM:READY:ID=6,PAR=0,DIS=1
    3291 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    3332 TSF:MSG:READ,0-0-6,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    3549 TSF:MSG:SEND,6-6-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.2.0-beta
    3562 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    3584 TSF:MSG:READ,0-0-6,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    3805 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=11,pt=0,l=21,sg=0,ft=0,st=OK:AIQ Sensor CO2 MH-Z14
    3819 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    3832 TSF:MSG:SEND,6-6-0-0,s=0,c=0,t=22,pt=0,l=0,sg=0,ft=0,st=OK:
    3838 !MCO:SND:NODE NOT REG
    3841 MCO:REG:REQ
    3849 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    3867 TSF:MSG:READ,0-0-6,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    3872 MCO:PIM:NODE REG=1
    3874 MCO:BGN:STP
    4376 MCO:BGN:INIT OK,TSP=1
    5070 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    5075 TSF:TDI:TSL
    

    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.
    
     *******************************
    
       DESCRIPTION
    
        MH-Z14 CO2 sensor
    
        Wiring:
         Pad 1, Pad 5: Vin (Voltage input 4.5V-6V)
         Pad 2, Pad 3, Pad 12: GND
         Pad 6: PWM output ==> pin 6
    
     	From: http://davidegironi.blogspot.fr/2014/01/co2-meter-using-ndir-infrared-mh-z14.html
      	  MH-Z14 has a PWM output, with a sensitivity range of 0ppm to 2000ppm CO2, an accurancy of ±200ppm.
      	  The cycle is 1004ms±5%, given the duty cicle Th (pulse high), Tl is 1004-Th, we can convert it to CO2 value using the formula:
     	  CO2ppm = 2000 * (Th - 2ms) /(Th + Tl - 4ms)
      	From: http://airqualityegg.wikispaces.com/Sensor+Tests
     	  - response time is less than 30 s
         - 3 minute warm up time
     	datasheet: http://www.futurlec.com/Datasheet/Sensor/MH-Z14.pdf
       Contributor: epierre
    */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    //#define MY_RADIO_NRF24
    #define MY_RADIO_RFM69
    #define MY_IS_RFM69HW
    #define MY_NODE_ID 6
    //#define MY_PARENT_NODE_ID 0
    #define MY_RFM69_FREQUENCY  RFM69_868MHZ
    
    
    #include <MySensors.h>
    
    #define CHILD_ID_AIQ 0
    #define AIQ_SENSOR_ANALOG_PIN 6
    
    unsigned long SLEEP_TIME = 30 * 1000; // Sleep time between reads (in milliseconds)
    
    float valAIQ = 0.0;
    float lastAIQ = 0.0;
    
    MyMessage msg(CHILD_ID_AIQ, V_LEVEL);
    MyMessage msg2(CHILD_ID_AIQ, V_UNIT_PREFIX);
    
    void setup()
    {
      pinMode(AIQ_SENSOR_ANALOG_PIN, INPUT);
      pinMode(15, OUTPUT);
      pinMode(15, HIGH);
      delay(500);
      pinMode(15, LOW);
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("AIQ Sensor CO2 MH-Z14", "1.0");
    
      // Register all sensors to gateway (they will be created as child devices)
      present(CHILD_ID_AIQ, S_AIR_QUALITY);
      send(msg2.set("ppm"));
    }
    
    void loop()
    {
    
      //unsigned long duration = pulseIn(AIQ_SENSOR_ANALOG_PIN, HIGH);
      while (digitalRead(AIQ_SENSOR_ANALOG_PIN) == HIGH) {
        ;
      }
      //wait for the pin to go HIGH and measure HIGH time
      unsigned long duration = pulseIn(AIQ_SENSOR_ANALOG_PIN, HIGH);
    
      //Serial.print(duration/1000); Serial.println(" ms ");
      //from datasheet
      //CO2 ppm = 2000 * (Th - 2ms) / (Th + Tl - 4ms)
      //  given Tl + Th = 1004
      //        Tl = 1004 - Th
      //        = 2000 * (Th - 2ms) / (Th + 1004 - Th -4ms)
      //        = 2000 * (Th - 2ms) / 1000 = 2 * (Th - 2ms)
      long co2ppm = 2 * ((duration / 1000) - 2);
      //Serial.print(co2ppm);
      if ((co2ppm != lastAIQ) && (abs(co2ppm - lastAIQ) >= 10)) {
        send(msg.set((long)ceil(co2ppm)));
        lastAIQ = ceil(co2ppm);
      }
    
      //Serial.println();
    
      // Power down the radio.  Note that the radio will get powered back up
      // on the next write() call.
      sleep(SLEEP_TIME); //sleep for: sleepTime
    }
    

    The node is running latest 2.2.0 beta
    The GW is running 2.1.1 Stable.
    They do communicate though I still see "MCO:SND:NODE NOT REG"

    The other node had rfm69w and was throwing many "MCO:SND:NODE NOT REG"



  • Ok, sorted. For some reason my PIR sketch did not work on atmega328p. Perhaps, this is due to its size (99% of memory). The same sketch worked fine on Moteino Mega. Unfortunately, I had to get rid of signing 😠 to make sure the sketch goes down in size.


  • Contest Winner

    @alexsh1 drop debug when you are done hacking and it might fit again



  • @Anticimex will do! I discovered that atmega328p does not like it when the sketch is 99%. The node was throwing strange error messages. Additionally, without debug, I cannot say if everything is working fine.


  • Contest Winner

    @alexsh1 if you talk about ram usage, no. Then you have no space for the stack.
    Regarding the ability to determine if things are working or not, it is no problem. You do the code you need to and make sure it works. Then you enable signing. And if messages still arrive it works. Simple as that. Signing on one node is no different from signing on another.



  • @Anticimex on a few nodes I cannot enable signing as even with debug disable, it still does not fit within 32kb memory. I have dualoptiboot, which means memory is 1.5kb less that using optiboot. Optiboot is not good for OTA. This is the situation either ... or
    This is why I'm increasing often looking at Moteino Mega or ARM M0.

    The other thing is that I can avoid using libraries and re-write the code impreling functions which I only use in the code. This is a very tedious process and the code has to be changed from node to node as some parts of a library is missing.

    Life is just not perfect 😞


Log in to reply
 

Suggested Topics

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts