Node unable to find parent



  • I am trying to setup my first EasyPCB node and I am unable to get them online. Both Gateway and Node logs look OK to me other than the obvious failures. Gateway is configured in OpenHAB.

    Node battery sketch

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    #define MY_DEBUG_VERBOSE_RFM69
    
    // Enable and select radio type attached
    #define MY_RADIO_RFM69
    
    // Define this to enable the improved RFM69 driver
    #define MY_RFM69_NEW_DRIVER
    
    // The frequency to use.
    #define MY_RFM69_FREQUENCY RFM69_915MHZ
    
    // Define this if you are using the RFM69HW
    #define MY_IS_RFM69HW
    
    #include <MySensors.h>
    
    int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
    
    uint32_t SLEEP_TIME = 900000;  // sleep time between reads (seconds * 1000 milliseconds)
    int oldBatteryPcnt = 0;
    
    void setup()
    {
      // use the 1.1 V internal reference
    #if defined(__AVR_ATmega2560__)
      analogReference(INTERNAL1V1);
    #else
      analogReference(INTERNAL);
    #endif
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Battery Meter", "1.0");
    }
    
    void loop()
    {
      // get the battery Voltage
      int sensorValue = analogRead(BATTERY_SENSE_PIN);
    #ifdef MY_DEBUG
      Serial.println(sensorValue);
    #endif
    
      // 1M, 470K divider across battery and using internal ADC ref of 1.1V
      // Sense point is bypassed with 0.1 uF cap to reduce noise at that point
      // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
      // 3.44/1023 = Volts per bit = 0.003363075
    
      int batteryPcnt = sensorValue / 10;
    
    #ifdef MY_DEBUG
      float batteryV  = sensorValue * 0.003363075;
      Serial.print("Battery Voltage: ");
      Serial.print(batteryV);
      Serial.println(" V");
    
      Serial.print("Battery percent: ");
      Serial.print(batteryPcnt);
      Serial.println(" %");
    #endif
    
      if (oldBatteryPcnt != batteryPcnt) {
        // Power up radio after sleep
        sendBatteryLevel(batteryPcnt);
        oldBatteryPcnt = batteryPcnt;
      }
      sleep(SLEEP_TIME);
    }
    

    Node log

    18:55:26.204 ->  
    18:55:26.204 ->  __  __       ____
    18:55:26.204 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    18:55:26.204 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    18:55:26.204 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    18:55:26.204 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    18:55:26.204 ->         |___/                      2.3.1
    18:55:26.204 -> 
    18:55:26.204 -> 16 MCO:BGN:INIT NODE,CP=RPNNA---,REL=255,VER=2.3.1
    18:55:26.204 -> 28 TSM:INIT
    18:55:26.204 -> 28 TSF:WUR:MS=0
    18:55:26.204 -> 30 RFM69:INIT
    18:55:26.204 -> 32 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0
    18:55:26.204 -> 36 RFM69:PTX:LEVEL=5 dBm
    18:55:26.204 -> 38 TSM:INIT:TSP OK
    18:55:26.204 -> 40 TSM:FPAR
    18:55:26.204 -> 43 RFM69:SWR:SEND,TO=255,SEQ=0,RETRY=0
    18:55:26.204 -> 47 RFM69:CSMA:RSSI=-35
    ...
    18:55:26.378 -> 546 RFM69:CSMA:RSSI=-35
    18:55:26.378 -> 552 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    18:55:28.366 -> 2562 !TSM:FPAR:NO REPLY
    18:55:28.810 -> 2564 TSM:FPAR
    18:55:28.810 -> 2566 RFM69:SWR:SEND,TO=255,SEQ=1,RETRY=0
    18:55:28.810 -> 2570 RFM69:CSMA:RSSI=-36
    ...
    18:55:28.912 -> 3069 RFM69:CSMA:RSSI=-35
    18:55:28.912 -> 3076 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    18:55:30.906 -> 5085 !TSM:FPAR:NO REPLY
    18:55:30.906 -> 5087 TSM:FPAR
    18:55:31.317 -> 5089 RFM69:SWR:SEND,TO=255,SEQ=2,RETRY=0
    18:55:31.317 -> 5093 RFM69:CSMA:RSSI=-35
    18:55:31.317 -> 5097 RFM69:CSMA:RSSI=-35
    ...
    18:55:31.455 -> 5591 RFM69:CSMA:RSSI=-35
    18:55:31.455 -> 5597 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    18:55:33.439 -> 7606 !TSM:FPAR:NO REPLY
    18:55:33.439 -> 7608 TSM:FPAR
    18:55:33.439 -> 7610 RFM69:SWR:SEND,TO=255,SEQ=3,RETRY=0
    18:55:33.852 -> 7614 RFM69:CSMA:RSSI=-35
    ...
    18:55:33.988 -> 8112 RFM69:CSMA:RSSI=-35
    18:55:33.988 -> 8118 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    18:55:35.990 -> 10127 !TSM:FPAR:FAIL
    18:55:35.990 -> 10129 TSM:FAIL:CNT=1
    18:55:35.990 -> 10131 TSM:FAIL:DIS
    18:55:35.990 -> 10133 TSF:TDI:TSL
    18:55:35.990 -> 10135 RFM69:RSL
    18:55:46.444 -> 20140 TSM:FAIL:RE-INIT
    18:55:46.444 -> 20142 TSM:INIT
    18:55:46.444 -> 20144 RFM69:INIT
    18:55:46.444 -> 20146 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0
    18:55:46.444 -> 20150 RFM69:PTX:LEVEL=5 dBm
    18:55:46.444 -> 20152 TSM:INIT:TSP OK
    18:55:46.444 -> 20156 TSM:FPAR
    18:55:46.444 -> 20158 RFM69:SWR:SEND,TO=255,SEQ=0,RETRY=0
    

    Ethernet gateway sketch

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    #define MY_DEBUG_VERBOSE_RFM69
    
    // Enable and select radio type attached
    #define MY_RADIO_RFM69
    
    // Define this to enable the improved RFM69 driver
    #define MY_RFM69_NEW_DRIVER
    
    // The frequency to use.
    #define MY_RFM69_FREQUENCY RFM69_915MHZ
    
    // Define this if you are using the RFM69HW
    #define MY_IS_RFM69HW
    
    // RFM69 SPI chip select pin
    #define MY_RFM69_CS_PIN 6
    
    // Define this to override the default RFM69 IRQ pin assignment
    #define MY_RFM69_IRQ_PIN 2
    
    // RFM69 IRQ number
    #define MY_RFM69_IRQ_NUM 1
    
    // Enable gateway ethernet module type
    #define MY_GATEWAY_W5100
    
    // Enable UDP communication
    //#define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    #define MY_IP_ADDRESS 192,168,60,200
    
    // If using static ip you can define Gateway and Subnet address as well
    #define MY_IP_GATEWAY_ADDRESS 192,168,60,1
    #define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // 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, 60, 2
    
    // 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 Arduino examples use  "DEAD BEEF FEED" for the MAC address.
    #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
    
    #if defined(MY_USE_UDP)
    #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    
    void setup()
    {
      // Setup locally attached sensors
    }
    
    void presentation()
    {
      // Present locally attached sensors here
    }
    
    void loop()
    {
      // Send locally attached sensors data here
    }
    

    Gateway log

    1565 MCO:BGN:STP
    1565 MCO:BGN:INIT OK,TSP=1
    1566 TSM:READY:NWD REQ
    1566 RFM69:SWR:SEND,TO=255,SEQ=0,RETRY=0
    1568 RFM69:CSMA:RSSI=-102
    3569 TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    359508 GWT:TSA:ETH OK
    359512 GWT:RFC:MSG=0;0;3;0;2;
    359514 GWT:RFC:MSG=
    539523 GWT:RFC:MSG=0;0;3;0;2;
    539525 GWT:RFC:MSG=
    542523 GWT:RFC:MSG=0;255;3;0;18;
    542525 GWT:RFC:MSG=
    542724 GWT:RFC:MSG=1;255;3;0;18;
    542724 !TSF:RTE:1 UNKNOWN
    542725 RFM69:SWR:SEND,TO=1,SEQ=1,RETRY=0
    542726 RFM69:CSMA:RSSI=-103
    544927 !RFM69:SWR:NACK
    544927 RFM69:SWR:SEND,TO=1,SEQ=2,RETRY=1
    544929 RFM69:CSMA:RSSI=-107
    547129 !RFM69:SWR:NACK
    547129 RFM69:SWR:SEND,TO=1,SEQ=2,RETRY=2
    547131 RFM69:CSMA:RSSI=-102
    549331 !RFM69:SWR:NACK
    549331 RFM69:SWR:SEND,TO=1,SEQ=2,RETRY=3
    549334 RFM69:CSMA:RSSI=-100
    551534 !RFM69:SWR:NACK
    551534 RFM69:SWR:SEND,TO=1,SEQ=2,RETRY=4
    551536 RFM69:CSMA:RSSI=-99
    553736 !RFM69:SWR:NACK
    553736 RFM69:SWR:SEND,TO=1,SEQ=2,RETRY=5
    553738 RFM69:CSMA:RSSI=-102
    555938 !RFM69:SWR:NACK
    555938 !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=18,pt=0,l=0,sg=0,ft=0,st=NACK:
    555939 GWT:RFC:MSG=
    

    @sundberg84 Any thought? I'm using rev10.


  • Hardware Contributor

    @elcheekytico - hmm, I can not seems to parse your node log - but anyways, it seems like no reply is the major error code here so it seems like its an issue with the radio communication.

    How is your hardware setup. How do you power the node and gateway?
    How did you build the gateway? Is this one starting up correctly?
    I see you define alot of things in the gatewat sketch... seems a bit strange, but maybe thats right. Im not defining that much: https://github.com/sundberg84/HomeAutomation/blob/master/Sketches MySensors RFM69 radio/RFM69gw/Rfm69gw/Rfm69gw.ino

    #define MY_RFM69_CS_PIN 6
    

    I dont think EasyPCB RFM Edition is wired to D6 - do you use this for the gateway or only the node?



  • @ElCheekytico
    I cannot find that you set your NODE_ID in the beginning of the sensor sketch.
    Since OpenHAB does not hand out node-id as far as I know (I do not use the MySensors binding in OpenHAB since I connect over mqtt) you have to set NODE_ID manually.

    Note: The GW does not assign node id either.

    In your sensor sketch, start by adding

    #define MY_NODE_ID   5
    

    for example and see if you are able to connect.



  • @sundberg84 said in Node unable to find parent:

    @elcheekytico - hmm, I can not seems to parse your node log - but anyways, it seems like no reply is the major error code here so it seems like its an issue with the radio communication.

    How is your hardware setup. How do you power the node and gateway?
    How did you build the gateway? Is this one starting up correctly?
    I see you define alot of things in the gatewat sketch... seems a bit strange, but maybe thats right. Im not defining that much: https://github.com/sundberg84/HomeAutomation/blob/master/Sketches MySensors RFM69 radio/RFM69gw/Rfm69gw/Rfm69gw.ino

    #define MY_RFM69_CS_PIN 6
    

    I dont think EasyPCB RFM Edition is wired to D6 - do you use this for the gateway or only the node?

    @sundberg84 The node, Pro Mini 3.3v, is powered by battery, but i guess still by USB while debugging. The gateway has been powered by USB while debugging and a known good power supply. The gateway is Leonardo with Ethernet shield. The gateway is the only one with RFM pin defines

    @bgunnarb said in Node unable to find parent:

    @ElCheekytico
    I cannot find that you set your NODE_ID in the beginning of the sensor sketch.
    Since OpenHAB does not hand out node-id as far as I know (I do not use the MySensors binding in OpenHAB since I connect over mqtt) you have to set NODE_ID manually.

    Note: The GW does not assign node id either.

    In your sensor sketch, start by adding

    #define MY_NODE_ID   5
    

    for example and see if you are able to connect.

    @bgunnarb I had a test setup with ESP8266 as gateway and node before and didn't remember specifying a node ID as I though OpenHAB would handle it. I found some documentation that said otherwise. That being said, I adding a node id, but still no luck.



  • Ok, Really dumb, I had MY_RFM69_IRQ_PIN connected to the radio's RESET instead of DI00. I was grasping at straws and went to re-do my antenna because they were about 3mm too short when I noticed the mis-wiring. Once I fixed that swapped 3.3v and Ground and troubleshot that for a minute before I realized it. Before trying to fix the antenna I thought maybe since I didn't have a sensor defined the battery level data wasn't enough.The node is now talking to the controller with the MockMySensors sketch.

    Thanks for your help guys.



  • @bgunnarb said in Node unable to find parent:

    @ElCheekytico
    I cannot find that you set your NODE_ID in the beginning of the sensor sketch.
    Since OpenHAB does not hand out node-id as far as I know (I do not use the MySensors binding in OpenHAB since I connect over mqtt) you have to set NODE_ID manually.

    Note: The GW does not assign node id either.

    In your sensor sketch, start by adding

    #define MY_NODE_ID   5
    

    for example and see if you are able to connect.

    @bgunnarb I found that OpenHAB does assign node ID's even though the controller feature table somewhere on this site says it does not.



  • @elcheekytico said in Node unable to find parent:

    Ok, Really dumb, I had MY_RFM69_IRQ_PIN connected to the radio's RESET instead of DI00. I was grasping at straws and went to re-do my antenna because they were about 3mm too short when I noticed the mis-wiring. Once I fixed that swapped 3.3v and Ground and troubleshot that for a minute before I realized it. Before trying to fix the antenna I thought maybe since I didn't have a sensor defined the battery level data wasn't enough.The node is now talking to the controller with the MockMySensors sketch.

    Thanks for your help guys.

    I cleared eeprom and went back to my battery sketch and all is well.


Log in to reply
 

Suggested Topics

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts