[SOLVED] rfm69-node <-> rpi 4 gateway: !TSM:FPAR:NO REPLY



  • Hi,

    I am trying to build my first node using an easypcb, an arduino pro mini 3,3v and an rfm69w.

    Onto the pcb I soldered:

    • rfm69

    • arduino pro mini 3,3v

    • antenna

    • door sensor on D3

    • screw terminal.

    This is the 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
     *
     * Simple binary switch example 
     * Connect button or door/window reed switch between 
     * digitial I/O pin 3 (BUTTON_PIN below) and GND.
     * http://www.mysensors.org/build/binary
     */
    
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    #define MY_DEBUG_VERBOSE_RFM69
    // General settings
    #define SKETCH_NAME "Briefkasten"
    #define SKETCH_VERSION "1.0"
    #define MY_NODE_ID 1
    #define MY_RFM69_NEW_DRIVER
    
    // Enable and select radio type attached
    //#define MY_RADIO_RF24
    #define MY_RADIO_RFM69
    
    #include <MySensors.h>
    #include <Bounce2.h>
    
    #define CHILD_ID 3
    #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
    
    Bounce debouncer = Bounce(); 
    int oldValue=-1;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(CHILD_ID,V_TRIPPED);
    
    
    
    void setup()  
    {  
      // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
    
      // After setting up the button, setup debouncer
      debouncer.attach(BUTTON_PIN);
      debouncer.interval(5);
    
    }
    
    void presentation() {
      // Register binary input sensor to gw (they will be created as child devices)
      // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
      // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
      present(CHILD_ID, S_DOOR);  
    }
    
    
    //  Check if digital input has changed and send in new value
    void loop() 
    {
      debouncer.update();
      // Get the update value
      int value = debouncer.read();
    
      if (value != oldValue) {
         // Send in the new value
         send(msg.set(value==HIGH ? 1 : 0));
         oldValue = value;
      }
    }
    

    The gateway on the raspberry pi 4 was configured like this:

    ./configure --my-transport=rfm69 --my-rfm69-frequency=868 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mysensorsgateway1 --my-mqtt-user=mysensors --my-mqtt-password=secretpw --my-port=1883
    

    This is the gateway-log:

    pi@raspberrypi:~/MySensors/bin $ sudo ./mysgw 
    Jan 04 20:12:33 INFO  Starting gateway...
    Jan 04 20:12:33 INFO  Protocol version - 2.3.2-beta
    Jan 04 20:12:33 DEBUG MCO:BGN:INIT GW,CP=RPNGL---,FQ=NA,REL=8,VER=2.3.2-beta
    Jan 04 20:12:33 DEBUG TSF:LRT:OK
    Jan 04 20:12:33 DEBUG TSM:INIT
    Jan 04 20:12:33 DEBUG TSF:WUR:MS=0
    Jan 04 20:12:33 DEBUG TSM:INIT:TSP OK
    Jan 04 20:12:33 DEBUG TSM:INIT:GW MODE
    Jan 04 20:12:33 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Jan 04 20:12:33 DEBUG MCO:REG:NOT NEEDED
    Jan 04 20:12:33 DEBUG MCO:BGN:STP
    Jan 04 20:12:33 DEBUG MCO:BGN:INIT OK,TSP=1
    Jan 04 20:12:33 DEBUG GWT:RMQ:CONNECTING...
    Jan 04 20:12:33 DEBUG connected to 127.0.0.1
    Jan 04 20:12:33 DEBUG GWT:RMQ:OK
    Jan 04 20:12:33 DEBUG GWT:TPS:TOPIC=mysensors-out/0/255/0/0/18,MSG SENT
    Jan 04 20:12:33 DEBUG TSM:READY:NWD REQ
    Jan 04 20:12:33 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    Jan 04 20:27:33 DEBUG TSF:SAN:OK
    

    And this is the node-log:

    21:31:23.866 ->  
    21:31:23.866 ->  __  __       ____
    21:31:23.866 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    21:31:23.866 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    21:31:23.866 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    21:31:23.866 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    21:31:23.866 ->         |___/                      2.3.2
    21:31:23.866 -> 
    21:31:23.866 -> 16 MCO:BGN:INIT NODE,CP=RPNNA---,FQ=8,REL=255,VER=2.3.2
    21:31:23.866 -> 28 TSM:INIT
    21:31:23.866 -> 28 TSF:WUR:MS=0
    21:31:23.866 -> 30 RFM69:INIT
    21:31:23.866 -> 32 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0
    21:31:23.866 -> 36 RFM69:PTX:LEVEL=5 dBm
    21:31:23.866 -> 38 TSM:INIT:TSP OK
    21:31:23.866 -> 40 TSM:INIT:STATID=1
    21:31:23.866 -> 43 TSF:SID:OK,ID=1
    21:31:23.866 -> 45 TSM:FPAR
    21:31:23.899 -> 47 RFM69:SWR:SEND,TO=255,SEQ=0,RETRY=0
    21:31:23.899 -> 53 RFM69:CSMA:RSSI=-106
    21:31:23.899 -> 57 ?TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    21:31:25.888 -> 2066 !TSM:FPAR:NO REPLY
    21:31:25.888 -> 2068 TSM:FPAR
    21:31:25.888 -> 2070 RFM69:SWR:SEND,TO=255,SEQ=1,RETRY=0
    21:31:25.921 -> 2074 RFM69:CSMA:RSSI=-107
    21:31:25.921 -> 2080 ?TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    21:31:27.910 -> 4089 !TSM:FPAR:NO REPLY
    21:31:27.910 -> 4091 TSM:FPAR
    21:31:27.944 -> 4093 RFM69:SWR:SEND,TO=255,SEQ=2,RETRY=0
    21:31:27.944 -> 4098 RFM69:CSMA:RSSI=-105
    21:31:27.944 -> 4104 ?TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    21:31:29.933 -> 6113 !TSM:FPAR:NO REPLY
    21:31:29.933 -> 6115 TSM:FPAR
    21:31:29.966 -> 6117 RFM69:SWR:SEND,TO=255,SEQ=3,RETRY=0
    21:31:29.966 -> 6121 RFM69:CSMA:RSSI=-106
    21:31:29.966 -> 6127 ?TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    21:31:31.955 -> 8136 !TSM:FPAR:FAIL
    21:31:31.955 -> 8138 TSM:FAIL:CNT=1
    21:31:31.955 -> 8140 TSM:FAIL:DIS
    21:31:31.955 -> 8142 TSF:TDI:TSL
    21:31:31.955 -> 8142 RFM69:RSL
    21:31:41.968 -> 18145 TSM:FAIL:RE-INIT
    21:31:41.968 -> 18147 TSM:INIT
    21:31:41.968 -> 18149 RFM69:INIT
    21:31:42.001 -> 18151 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0
    21:31:42.001 -> 18155 RFM69:PTX:LEVEL=5 dBm
    21:31:42.001 -> 18157 TSM:INIT:TSP OK
    21:31:42.001 -> 18161 TSM:INIT:STATID=1
    21:31:42.001 -> 18163 TSF:SID:OK,ID=1
    21:31:42.001 -> 18165 TSM:FPAR
    21:31:42.001 -> 18167 RFM69:SWR:SEND,TO=255,SEQ=0,RETRY=0
    21:31:42.001 -> 18173 RFM69:CSMA:RSSI=-108
    21:31:42.001 -> 18180 ?TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    21:31:44.023 -> 20187 !TSM:FPAR:NO REPLY
    21:31:44.023 -> 20189 TSM:FPAR
    21:31:44.023 -> 20191 RFM69:SWR:SEND,TO=255,SEQ=1,RETRY=0
    21:31:44.056 -> 20195 RFM69:CSMA:RSSI=-104
    21:31:44.056 -> 20201 ?TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    21:31:46.045 -> 22210 !TSM:FPAR:NO REPLY
    

    Does anybody know what I am doing wrong?



  • I tried compiling the gateway as an ethernet gateway and suddenly got this output:

    pi@raspberrypi:~/MySensorsDev/MySensors $ sudo ./bin/mysgw 
    Jan 04 21:05:11 INFO  Starting gateway...
    Jan 04 21:05:11 INFO  Protocol version - 2.4.0-alpha
    Jan 04 21:05:11 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=0,VER=2.4.0-alpha
    Jan 04 21:05:11 DEBUG TSF:LRT:OK
    Jan 04 21:05:11 DEBUG TSM:INIT
    Jan 04 21:05:11 DEBUG TSF:WUR:MS=0
    Jan 04 21:05:11 DEBUG !TSM:INIT:TSP FAIL
    Jan 04 21:05:11 DEBUG TSM:FAIL:CNT=1
    Jan 04 21:05:11 DEBUG TSM:FAIL:DIS
    Jan 04 21:05:11 DEBUG TSF:TDI:TSL
    Jan 04 21:05:21 DEBUG TSM:FAIL:RE-INIT
    Jan 04 21:05:21 DEBUG TSM:INIT
    Jan 04 21:05:21 DEBUG !TSM:INIT:TSP FAIL
    Jan 04 21:05:21 DEBUG TSM:FAIL:CNT=2
    Jan 04 21:05:21 DEBUG TSM:FAIL:DIS
    Jan 04 21:05:21 DEBUG TSF:TDI:TSL
    ^CJan 04 21:05:23 NOTICE Received SIGINT
    
    pi@raspberrypi:~/MySensorsDev/MySensors $ ./configure --my-gateway=ethernet --my-port=5003
    

    I am guessing this means my wiring is not ok? Strange that the MQTT-gateway doesn't throw the same error.


  • Mod

    @kiesel did you omit the rfm69 settings when you configured the gateway for ethernet? If so, the gateway tried to use a nrf24 radio, which causes init to fail.

    All parameters to configure needs to be present. Any new configure command will reset to the default settings.

    Do you have at least a few meters between the node and the gateway? If not, the signal might be too strong.



  • @mfalkvidd

    Good catch, I didn't do that. Before I saw your message I checked the wiring and I introduced a new bug apparently because now the MQTT-gateway doesn't start anymore either, so I'll have to rewire.

    I'll write again after I did that. Thanks for the help!



  • So this was either a faulty module or bad soldering. I soldered a new module and now everything works as expected. Thanks for the help!


  • Mod

    Great work @kiesel, thanks for reporting back.


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 1
  • 5
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts