RFM69HCW Feather M0 MQTT



  • Im trying to combine the GatewayEsp8266MQTTClient and lafleurs soil moisture sketch. i keep getting this error when compiling

    MyTransportRFM69.cpp: In function 'bool transportInit()':

    MyTransportRFM69.cpp:171:42: error: expected primary-expression before ',' token

    if (_radio.initialize(MY_RFM69_FREQUENCY, _address, MY_RFM69_NETWORKID))

    anyone have some suggestions? am i declaring the frequency wrong?


  • Mod

    @andrew-maynard welcome to the MySensors community!
    You may have declared the frequency wrong, but it is hard to tell without knowing how you declared it. Could you share how you declare the frequency?

    If you haven't already, take a look at the documentation: https://www.mysensors.org/apidocs/group__RFM69SettingGrpPub.html#ga3abb7e6bc4ad07943afe0ce3e381c9ec



  • ive been reading your responses everywhere. lol i had hoped you would respond.

        #define MY_DEBUG                                  // used by MySensor (Print debug messages via serial)
        #define MY_RADIO_RFM69                            // Select Radio-Module RFM69
        #define MY_RFM69_FREQUENCY 
        #define RF69_433MHZ            // Define our Frequency of 433 MHz
        #define MY_IS_RFM69HW                             // Module is high power (HW/HCW)
        //#define MY_RFM69_NETWORKID 100                  // leave out for gateway selection
        #define MY_RF69_SPI_CS 8                          // SPI CS PIN
        #define MY_RF69_IRQ_PIN 3                         // IRQ PIN
        #define MY_RF69_IRQ_NUM 3                         // IRQ PIN NUM (for M0 it is the same as IRQ PIN. Will be obsolete in  
        //#define MY_NODE_ID 162                            // Node ID
        #define MY_DEFAULT_TX_LED_PIN 13                  // LED Pin for "Blink while sending"```

  • Mod

    @andrew-maynard this is how the frequency is defined:

    #define MY_RFM69_FREQUENCY   (RFM69_433MHZ)
    

    Remove these two lines:

    #define MY_RFM69_FREQUENCY 
    #define RF69_433MHZ            // Define our Frequency of 433 MHz
    

    In addition to the documentation I linked before, you can also see the section "Configuring MySensors for RFM69" at https://www.mysensors.org/build/connect_radio#rfm6995-&-arduino



  • This post is deleted!


  • This post is deleted!


  • This post is deleted!

  • Mod

    @andrew-maynard what board and board version are you using? Check the beginning of the output when compiling, it should look like this:

    Using board 'd1_mini' from platform in folder: C:\Users\Micke\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1
    Using core 'esp8266' from platform in folder: C:\Users\Micke\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1
    

    The ESP8266MQTTClient example compiles fine for me, using MySensors 2.3.0.



  • @mfalkvidd Im sorry I was being dummy and overthinking it. I'm using a feather M0 with rfm69hcw. I was under the impression even the client would need some MQTT info. I managed to get the sketch compiling and getting some output from serial monitor but its not consistent at all. I can see through domoticz log that its connected to mysensor. The sketch is a basic Temperatureandhumidity nothing changed except radio type. Thank you for the documentation! helped to clear things up.

    // Enable debug prints to serial monitor
    #define MY_SERIALDEVICE Serial  // this will override Serial port define in MyHwSAMD.h file
    #define MY_DEBUG                                  // used by MySensor (Print debug messages via serial)
    #define MY_RFM69_NEW_DRIVER
    #define MY_RADIO_RFM69                            // Select Radio-Module RFM69
    #define MY_RFM69_FREQUENCY   (RFM69_433MHZ)
    #define MY_IS_RFM69HW                             // Module is high power (HW/HCW)
    //#define MY_RFM69_NETWORKID 100                  // leave out for gateway selection
    #define MY_RF69_SPI_CS 8                          // SPI CS PIN
    #define MY_RF69_IRQ_PIN 3                         // IRQ PIN
    #define MY_RF69_IRQ_NUM 3                         // IRQ PIN NUM (for M0 it is the same as IRQ PIN. Will be obsolete in upcoming MySensors.h) 
    //#define MY_NODE_ID 162                            // Node ID
    #define MY_DEFAULT_TX_LED_PIN 13                  // LED Pin for "Blink while sending"
    
    
    91177 TSM:FAIL:CNT=6
    91187 TSM:FAIL:DIS
    91197 TSF:TDI:TSL
    101208 TSM:FAIL:RE-INIT
    101219 TSM:INIT
    101309 TSM:INIT:TSP OK
    101320 TSM:FPAR
    101335 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    103348 !TSM:FPAR:NO REPLY
    103358 TSM:FPAR
    103372 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    105384 !TSM:FPAR:NO REPLY
    105394 TSM:FPAR
    105408 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    107420 !TSM:FPAR:NO REPLY
    107430 TSM:FPAR
    107445 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    109457 !TSM:FPAR:FAIL
    109468 TSM:FAIL:CNT=7
    109479 TSM:FAIL:DIS
    109490 TSF:TDI:TSL
    

  • Mod

    @andrew-maynard you can use the log parser to get more information about what the log says. In your case, the sensor node is not getting a reply from your gateway. Could you post the gateway log as well?



  • I'm thinking of switching to esp8266 gateway. maybe get that working then try again with raspberry pi? I'm not ready to give up. I dont see as much documentation though.


  • Mod

    @andrew-maynard what type of documentation are you looking for?



  • oh I didnt mean it as not enough documentation in total. you guys put some serious hard work in this project and I really do appreciate it. I would think you guys are paid! I just meant in terms of raspberry pi as a gateway with rfm69hcw. Am I wrong? btw this is one of the liveliest communities I've experienced! once again thank you and I do appreciate it!



  • I'm on the beginner side so it seems a little easier to change a few things in the esp8266gateway sketch and go.


  • Mod

    @andrew-maynard I'd say that if you have Linux experience, the Raspberry Pi gateway is probably easier to configure and troubleshoot (since it will be a familiar environment). But if you're not already familiar with Linux, learning Linix+MySensors at the same time will be harder than using the esp8266 gateway.



  • This is the debug from the gateway.
    If for some reason the transceiver isn't working it should say in debug, correct?

    Aug 02 01:17:32 INFO  Starting gateway...
    Aug 02 01:17:32 INFO  Protocol version - 2.3.1-alpha
    Aug 02 01:17:32 DEBUG MCO:BGN:INIT GW,CP=RPNGL---,VER=2.3.1-alpha
    Aug 02 01:17:32 DEBUG TSF:LRT:OK
    Aug 02 01:17:32 DEBUG TSM:INIT
    Aug 02 01:17:32 DEBUG TSF:WUR:MS=0
    Aug 02 01:17:32 DEBUG TSM:INIT:TSP OK
    Aug 02 01:17:32 DEBUG TSM:INIT:GW MODE
    Aug 02 01:17:32 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Aug 02 01:17:32 DEBUG MCO:REG:NOT NEEDED
    Aug 02 01:17:32 DEBUG MCO:BGN:STP
    Aug 02 01:17:32 DEBUG MCO:BGN:INIT OK,TSP=1
    Aug 02 01:17:32 DEBUG GWT:RMQ:MQTT RECONNECT
    Aug 02 01:17:32 DEBUG connected to 192.168.1.110
    Aug 02 01:17:32 DEBUG GWT:RMQ:MQTT CONNECTED
    Aug 02 01:17:32 DEBUG GWT:TPS:TOPIC=domoticz/out/MyMQTT/0/255/0/0/18,MSG SENT
    

  • Hardware Contributor

    the debug can tell you if spi is working ok.
    when you get FPAR NO REPLY it could be because of bad rfm69 interrupt. but your define looks ok..
    could you try to add in your sketch define this one:

    #define MY_RFM69_RST_PIN 4
    

    As your rfm69 reset signal is routed to D4..


  • Mod

    Could the problems be related to https://github.com/mysensors/MySensors/issues/1155 ?



  • @scalz YES!!! I think that was the problem on the Feather m0 side. still not receiving messages though. i did test it out with

    pi@raspberrypi3:~ $ mosquitto_pub -t 'domoticz/in/MyMQTT' -m '0,29'
    

    I see it in the domoticz log.

    2018-08-05 02:17:49.130 Status: MySensorsMQTT: connected to: 192.168.1.110:1883
    2018-08-05 02:17:49.230 Status: MQTT: Subscribed
    2018-08-05 02:17:55.937 Status: MQTT: Worker stopped...
    2018-08-05 02:17:56.939 Status: MQTT: Connecting to 192.168.1.110:1883
    2018-08-05 02:17:57.040 Status: MQTT: connected to: 192.168.1.110:1883
    2018-08-05 02:17:57.040 Status: MySensorsMQTT: connected to: 192.168.1.110:1883
    2018-08-05 02:17:57.141 Status: MQTT: Subscribed
    2018-08-05 02:45:42.707 MySensorsMQTT: Topic: domoticz/in/MyMQTT, Message: 0,29
    

    I figure it cant hurt to show my ./configure.

    pi@raspberrypi3:~ $ ./configure --my-gateway=mqtt --my-controller-ip-address=192.168.1.110 --my-mqtt-publish-topic-prefix=domoticz/out/MyMQTT --my-mqtt-subscribe-topic-prefix=domoticz/in/MyMQTT --my-mqtt-client-id=pi  --my-transport=rfm69 --my-rfm69-frequency=433 --my-is-rfm69hw^C
    

    Am I missing something? Is there a something specific I should enter below for my client id?

    --my-mqtt-client-id=pi 
    

    Thanks again for responding. I appreciate it!



  • @mfalkvidd I will try it on an esp8266 tomorrow and see if anything changes. When going back versions is there anything else i need to do besides deleting directory and going through ./configure again? I will try the 2.2 version first. I already went from 2.3.1 to 2.3.0.


  • Mod

    @andrew-maynard deleting and starting over is fine. If you're comfortable with git you can switch branch/tag instead of deleting.



  • @mfalkvidd I switched gateway to esp8266

    451843 GWT:TPS:TOPIC=domoticz/out/MyMQTT/100/1/1/0/0,MSG SENT
    452390 TSF:MSG:READ,100-100-0,s=0,c=1,t=1,pt=7,l=5,sg=0:45.7
    452454 GWT:TPS:TOPIC=domoticz/out/MyMQTT/100/0/1/0/1,MSG SENT
    453679 TSF:MSG:READ,100-100-0,s=1,c=1,t=0,pt=7,l=5,sg=0:77.5
    453743 GWT:TPS:TOPIC=domoticz/out/MyMQTT/100/1/1/0/0,MSG SENT
    

    Im still not seeing it on the domoticz log

    2018-08-05 18:37:30.458 Error: Esp8266 MQTT Gateway hardware (5) nothing received for more than 5 Minutes!....
    2018-08-05 18:37:31.459 Error: Restarting: Esp8266 MQTT Gateway
    2018-08-05 18:37:32.293 Status: MQTT: Worker stopped...
    2018-08-05 18:37:33.295 Status: MQTT: Connecting to 192.168.1.110:1883
    2018-08-05 18:37:33.396 Status: MQTT: connected to: 192.168.1.110:1883
    2018-08-05 18:37:33.396 Status: MySensorsMQTT: connected to: 192.168.1.110:1883
    2018-08-05 18:37:33.497 Status: MQTT: Subscribed
    

    When i try to test it using

    pi@raspberrypi3:~ $ mosquitto_sub -v -t 'domoticz/out/MyMQTT'
    
    

    nothing happens and freezes cmd prompt. it does publish though

    pi@raspberrypi3:~ $ mosquitto_pub -t 'domoticz/in/MyMQTT' -m '0,29'
    

    I have to be missing something stupid!



  • Would it be wise to close this and move it to Domoticz MySensors forum? It looks like its an issue with mqtt or domoticz.


Log in to reply
 

Suggested Topics

0
Online

11.4k
Users

11.1k
Topics

112.6k
Posts