[Help!] Adafruit Feather M0 with built-in RFM69HCW can't find parent / GW



  • Hello!
    I am new to MySensors which I did find through Home Assistant.

    I have successfully built an ESP8266 gateway with an Adafruit RFM69HCW breakout module. I also got a node running with an Arduino Pro Micro and the RFM69HCW breakout. Having a Feather 328p, I also got it working as node with the aforementioned breakout module. Last try with a Feather M0 Express and the breakout module was also successful.

    But I am totally incapable of getting an Adafruit Feather M0 with built-in RFM69HCW to connect to my gateway... Why?

    I use the MySensors library 2.4.0-alpha from GitHub. These are the defines I have for the Feather M0:

    #define MY_DEBUG
    #define MY_BAUD_RATE 9600
    #define MY_DEBUG_VERBOSE_TRANSPORT_HAL
    
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    #define MY_RFM69_FREQUENCY (RFM69_433MHZ)
    #define MY_IS_RFM69HW
    
    #define MY_RFM69_RST_PIN (4)
    #define MY_RFM69_IRQ_PIN (3)
    #define MY_RFM69_IRQ_NUM (3)
    #define MY_RFM69_CS_PIN (8)
    

    This is the debug output in a terminal :

    __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
           |___/                      2.4.0-alpha
    
    1732 MCO:BGN:INIT NODE,CP=RPNNS---,FQ=48,REL=1,VER=2.4.0-alpha
    1856 TSM:INIT
    1897 TSF:WUR:MS=15000
    1897 THA:INIT
    1904 TSM:INIT:TSP OK
    1904 TSM:INIT:STATID=14
    1981 THA:SAD:ADDR=14
    2060 TSF:SID:OK,ID=14
    2060 TSM:FPAR
    2060 THA:SND:MSG=0E0EFF020307FF
    2064 THA:SND:MSG LEN=7,RES=1
    2065 ?TSF:MSG:SEND,14-14-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4066 !TSM:FPAR:NO REPLY
    4066 TSM:FPAR
    4066 THA:SND:MSG=0E0EFF020307FF
    4070 THA:SND:MSG LEN=7,RES=1
    4071 ?TSF:MSG:SEND,14-14-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6072 !TSM:FPAR:NO REPLY
    6072 TSM:FPAR
    6072 THA:SND:MSG=0E0EFF020307FF
    6076 THA:SND:MSG LEN=7,RES=1
    6077 ?TSF:MSG:SEND,14-14-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8078 !TSM:FPAR:NO REPLY
    8078 TSM:FPAR
    8078 THA:SND:MSG=0E0EFF020307FF
    8084 THA:SND:MSG LEN=7,RES=1
    8085 ?TSF:MSG:SEND,14-14-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    10086 !TSM:FPAR:FAIL
    10086 TSM:FAIL:CNT=1
    10086 TSM:FAIL:DIS
    10086 TSF:TDI:TSL
    16897 MCO:BGN:STP
    Setup... 
    16897 MCO:BGN:INIT OK,TSP=0
    16897 !MCO:SND:NODE NOT REG
    ...
    

    Has anyone some suggestions ?

    Thank you!
    DeepCore



  • @DeepCore said in [Help!] Adafruit Feather M0 with built-in RFM69HCW can't find parent / GW:

    #define MY_RFM69_IRQ_PIN (3)
    #define MY_RFM69_IRQ_NUM (3)

    Wild guess... These are not the same normally. Pin 3 is probably interrupt 2, you can find the right one by using

    #define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
    


  • @electrik Good point! I copied these defines from some post in this forum, but it matches the pinout from Adafruit
    You got me thinking that maybe there is something wrong in the Adafruit documentation about the Feather M0 built-in RFM69... The image on top says pin 7 for the RFM interrupt ... ๐Ÿ˜• I tried pin 7, no dice...

    I have a Feather M0 Express where I hooked up a RFM69HCW breakout, and it works! Naturally I had to modify the defines for the pins.

    Here is the code for the Feather M0 Express:

    #define MY_DEBUG
    #define MY_BAUD_RATE 9600
    #define MY_DEBUG_VERBOSE_TRANSPORT_HAL
    
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    #define MY_RFM69_FREQUENCY (RFM69_433MHZ)
    #define MY_IS_RFM69HW
    
    #define MY_RFM69_IRQ_PIN (12)
    #define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
    #define MY_RFM69_RST_PIN (5)
    #define MY_RFM69_CS_PIN 10
    
    #define MY_SIGNAL_REPORT_ENABLED
    
    #define MY_NODE_ID 4
    
    #include "MySensors.h"
    
    
    #define VBATPIN A7
    #define CHILD_ID_VOLTAGE  0
    
    MyMessage msgVoltage( CHILD_ID_VOLTAGE,  V_VOLTAGE );
    
    // Sleep time between sensor updates (in milliseconds)
    
    void setup() {
      // put your setup code here, to run once:
      Serial.print("Setup... ");
    }
    
    void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("My M0 Express Sensor", "1.0");
    
      // Present sensors as children to gateway
      present(CHILD_ID_VOLTAGE, S_MULTIMETER, "Voltage");
    }
    
    void loop() {
      float measuredvbat = analogRead(VBATPIN);
      measuredvbat *= 2;    // we divided by 2, so multiply back
      measuredvbat *= 3.3;  // Multiply by 3.3V, our reference voltage
      measuredvbat /= 1024; // convert to voltage
      send(msgVoltage.set(measuredvbat, 2));
    
      #ifdef MY_DEBUG
        Serial.print("VBat: " ); Serial.println(measuredvbat);
      #endif
    
      wait(30000); 
    }
    

    And this is the debug output:

     __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.4.0-alpha
    
    1942 MCO:BGN:INIT NODE,CP=RPNNS---,FQ=48,REL=1,VER=2.4.0-alpha
    4576 TSM:INIT
    5456 TSF:WUR:MS=0
    5456 THA:INIT
    5463 TSM:INIT:TSP OK
    5463 TSM:INIT:STATID=4
    7216 THA:SAD:ADDR=4
    8977 TSF:SID:OK,ID=4
    8977 TSM:FPAR
    8977 THA:SND:MSG=0404FF020307FF
    8985 THA:SND:MSG LEN=7,RES=1
    8985 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    9403 THA:DATA:AVAIL
    9407 THA:RCV:MSG=0000040A2308FF00
    9407 THA:RCV:MSG LEN=8
    9407 TSF:MSG:READ,0-0-4,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    9408 TSF:MSG:FPAR OK,ID=0,D=1
    10987 TSM:FPAR:OK
    10987 TSM:ID
    10987 TSM:ID:OK
    10987 TSM:UPL
    10987 THA:SND:MSG=0404000A2318FF01
    11068 THA:SND:MSG LEN=8,RES=1
    11069 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    11378 THA:DATA:AVAIL
    11388 THA:RCV:MSG=0000040A2319FF01
    11388 THA:RCV:MSG LEN=8
    11389 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    11389 TSF:MSG:PONG RECV,HP=1
    11389 TSM:UPL:OK
    11389 TSM:READY:ID=4,PAR=0,DIS=1
    11390 THA:SND:MSG=04040012C30FFF0100
    11519 THA:SND:MSG LEN=9,RES=1
    11519 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    11793 THA:DATA:AVAIL
    11808 THA:RCV:MSG=00000412C30FFF0100
    11808 THA:RCV:MSG LEN=9
    11808 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    11808 THA:SND:MSG=0404005A0011FF322E342E302D616C706861
    11941 THA:SND:MSG LEN=18,RES=1
    11941 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=11,sg=0,ft=0,st=OK:2.4.0-alpha
    11941 THA:SND:MSG=0404000A2306FF00
    12500 THA:SND:MSG LEN=8,RES=1
    12501 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    14501 THA:SND:MSG=040400A2030BFF4D79204D3020457870726573732053656E736F72
    14564 THA:SND:MSG LEN=27,RES=1
    14564 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=20,sg=0,ft=0,st=OK:My M0 Express Sensor
    14564 THA:SND:MSG=0404001A030CFF312E30
    15123 THA:SND:MSG LEN=10,RES=1
    15123 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    15123 THA:SND:MSG=0404003A001E00566F6C74616765
    15683 THA:SND:MSG LEN=14,RES=1
    15683 TSF:MSG:SEND,4-4-0-0,s=0,c=0,t=30,pt=0,l=7,sg=0,ft=0,st=OK:Voltage
    15684 MCO:REG:REQ
    15684 THA:SND:MSG=0404000A231AFF02
    16242 THA:SND:MSG LEN=8,RES=1
    16242 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    16515 THA:DATA:AVAIL
    16523 THA:RCV:MSG=0000040A231BFF01
    16523 THA:RCV:MSG LEN=8
    16523 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    16523 MCO:PIM:NODE REG=1
    16524 MCO:BGN:STP
    

    And now the "non-working" code from the Feather M0 with built-in RFM69:

    #define MY_DEBUG
    #define MY_BAUD_RATE 9600
    #define MY_DEBUG_VERBOSE_TRANSPORT_HAL
    
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    #define MY_RFM69_FREQUENCY (RFM69_433MHZ)
    #define MY_IS_RFM69HW
    
    #define MY_RFM69_RST_PIN 4
    #define MY_RFM69_IRQ_PIN 3
    #define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
    #define MY_RFM69_CS_PIN 8
    #define MY_SIGNAL_REPORT_ENABLED
    #define MY_TRANSPORT_WAIT_READY_MS 15000 
    
    #define MY_NODE_ID 14
    
    
    #include "MySensors.h"
    
    
    #define VBATPIN A7
    #define CHILD_ID_VOLTAGE  0
    
    MyMessage msgVoltage( CHILD_ID_VOLTAGE,  V_VOLTAGE );
    
    void setup() {
      // put your setup code here, to run once:
      Serial.print("Setup... ");
    }
    
    void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("My M0 Sensor", "1.0");
    
      // Present sensors as children to gateway
      present(CHILD_ID_VOLTAGE, S_MULTIMETER, "Voltage");
    }
    
    void loop() {
      float measuredvbat = analogRead(VBATPIN);
      measuredvbat *= 2;    // we divided by 2, so multiply back
      measuredvbat *= 3.3;  // Multiply by 3.3V, our reference voltage
      measuredvbat /= 1024; // convert to voltage
      send(msgVoltage.set(measuredvbat, 2));
    
      #ifdef MY_DEBUG
        Serial.print("VBat: " ); Serial.println(measuredvbat);
      #endif
    
      wait(60000); 
    }
    


  • 7 should be right. Did you also change the irq number when you tried pin 7?



  • Hello everybody out there!

    I can't say how I feel right now... my Feather M0 with built-in RFM69 has finally connected to the gateway !!!
    ๐Ÿ˜‚ ๐Ÿ˜† ๐Ÿ˜ฎ

    I commented 3 lines in my non-working code and uploaded it again ... And I don't know why it works now...
    but i suspect the line with the define of the IRQ_NUM ๐Ÿ™„

    #define MY_DEBUG
    #define MY_BAUD_RATE 9600
    //#define MY_DEBUG_VERBOSE_TRANSPORT_HAL
    
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    #define MY_RFM69_FREQUENCY (RFM69_433MHZ)
    #define MY_IS_RFM69HW
    
    #define MY_RFM69_CS_PIN 8                          // SPI CS PIN
    #define MY_RFM69_IRQ_PIN 3                         // IRQ PIN
    //#define MY_RFM69_IRQ_NUM 3                         // IRQ PIN NUM (for M0 it is the same as IRQ PIN. Will be obsolete in upcoming MySensors.h) 
    
    #define MY_RFM69_RST_PIN 4
    
    #define MY_SIGNAL_REPORT_ENABLED
    //#define MY_TRANSPORT_WAIT_READY_MS 15000 
    
    #define MY_NODE_ID 14
    
    #include <SPI.h> 
    #include "MySensors.h"
    
    
    #define VBATPIN A7
    #define CHILD_ID_VOLTAGE  0
    
    


  • I was chasing a red herring ! ๐Ÿ˜ฅ
    What I have written in my posts above is simply non-sense, excuse me ! ๐Ÿ™‡

    I have 2 Feather M0 with the integrated radio module, and only one of the Feathers connects to the gateway. ๐Ÿ˜–

    When I try the two Feathers with the simple TX/RX examples from the RadioHead Library modified by Adafruit, they work... And I switched the role of each module ... so they can transmit and receive.

    But one Feather refuses to get a connection to the gateway ... I don't know why


  • Mod

    @DeepCore do you remember if both modules got similar rssi when you tested the Adafruit rx/tx sketch?



  • @mfalkvidd yes, I got the same RSSI value, regardless which one was the receiver. Were you thinking that maybe one radio module was on the wrong frequency range ?


  • Mod

    @DeepCore not wrong frequency no. But it looks like the feather doesnโ€™t come with the antenna pre-soldered. Since the devices should be identical otherwise, the antenna could be what differs. But if it was, the rssi would probably have been different as well.



Suggested Topics

49
Online

11.4k
Users

11.1k
Topics

112.6k
Posts