Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. rfm69 network issue

rfm69 network issue

Scheduled Pinned Locked Moved Hardware
30 Posts 5 Posters 10.2k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • alexsh1A Offline
    alexsh1A Offline
    alexsh1
    wrote on last edited by alexsh1
    #1

    Hello,

    I am trying to make a GW with rfm69hcw (433Mhz) to talk to a node with rfm69cw (433Mhz).
    Both radio init went well, but they cannot see each other. I am using 2.0b library

    I the node I see the following:

     Starting sensor (RRNNA-, 2.0.0-beta)
    Radio init successful.
    find parent
    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    find parent
    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    find parent
    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    find parent
    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    find parent
    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    find parent
    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    find parent
    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    Init complete, id=1, parent=255, distance=255
    

    And the following on the GW:

    0;255;3;0;9;Starting gateway (RRNGA-, 2.0.0-beta)
    0;255;3;0;9;Radio init successful.
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.0.0-beta
    0;255;3;0;9;Init complete, id=0, parent=0, distance=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    0;255;3;0;9;read and forward: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0
    

    I understand the GW receives the signal from the node, fails to send the message to the node (ft=fail:0). Some kind of one way communication?

    I have changed in MyConfig.h the following:

    #define MY_RFM69_FREQUENCY RF69_433MHZ
    to match 433Mhz hardware setup.

    The sketches I am using are just standard sketches for GW and a node.
    I have 17cm isolated wire antenna on both transceivers.

    Anyone could give me any clues please?

    1 Reply Last reply
    0
    • scalzS Offline
      scalzS Offline
      scalz
      Hardware Contributor
      wrote on last edited by
      #2

      it could be because of not receiving ack. Maybe you could check if your rfm69 interrupt pin is well set. If not, so you can't receive any response and that could be the problem.
      I hope this helps.

      1 Reply Last reply
      0
      • chrilleC Offline
        chrilleC Offline
        chrille
        wrote on last edited by
        #3

        What kind of gateway are you using? I have seen similar issues with RFM69 on ESP8266 gateways (although my RFM69 modules are 868 MHz). The issue was present with a wire as an antenne, as well as with a rubber antenna connected to a SMA connector directly to the RFM. I was able to solve the issue in several ways:

        1. Touching the antenna on the ESP8266 side with my fingers! (obviously a very temporary solution)
        2. Connecting a ground plane to the rubber antenna (I used the lid from a can of beans)
        3. Connecting a dipole antenna with a 1-2 meter cable

        The easiest way to debug this is to load the Gateway and Node sketches from https://github.com/LowPowerLab/RFM69/tree/master/Examples on your sensor board and gateway, since these sketches provides instant feedback and tests in both directions.

        Hopefully the RFM69 driver will get better debug output at some point.

        frenchoF 1 Reply Last reply
        0
        • scalzS Offline
          scalzS Offline
          scalz
          Hardware Contributor
          wrote on last edited by scalz
          #4

          if you want to be sure of your antenna, cut your wire at the right lenght as you know and solder it directly on rfm69 antenna pad module. you should not have big problem with your antenna like this. then you can add a capa of course. I never had problem ...so far at least :)
          You can have spi port well attached but the irq pin not well set and still have radio init done. But of course, if no interrupt pin, then no trigger on receive msg as rfm69 is interrupt driven, and of course no ack (which is mostly what means st:fail). I say this because it happened to me, i searched for hours what i was doing wrong before i remember i changed my variant pins (it was for arduino zero and each pin can be an irq, depending of the mapping variant...). And depending of your esp (i don't know if it's a new GW you're building), you can have different mapping for D0, d1 etc...(what a pain...)

          1 Reply Last reply
          0
          • alexsh1A Offline
            alexsh1A Offline
            alexsh1
            wrote on last edited by
            #5

            I have Moteino MEGA USB with rfm69hcw onboard and a node with adapter (rfm69cw to nrf24l01+) and I think the problem is in the adapter. I really do not think this is antenna issue.

            The rfm69* IRQ has to be connected to D2 or something?

            1 Reply Last reply
            0
            • scalzS Offline
              scalzS Offline
              scalz
              Hardware Contributor
              wrote on last edited by
              #6

              yes this shoud be d2/int2 for 1284p...have you tried your GW with a working node to see on what side is your problem.
              i agree with you, i have an adapter for rfm69 i use sometimes for breadboarding but it's really not as good as radio modules directly soldered on pcb but it works on my side..
              What's your other node? 3v vcc or 5v?? rfm69 isn't 5v tolerant..

              alexsh1A 2 Replies Last reply
              0
              • scalzS scalz

                yes this shoud be d2/int2 for 1284p...have you tried your GW with a working node to see on what side is your problem.
                i agree with you, i have an adapter for rfm69 i use sometimes for breadboarding but it's really not as good as radio modules directly soldered on pcb but it works on my side..
                What's your other node? 3v vcc or 5v?? rfm69 isn't 5v tolerant..

                alexsh1A Offline
                alexsh1A Offline
                alexsh1
                wrote on last edited by
                #7

                @scalz Ok, On Moteino MEGa it is connected to D2.
                What about atmega328p?

                This is the adapter I am using:

                0_1467214368150_Screenshot (22).png

                1 Reply Last reply
                0
                • scalzS scalz

                  yes this shoud be d2/int2 for 1284p...have you tried your GW with a working node to see on what side is your problem.
                  i agree with you, i have an adapter for rfm69 i use sometimes for breadboarding but it's really not as good as radio modules directly soldered on pcb but it works on my side..
                  What's your other node? 3v vcc or 5v?? rfm69 isn't 5v tolerant..

                  alexsh1A Offline
                  alexsh1A Offline
                  alexsh1
                  wrote on last edited by
                  #8

                  @scalz This is a low power node so 3.3V. Basically, I just used the socket for nrf24l01+ and inserted the adapter. There is a J2 pad to connect IRQ to D2 (INT2). Everything should be working fine, but ...

                  This is the node I am using:
                  https://www.openhardware.io/view/5/Battery-based-atmega328p-sensor-no-SMD

                  alexsh1A 1 Reply Last reply
                  0
                  • alexsh1A alexsh1

                    @scalz This is a low power node so 3.3V. Basically, I just used the socket for nrf24l01+ and inserted the adapter. There is a J2 pad to connect IRQ to D2 (INT2). Everything should be working fine, but ...

                    This is the node I am using:
                    https://www.openhardware.io/view/5/Battery-based-atmega328p-sensor-no-SMD

                    alexsh1A Offline
                    alexsh1A Offline
                    alexsh1
                    wrote on last edited by alexsh1
                    #9

                    This is a node scheme:

                    0_1467217515018_image.png

                    Pretty much standard.
                    I wonder if anyone has used a constructor for rf69 library?

                    By the way I tried to load the default sketches (gateway and node) from lowpower lab and gateway does not hear the node. Again, I'm not sure wiring on the node is done in a standard moteino way - I'm using the pins which MySensors are using

                    D9 - not used
                    D10 - NSS
                    D11 - MOSI
                    D12 - MISO
                    D13 - SCK
                    IRQ - D2

                    Obviously 3.3V and GND and ANT

                    EDIT: yes the pins used my Moteino Mega are different.
                    0_1467218342322_image.png

                    So the question is how do I used a constructor for rf69 and MySensors???

                    1 Reply Last reply
                    0
                    • scalzS Offline
                      scalzS Offline
                      scalz
                      Hardware Contributor
                      wrote on last edited by scalz
                      #10

                      i guess you have soldered the jumper...hmm, with lowpowerlab for instance, if your gw send a packet, does the node receive something? Or vice versa ?

                      For debugging, bad practice in prod but :
                      You could put a serial message in the isr of your radio module lib , and check if it reachs it at least. Then if ack flag is triggered etc. But at least, if it doesn't enter in your isr, then it's sure there is a problem with your irq pin...
                      You can debug this in interruptHandler() of rfm69.cpp
                      i have looked briefly in mysensors libs, but i don't see why that couldn't work for your moteino mega. i have one too but not tried with mysensors and no radio on it. But i use rfm69 libs with mysensors on Atsam (arduino zero similar) so this is working.

                      What do you mean by rfm69 constructor??

                      alexsh1A 1 Reply Last reply
                      0
                      • scalzS scalz

                        i guess you have soldered the jumper...hmm, with lowpowerlab for instance, if your gw send a packet, does the node receive something? Or vice versa ?

                        For debugging, bad practice in prod but :
                        You could put a serial message in the isr of your radio module lib , and check if it reachs it at least. Then if ack flag is triggered etc. But at least, if it doesn't enter in your isr, then it's sure there is a problem with your irq pin...
                        You can debug this in interruptHandler() of rfm69.cpp
                        i have looked briefly in mysensors libs, but i don't see why that couldn't work for your moteino mega. i have one too but not tried with mysensors and no radio on it. But i use rfm69 libs with mysensors on Atsam (arduino zero similar) so this is working.

                        What do you mean by rfm69 constructor??

                        alexsh1A Offline
                        alexsh1A Offline
                        alexsh1
                        wrote on last edited by
                        #11

                        @scalz

                        RFM69 radio = RFM69(RFM69_CS, RFM69_IRQ, IS_RFM69HCW, RFM69_IRQN);

                        This is what I mean. I need to understand what it means for 328p and 1284p

                        1 Reply Last reply
                        0
                        • alexsh1A Offline
                          alexsh1A Offline
                          alexsh1
                          wrote on last edited by
                          #12

                          After fiddling with the radios I manage to make them talk, but the following I got from the node:

                          Starting sensor (RRNNA-, 2.0.0-beta)
                          Radio init successful.
                          send: 1-1-0-0 s=255,c=3,t=15,pt=0,l=2,sg=0,st=fail:
                          send: 1-1-0-0 s=255,c=0,t=17,pt=0,l=10,sg=0,st=fail:2.0.0-beta
                          send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=fail:0
                          send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=16,sg=0,st=fail:Light Lux Sensor
                          send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=fail:1.0
                          send: 1-1-0-0 s=0,c=0,t=16,pt=0,l=0,sg=0,st=fail:
                          find parent
                          send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
                          Init complete, id=1, parent=0, distance=255
                          54612
                          send: 1-1-0-0 s=0,c=1,t=23,pt=3,l=2,sg=0,st=fail:54612
                          

                          Meantime, I can see that the same message is transferred three times. From the Domoticz log:

                           2016-06-29 20:03:18.057 Hardware Monitor: Fetching data (System sensors)
                          2016-06-29 20:03:22.299 MySensors: Node: 1, Sketch Name: Light Lux Sensor
                          2016-06-29 20:03:22.347 MySensors: Node: 1, Sketch Name: Light Lux Sensor
                          2016-06-29 20:03:22.393 MySensors: Node: 1, Sketch Name: Light Lux Sensor
                          2016-06-29 20:03:22.442 MySensors: Node: 1, Sketch Version: 1.0
                          2016-06-29 20:03:22.485 MySensors: Node: 1, Sketch Version: 1.0
                          2016-06-29 20:03:22.529 MySensors: Node: 1, Sketch Version: 1.0
                          2016-06-29 20:03:24.856 (Moteino) Lux (Light Level)
                          2016-06-29 20:03:24.899 (Moteino) Lux (Light Level)
                          2016-06-29 20:03:24.944 (Moteino) Lux (Light Level) 
                          
                          1 Reply Last reply
                          0
                          • alexsh1A Offline
                            alexsh1A Offline
                            alexsh1
                            wrote on last edited by
                            #13

                            These test sketches work just fine including ACK

                            Node sketch (rfm69cw)

                            /* RFM69 library and code by Felix Rusu - felix@lowpowerlab.com
                            // Get libraries at: https://github.com/LowPowerLab/
                            // Make sure you adjust the settings in the configuration section below !!!
                            // **********************************************************************************
                            // Copyright Felix Rusu, LowPowerLab.com
                            // Library and code by Felix Rusu - felix@lowpowerlab.com
                            // **********************************************************************************
                            // License
                            // **********************************************************************************
                            // This program is free software; you can redistribute it 
                            // and/or modify it under the terms of the GNU General    
                            // Public License as published by the Free Software       
                            // Foundation; either version 3 of the License, or        
                            // (at your option) any later version.                    
                            //                                                        
                            // This program is distributed in the hope that it will   
                            // be useful, but WITHOUT ANY WARRANTY; without even the  
                            // implied warranty of MERCHANTABILITY or FITNESS FOR A   
                            // PARTICULAR PURPOSE. See the GNU General Public        
                            // License for more details.                              
                            //                                                        
                            // You should have received a copy of the GNU General    
                            // Public License along with this program.
                            // If not, see <http://www.gnu.org/licenses></http:>.
                            //                                                        
                            // Licence can be viewed at                               
                            // http://www.gnu.org/licenses/gpl-3.0.txt
                            //
                            // Please maintain this license information along with authorship
                            // and copyright notices in any redistribution of this code
                            // **********************************************************************************/
                            
                            #include <RFM69.h>    //get it here: https://www.github.com/lowpowerlab/rfm69
                            #include <SPI.h>
                            
                            //*********************************************************************************************
                            // *********** IMPORTANT SETTINGS - YOU MUST CHANGE/ONFIGURE TO FIT YOUR HARDWARE *************
                            //*********************************************************************************************
                            #define NETWORKID     100  // The same on all nodes that talk to each other
                            #define NODEID        2    // The unique identifier of this node
                            #define RECEIVER      1    // The recipient of packets
                            
                            //Match frequency to the hardware version of the radio on your Feather
                            #define FREQUENCY     RF69_433MHZ
                            //#define FREQUENCY     RF69_868MHZ
                            //#define FREQUENCY     RF69_915MHZ
                            #define ENCRYPTKEY    "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
                            #define IS_RFM69HCW   false // set to 'true' if you are using an RFM69HCW module
                            
                            //*********************************************************************************************
                            #define SERIAL_BAUD   115200
                            
                            #define RFM69_CS      10
                            #define RFM69_IRQ     2
                            #define RFM69_IRQN    0  // Pin 2 is IRQ 0!
                            #define RFM69_RST     9
                            
                            #define LED           8  // onboard blinky
                            
                            
                            int16_t packetnum = 0;  // packet counter, we increment per xmission
                            
                            RFM69 radio;
                            
                            //RFM69 radio = RFM69(RFM69_CS, RFM69_IRQ, IS_RFM69HCW, RFM69_IRQN);
                            
                            void setup() {
                              while (!Serial); // wait until serial console is open, remove if not tethered to computer
                              Serial.begin(SERIAL_BAUD);
                            
                              Serial.println("Arduino RFM69HCW Transmitter");
                              
                              // Hard Reset the RFM module
                              pinMode(RFM69_RST, OUTPUT);
                              digitalWrite(RFM69_RST, HIGH);
                              delay(100);
                              digitalWrite(RFM69_RST, LOW);
                              delay(100);
                            
                              // Initialize radio
                              radio.initialize(FREQUENCY,NODEID,NETWORKID);
                              if (IS_RFM69HCW) {
                                radio.setHighPower();    // Only for RFM69HCW & HW!
                              }
                              radio.setPowerLevel(31); // power output ranges from 0 (5dBm) to 31 (20dBm)
                              
                              radio.encrypt(ENCRYPTKEY);
                              
                              pinMode(LED, OUTPUT);
                              Serial.print("\nTransmitting at ");
                              Serial.print(FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
                              Serial.println(" MHz");
                            }
                            
                            
                            void loop() {
                              delay(1000);  // Wait 1 second between transmits, could also 'sleep' here!
                                
                              char radiopacket[20] = "Hello World #";
                              itoa(packetnum++, radiopacket+13, 10);
                              Serial.print("Sending "); Serial.println(radiopacket);
                                
                              if (radio.sendWithRetry(RECEIVER, radiopacket, strlen(radiopacket))) { //target node Id, message as string or byte array, message length
                                Serial.println("OK");
                                Blink(LED, 50, 3); //blink LED 3 times, 50ms between blinks
                              }
                            
                              radio.receiveDone(); //put radio in RX mode
                              Serial.flush(); //make sure all serial data is clocked out before sleeping the MCU
                            }
                            
                            void Blink(byte PIN, byte DELAY_MS, byte loops)
                            {
                              for (byte i=0; i<loops; i++)
                              {
                                digitalWrite(PIN,HIGH);
                                delay(DELAY_MS);
                                digitalWrite(PIN,LOW);
                                delay(DELAY_MS);
                              }
                            }
                            

                            Gateway sketch (Moteino Mega, rfm69hcw):

                            /* RFM69 library and code by Felix Rusu - felix@lowpowerlab.com
                            // Get libraries at: https://github.com/LowPowerLab/
                            // Make sure you adjust the settings in the configuration section below !!!
                            // **********************************************************************************
                            // Copyright Felix Rusu, LowPowerLab.com
                            // Library and code by Felix Rusu - felix@lowpowerlab.com
                            // **********************************************************************************
                            // License
                            // **********************************************************************************
                            // This program is free software; you can redistribute it 
                            // and/or modify it under the terms of the GNU General    
                            // Public License as published by the Free Software       
                            // Foundation; either version 3 of the License, or        
                            // (at your option) any later version.                    
                            //                                                        
                            // This program is distributed in the hope that it will   
                            // be useful, but WITHOUT ANY WARRANTY; without even the  
                            // implied warranty of MERCHANTABILITY or FITNESS FOR A   
                            // PARTICULAR PURPOSE. See the GNU General Public        
                            // License for more details.                              
                            //                                                        
                            // You should have received a copy of the GNU General    
                            // Public License along with this program.
                            // If not, see <http://www.gnu.org/licenses></http:>.
                            //                                                        
                            // Licence can be viewed at                               
                            // http://www.gnu.org/licenses/gpl-3.0.txt
                            //
                            // Please maintain this license information along with authorship
                            // and copyright notices in any redistribution of this code
                            // **********************************************************************************/
                            
                            #include <RFM69.h>    //get it here: https://www.github.com/lowpowerlab/rfm69
                            #include <SPI.h>
                            
                            //*********************************************************************************************
                            // *********** IMPORTANT SETTINGS - YOU MUST CHANGE/ONFIGURE TO FIT YOUR HARDWARE *************
                            //*********************************************************************************************
                            #define NETWORKID     100  //the same on all nodes that talk to each other
                            #define NODEID        1  
                            
                            //Match frequency to the hardware version of the radio on your Feather
                            #define FREQUENCY     RF69_433MHZ
                            //#define FREQUENCY     RF69_868MHZ
                            //#define FREQUENCY      RF69_915MHZ
                            #define ENCRYPTKEY     "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
                            #define IS_RFM69HCW    true // set to 'true' if you are using an RFM69HCW module
                            
                            //*********************************************************************************************
                            #define SERIAL_BAUD   115200
                            
                            #define RFM69_CS      10
                            #define RFM69_IRQ     2
                            #define RFM69_IRQN    0  // Pin 2 is IRQ 0!
                            #define RFM69_RST     9
                            
                            #define LED           15  // onboard blinky
                            
                            int16_t packetnum = 0;  // packet counter, we increment per xmission
                            
                            RFM69 radio;
                            
                            void setup() {
                              while (!Serial); // wait until serial console is open, remove if not tethered to computer
                              Serial.begin(SERIAL_BAUD);
                            
                              Serial.println("Feather RFM69HCW Receiver");
                              
                              // Hard Reset the RFM module
                              pinMode(RFM69_RST, OUTPUT);
                              digitalWrite(RFM69_RST, HIGH);
                              delay(100);
                              digitalWrite(RFM69_RST, LOW);
                              delay(100);
                              
                              // Initialize radio
                              radio.initialize(FREQUENCY,NODEID,NETWORKID);
                              if (IS_RFM69HCW) {
                                radio.setHighPower();    // Only for RFM69HCW & HW!
                              }
                              radio.setPowerLevel(31); // power output ranges from 0 (5dBm) to 31 (20dBm)
                              
                              radio.encrypt(ENCRYPTKEY);
                              
                              pinMode(LED, OUTPUT);
                            
                              Serial.print("\nListening at ");
                              Serial.print(FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
                              Serial.println(" MHz");
                            }
                            
                            void loop() {
                              //check if something was received (could be an interrupt from the radio)
                              if (radio.receiveDone())
                              {
                                //print message received to serial
                                Serial.print('[');Serial.print(radio.SENDERID);Serial.print("] ");
                                Serial.print((char*)radio.DATA);
                                Serial.print("   [RX_RSSI:");Serial.print(radio.RSSI);Serial.print("]");
                            
                                //check if received message contains Hello World
                                if (strstr((char *)radio.DATA, "Hello World"))
                                {
                                  //check if sender wanted an ACK
                                  if (radio.ACKRequested())
                                  {
                                    radio.sendACK();
                                    Serial.println(" - ACK sent");
                                  }
                                  Blink(LED, 40, 3); //blink LED 3 times, 40ms between blinks
                                }  
                              }
                            
                              radio.receiveDone(); //put radio in RX mode
                              Serial.flush(); //make sure all serial data is clocked out before sleeping the MCU
                            }
                            
                            void Blink(byte PIN, byte DELAY_MS, byte loops)
                            {
                              for (byte i=0; i<loops; i++)
                              {
                                digitalWrite(PIN,HIGH);
                                delay(DELAY_MS);
                                digitalWrite(PIN,LOW);
                                delay(DELAY_MS);
                              }
                            }
                            
                            1 Reply Last reply
                            1
                            • scalzS Offline
                              scalzS Offline
                              scalz
                              Hardware Contributor
                              wrote on last edited by scalz
                              #14

                              @alexsh1 ok. i thought you were talking about something else. So to answer, it works the same for 328p, 1284p if irq and pin is right. for st fail, perhaps the adapter..it's a lot better when soldered directly on node pcb.

                              1 Reply Last reply
                              0
                              • alexsh1A Offline
                                alexsh1A Offline
                                alexsh1
                                wrote on last edited by
                                #15

                                @scalz Sorted. One radio on the GW is with amplification so I had to add the following to the code:

                                #define MY_IS_RFM69HW
                                #define MY_RF69_IRQ_PIN 2 // not sure if this line makes any difference
                                

                                All works perfectly now.

                                1 Reply Last reply
                                1
                                • alexsh1A Offline
                                  alexsh1A Offline
                                  alexsh1
                                  wrote on last edited by alexsh1
                                  #16

                                  Anyone knows how I can change the rfm69 speed within the sketch?
                                  Something like MY_RF69_DATARATE or something?

                                  Additionally, I'd like to use encryption, but no idea where to start. This is very easy with rf69 library, but not sure how to apply in MySensors.

                                  1 Reply Last reply
                                  0
                                  • alexsh1A Offline
                                    alexsh1A Offline
                                    alexsh1
                                    wrote on last edited by alexsh1
                                    #17

                                    This is the final product - I am @GertSanders would appreciate it
                                    0_1467272357082_image.jpeg

                                    1 Reply Last reply
                                    0
                                    • scalzS Offline
                                      scalzS Offline
                                      scalz
                                      Hardware Contributor
                                      wrote on last edited by
                                      #18

                                      @alexsh1 cool :) for encryption this is done at radio init. You can enable/disable it by using MY_RFM69_ENABLE_ENCRYPTION
                                      And for the datarate, there is no var for this. it's done by using register in radio init. I could look at adding this as I have locally updated mys with the latest rfm69 features.

                                      alexsh1A 2 Replies Last reply
                                      0
                                      • scalzS scalz

                                        @alexsh1 cool :) for encryption this is done at radio init. You can enable/disable it by using MY_RFM69_ENABLE_ENCRYPTION
                                        And for the datarate, there is no var for this. it's done by using register in radio init. I could look at adding this as I have locally updated mys with the latest rfm69 features.

                                        alexsh1A Offline
                                        alexsh1A Offline
                                        alexsh1
                                        wrote on last edited by
                                        #19

                                        @scalz Thanks! Encryption - but how do I define the key?

                                        #define ENCRYPTKEY     "sampleEncryptKey"
                                        

                                        or something.

                                        Looking forward to your updates on rfm69!

                                        1 Reply Last reply
                                        0
                                        • scalzS Offline
                                          scalzS Offline
                                          scalz
                                          Hardware Contributor
                                          wrote on last edited by scalz
                                          #20

                                          @alexsh1 For the encrypt key...I'm not sure how this works in mysensors. I will look into this later today ;)
                                          Actually, it works like this : during radio init, encryption is enabled or not depending of the above define. For the key (which is stored in eeprom) it uses EEPROM_RF_ENCRYPTION_AES_KEY_ADDRESS which is related to signing defines..you can have more info on this in MyEepromAddresses.h . you will see how it is constructed.

                                          alexsh1A 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          25

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular