Sensor node can't find gateway



  • Hello,

    I'm trying to setup a mysensors serial gateway following the instructions. The only modifications for both (gateway and node) I added '#define MY_RF24_PA_LEVEL RF24_PA_LOW'
    Gateway is on Arduino Uno (chinese clone) on COM7
    Node is on Arduino Uno (official version) on COM5
    Distance between the 2 in debug : 0.5m. I also tried 3m between when the gateway was connected to RPI3+ (with domoticz)

    I already tried adding a capacitor on the NRF24L01+ (chinese clones)
    Didn't find any marks which is pin 1, but supposed that these are the same
    Connnected to the 3.3V of the Arduino Uno (on both)
    I don't know what capabilities difference (marked bold) in the log means, maybe hint to problem.
    Below snippets from the IDE-monitor
    Gateway:
    0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RNNGA---,VER=2.3.0
    0;255;3;0;9;4 TSM:INIT
    0;255;3;0;9;6 TSF:WUR:MS=0
    0;255;3;0;9;14 TSM:INIT:TSP OK
    0;255;3;0;9;17 TSM:INIT:GW MODE
    0;255;3;0;9;20 TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;23 MCO:REG:NOT NEEDED
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.3.0
    0;255;3;0;9;28 MCO:BGN:STP
    0;255;3;0;9;34 MCO:BGN:INIT OK,TSP=1

    Node:
    ASCII-art MySensors

    16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
    25 TSM:INIT
    26 TSF:WUR:MS=0
    33 TSM:INIT:TSP OK
    35 TSM:FPAR
    1635 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3643 !TSM:FPAR:NO REPLY
    3645 TSM:FPAR
    5244 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    7254 !TSM:FPAR:NO REPLY
    7256 TSM:FPAR
    8855 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    10863 !TSM:FPAR:NO REPLY
    10865 TSM:FPAR
    12465 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    14473 !TSM:FPAR:FAIL
    14474 TSM:FAIL:CNT=1
    14476 TSM:FAIL:DIS
    14478 TSF:TDI:TSL
    24481 TSM:FAIL:RE-INIT


  • Mod

    You forgot the MY_NODE_ID in the node sketch



  • I added the value MY_NODE_ID but did not change anything in the communication.

    While searching how debug further I stumble upon this article.
    https://forum.mysensors.org/topic/878/no-debug-data-from-sensors-or-gateway-bad-radios
    I looked up my order @ wish : https://www.wish.com/product/56c3769856871e13cc67d9b5

    My radios are NRF24L01 not NRF24L01+
    Are these also useable or not?


  • Mod

    If you see

    1635 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:

    It is broadcasting searching for gateway to assign an ID.

    Can you post your sketch?



  • Except the node-id (1) , nothing changed in the logfile
    16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0
    25 TSM:INIT
    26 TSF:WUR:MS=0
    33 TSM:INIT:TSP OK
    35 TSM:INIT:STATID=1
    37 TSF:SID:OK,ID=1
    39 TSM:FPAR
    1639 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3646 !TSM:FPAR:NO REPLY
    3648 TSM:FPAR
    5248 TSF:MSG:SEND**,1-1**-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    7255 !TSM:FPAR:NO REPLY
    7257 TSM:FPAR
    8856 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    10863 !TSM:FPAR:NO REPLY
    10865 TSM:FPAR
    12465 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    14473 !TSM:FPAR:FAIL
    14474 TSM:FAIL:CNT=1
    14476 TSM:FAIL:DIS
    14478 TSF:TDI:TSL
    24481 TSM:FAIL:RE-INIT

    This is my 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.

    // Enable debug prints
    #define MY_DEBUG

    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    #define MY_RF24_PA_LEVEL RF24_PA_LOW
    #define MY_RF24_DATARATE RF24_1MBPS
    //#define MY_RADIO_RFM69

    #define MY_NODE_ID 1

    #include <SPI.h>
    #include <MySensors.h>
    #include <NewPing.h>

    #define CHILD_ID 1
    #define TRIGGER_PIN 6 // Arduino pin tied to trigger pin on the ultrasonic sensor.
    #define ECHO_PIN 5 // Arduino pin tied to echo pin on the ultrasonic sensor.
    #define MAX_DISTANCE 300 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
    unsigned long SLEEP_TIME = 5000; // Sleep time between reads (in milliseconds)

    NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
    MyMessage msg(CHILD_ID, V_DISTANCE);
    int lastDist;
    bool metric = true;

    void setup()
    {
    metric = getControllerConfig().isMetric;
    }

    void presentation() {
    // Send the sketch version information to the gateway and Controller
    sendSketchInfo("Distance Sensor", "1.0");

    // Register all sensors to gw (they will be created as child devices)
    present(CHILD_ID, S_DISTANCE);
    }

    void loop()
    {
    int dist = metric?sonar.ping_cm():sonar.ping_in();
    Serial.print("Ping: ");
    Serial.print(dist); // Convert ping time to distance in cm and print result (0 = outside set distance range)
    Serial.println(metric?" cm":" in");

    if (dist != lastDist) {
    send(msg.set(dist));
    lastDist = dist;
    }

    sleep(SLEEP_TIME);
    }



  • All solved with the correct modules. NRF24L01+ instead of NRF24L01


Log in to reply
 

Suggested Topics

  • 3
  • 5
  • 2
  • 8
  • 6
  • 1

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts