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. Feature Requests
  3. RFM69 RSSI value report

RFM69 RSSI value report

Scheduled Pinned Locked Moved Feature Requests
41 Posts 11 Posters 15.8k Views 12 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.
  • M Offline
    M Offline
    mihai.aldea
    wrote on last edited by
    #1

    Is there any way for a gateway to read the RSSI value of the remote RFM69 based sensors? RSSI reporting is already available in the driver library, however I can only see RSSI reports when using the libraries Struct_send/Struct_receive example sketches. I tried to trick the sketch to report it, yet unsuccessfull. There are some tweaks for the RF24 networks yet they're not actually RSSI reports but rather transport reliability metrics counting failed against sent packets. But since RFM69 natively supports RSSI and the functions are already there, I believe that it's very simple for someone who knows the arhitecture inside out to add some #define MY_RFM69_RSSI option available to the gateway sketch.
    But meanwhile I wouldn't mind any suggestion as to how could I access the RFM69 library RFM69::readRSSI function and get the values in any form. It would help me a great deal to test various antennas, bitrates, range and penetration for the RFM69 modules.
    RSSI reports of the ACK packets sent back from the gateway would be great too in order to have a clear picture of the two-way communication but let's take it one step at a time :grin:

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      @scalz is doing some great work in this area so maybe he can let us know the status.

      https://forum.mysensors.org/topic/5109/solved-rfm69-based-nodes-unable-to-report-lib-version/43 has some information.

      https://github.com/tekka007/MySensors/commits/RFM69Scalz

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mihai.aldea
        wrote on last edited by mihai.aldea
        #3

        @mfalkvidd Thank you for pointing me to those resources, I finally got them working.
        @scalz Absolutely awesome work :smile:

        Here's a full sketch example using the Si7021 Temp/RH sensor:

        #define MY_NODE_ID 2
        #define MY_DEBUG
        #define MY_RADIO_RFM69
        #define MY_RFM69_FREQUENCY RFM69_433MHZ
        #define MY_IS_RFM69HW 
        #define MY_RFM69_NETWORKID 100
        
        #include <MySensors.h>  
        #include <SPI.h>
        #include <Wire.h>
        #include "Adafruit_Si7021.h"
        unsigned long SLEEP_TIME = 1000;
        Adafruit_Si7021 sensor = Adafruit_Si7021();
        MyMessage msgTemp(1, V_TEMP);
        MyMessage msgRh(2, V_HUM);
        MyMessage msgRSSI(3,V_VAR5);
        float temp;
        float rh;
        boolean requestACK = false;
        int16_t rssiVal
        char rssiStr[10];
        
        void setup()  
        {  
          delay(100);
          sendSketchInfo("Temperature/RH Sensor N2 RFM69", "1.1");
          sensor.begin();
          present(1, S_TEMP);
          present(2, S_HUM);
        }
        
        void loop() {
          rssiVal = transportGetRSSI();
          rh = sensor.readHumidity();
          temp = sensor.readTemperature();
          snprintf(rssiStr,10,"rssi: %d%",rssiVal);
          send(msgTemp.set(temp,2));
          send(msgRh.set(rh,2));
          send(msgRSSI.set(rssiStr));
          sleep(SLEEP_TIME);
        }
        
        

        However, please note that this only works on:
        https://github.com/scalz/Mysensors/tree/rfm69_update2
        and
        http://forum.mycontroller.org/topic/58/download-snapshot-build
        Just drop a reply here and I will happily assist you using the above versions until they will be fully commited.

        mfalkviddM 1 Reply Last reply
        2
        • M mihai.aldea

          @mfalkvidd Thank you for pointing me to those resources, I finally got them working.
          @scalz Absolutely awesome work :smile:

          Here's a full sketch example using the Si7021 Temp/RH sensor:

          #define MY_NODE_ID 2
          #define MY_DEBUG
          #define MY_RADIO_RFM69
          #define MY_RFM69_FREQUENCY RFM69_433MHZ
          #define MY_IS_RFM69HW 
          #define MY_RFM69_NETWORKID 100
          
          #include <MySensors.h>  
          #include <SPI.h>
          #include <Wire.h>
          #include "Adafruit_Si7021.h"
          unsigned long SLEEP_TIME = 1000;
          Adafruit_Si7021 sensor = Adafruit_Si7021();
          MyMessage msgTemp(1, V_TEMP);
          MyMessage msgRh(2, V_HUM);
          MyMessage msgRSSI(3,V_VAR5);
          float temp;
          float rh;
          boolean requestACK = false;
          int16_t rssiVal
          char rssiStr[10];
          
          void setup()  
          {  
            delay(100);
            sendSketchInfo("Temperature/RH Sensor N2 RFM69", "1.1");
            sensor.begin();
            present(1, S_TEMP);
            present(2, S_HUM);
          }
          
          void loop() {
            rssiVal = transportGetRSSI();
            rh = sensor.readHumidity();
            temp = sensor.readTemperature();
            snprintf(rssiStr,10,"rssi: %d%",rssiVal);
            send(msgTemp.set(temp,2));
            send(msgRh.set(rh,2));
            send(msgRSSI.set(rssiStr));
            sleep(SLEEP_TIME);
          }
          
          

          However, please note that this only works on:
          https://github.com/scalz/Mysensors/tree/rfm69_update2
          and
          http://forum.mycontroller.org/topic/58/download-snapshot-build
          Just drop a reply here and I will happily assist you using the above versions until they will be fully commited.

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          Awesome @mihai-aldea
          Great work!

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

            and Kudo to @tekka too ! and @marceloaqno who is also working on the linux part ;)

            that said @mihai-aldea cool you have it working. of course we are interested by feedbacks :)
            There are some defines which may need some adjustements (timeouts) depending on the clock of the mcu (especially for gw). for the moment the latest rev is still local but it does not differ a lot.

            Important note:

            This new version breaks old packet structure. Because there are new values in the packet header : version, sequence number and Rssi.

            Which means if people want to use these new features, it needs all nodes and GW updated.
            As the next release isn't a major one, there will be a switch define, with these new features default disabled. for compatibility with older nodes.

            1 Reply Last reply
            2
            • L Offline
              L Offline
              lafleur
              wrote on last edited by
              #6

              Great work, would like to see this added to RFM95 radio code...

              scalzS 1 Reply Last reply
              0
              • L lafleur

                Great work, would like to see this added to RFM95 radio code...

                scalzS Offline
                scalzS Offline
                scalz
                Hardware Contributor
                wrote on last edited by
                #7

                @lafleur said:

                Great work, would like to see this added to RFM95 radio code...

                Like which features?

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lafleur
                  wrote on last edited by
                  #8

                  RSSI......

                  1 Reply Last reply
                  0
                  • rmtuckerR Offline
                    rmtuckerR Offline
                    rmtucker
                    wrote on last edited by
                    #9

                    Has Rssi been added to mysensors 2.1 ?

                    M J 2 Replies Last reply
                    0
                    • rmtuckerR rmtucker

                      Has Rssi been added to mysensors 2.1 ?

                      M Offline
                      M Offline
                      mihai.aldea
                      wrote on last edited by
                      #10

                      @rmtucker said:

                      Has Rssi been added to mysensors 2.1 ?

                      Yes. You can pull it using transportGetRSSI(). From there on, use it just as it is or shape it more nicely with a map() function, it's up to you. But please note that 2.1.0 brings some slight changes so if your sketch throws some errors, just read them and change your sketch accordingly. Eg. #define MY_RF69_FREQUENCY RFM69_433MHZ is replaced by #define MY_RFM69_FREQUENCY RFM69_433MHZ, notice the extra "M".

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

                        Well, finally we have decided to wait for releasing the new rfm69 drivers.
                        Because

                        • there was already so much changes/improvements in Mysensors to release.
                        • to keep a better history, and the new rfm69 driver has lot of improvements.

                        That said, for w5100 users, we have tested the new driver (not the one on my repo) and it works ok with w5100 and rfm69 in hardware spi mode, on same bus, without changing the w5100 lib.

                        So Mysensors 2.1 still use the old driver. The new rfm69 driver is planned for 2.2. No eta as far as i know, but with luck, let's see when it will release.

                        1 Reply Last reply
                        2
                        • rmtuckerR Offline
                          rmtuckerR Offline
                          rmtucker
                          wrote on last edited by
                          #12

                          I am totally confused now?
                          So Rssi data is not available?

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

                            @rmtucker no it is not available in 2.1. this will be for 2.2

                            M 1 Reply Last reply
                            0
                            • scalzS scalz

                              @rmtucker no it is not available in 2.1. this will be for 2.2

                              M Offline
                              M Offline
                              mihai.aldea
                              wrote on last edited by
                              #14

                              @scalz Just to make it clear. The RFM69 RSSI value is not available in the official MySensors 2.1.0 release but it is available in your GitHub fork here: https://github.com/scalz/Mysensors/tree/rfm69_update2. Is that correct?

                              1 Reply Last reply
                              0
                              • hekH Offline
                                hekH Offline
                                hek
                                Admin
                                wrote on last edited by
                                #15

                                Yes RSSI is a work in progress available in @scalz fork. We didn't have time to test it enough to include it in the 2.1 release.

                                M 1 Reply Last reply
                                0
                                • hekH hek

                                  Yes RSSI is a work in progress available in @scalz fork. We didn't have time to test it enough to include it in the 2.1 release.

                                  M Offline
                                  M Offline
                                  mihai.aldea
                                  wrote on last edited by
                                  #16

                                  @hek I confirm that the RSSI support works perfect in scalz's fork.

                                  mfalkviddM 1 Reply Last reply
                                  0
                                  • M mihai.aldea

                                    @hek I confirm that the RSSI support works perfect in scalz's fork.

                                    mfalkviddM Offline
                                    mfalkviddM Offline
                                    mfalkvidd
                                    Mod
                                    wrote on last edited by
                                    #17

                                    @mihai.aldea it is not just about verifying RSSI. It is about verifying that the changes don't break anything else for existing users. Unfortunately, the new driver does break things and most users would dislike an upgrade that breaks their existing system.

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      mihai.aldea
                                      wrote on last edited by
                                      #18

                                      This is perfectly understandable but I merely wanted to give a raw input on the feature status.
                                      I consider the RSSI values to be paramount when testing MySensors along with new hardware (antennas, wall penetration, registry tweaks etc.) as the simple online/offline node status would not help very much with these scenarios. That's why for the time being I will stick to scalz's rfm69_update2.

                                      1 Reply Last reply
                                      1
                                      • rmtuckerR rmtucker

                                        Has Rssi been added to mysensors 2.1 ?

                                        J Offline
                                        J Offline
                                        jpaulin
                                        wrote on last edited by jpaulin
                                        #19

                                        @rmtucker In my RFM69 sensors using ver2.1 I'm doing as follows to check RSSI and, as well, how to check the background noise level. I have them implemented as two sensor values being reported every 5 minutes in the loop() to the gateway and controller.

                                        void loop()      
                                        {
                                          float humidity = dht.readHumidity();       // get dht22 humidity
                                          if (isnan(humidity)) {
                                            Serial.println("Failed reading humidity from DHT");
                                          } else {
                                            send(msgHum.set(humidity, 1));           // send dht22 humidity
                                          }
                                        
                                          float temperature = dht.readTemperature(); // get dht22 temperature
                                          if (isnan(temperature)) {
                                            Serial.println("Failed reading temperature from DHT");
                                          } else {
                                            send(msgTemp.set(temperature, 1));       // send dht22 temperature
                                          }
                                          digitalWrite(DHT22_PWR,LOW);               // save some power. Turn off dht22 module.
                                          
                                          rssi = _radio.readRSSI();                  // read RSSI in RFM69. Measure reception signal level from gw
                                          send(msgRSSI1.set(rssi));                  // send RSSI, signal level to gateway
                                        
                                          wait(500);                                 // wait to get idle
                                          rssi = _radio.readRSSI();                  // read RSSI in RFM69. Measure background noise
                                          send(msgRSSI2.set(rssi));                  // send RSSI, noise level to gateway
                                          
                                          sleep(SLEEP_TIME);                         // sleep a bit
                                          digitalWrite(DHT22_PWR,HIGH);              // wake up dht22 module
                                          wait(2000);                                // warm up dht22 module
                                        }
                                        

                                        To get the RSSI value it's read in the sketch ( int rssi = _radio.readRSSI(); ) immediately after sending something, in this case the dht22 temperature. To check the background noise the RSSI level is read again 500ms after being kept idle (probably a shorter waiting period would work as well, but haven't studied it as it's not a critical issue for me). Normally the background noise-floor should be something around -95dBm and -115dBm. If you have some external interference, it could be easily detected with this method.

                                        rmtuckerR 1 Reply Last reply
                                        2
                                        • J jpaulin

                                          @rmtucker In my RFM69 sensors using ver2.1 I'm doing as follows to check RSSI and, as well, how to check the background noise level. I have them implemented as two sensor values being reported every 5 minutes in the loop() to the gateway and controller.

                                          void loop()      
                                          {
                                            float humidity = dht.readHumidity();       // get dht22 humidity
                                            if (isnan(humidity)) {
                                              Serial.println("Failed reading humidity from DHT");
                                            } else {
                                              send(msgHum.set(humidity, 1));           // send dht22 humidity
                                            }
                                          
                                            float temperature = dht.readTemperature(); // get dht22 temperature
                                            if (isnan(temperature)) {
                                              Serial.println("Failed reading temperature from DHT");
                                            } else {
                                              send(msgTemp.set(temperature, 1));       // send dht22 temperature
                                            }
                                            digitalWrite(DHT22_PWR,LOW);               // save some power. Turn off dht22 module.
                                            
                                            rssi = _radio.readRSSI();                  // read RSSI in RFM69. Measure reception signal level from gw
                                            send(msgRSSI1.set(rssi));                  // send RSSI, signal level to gateway
                                          
                                            wait(500);                                 // wait to get idle
                                            rssi = _radio.readRSSI();                  // read RSSI in RFM69. Measure background noise
                                            send(msgRSSI2.set(rssi));                  // send RSSI, noise level to gateway
                                            
                                            sleep(SLEEP_TIME);                         // sleep a bit
                                            digitalWrite(DHT22_PWR,HIGH);              // wake up dht22 module
                                            wait(2000);                                // warm up dht22 module
                                          }
                                          

                                          To get the RSSI value it's read in the sketch ( int rssi = _radio.readRSSI(); ) immediately after sending something, in this case the dht22 temperature. To check the background noise the RSSI level is read again 500ms after being kept idle (probably a shorter waiting period would work as well, but haven't studied it as it's not a critical issue for me). Normally the background noise-floor should be something around -95dBm and -115dBm. If you have some external interference, it could be easily detected with this method.

                                          rmtuckerR Offline
                                          rmtuckerR Offline
                                          rmtucker
                                          wrote on last edited by
                                          #20

                                          @jpaulin
                                          Thank you so much for the info that rssi can be extracted in V2.1.0.
                                          Would you be able to post your full sketch as it would be easier for me to extract the bits i need.?
                                          I just can not understand why before your answer i was being told it is not possible in V2.1.0 to do this?
                                          Or does this need another version of the Rfm69 library?

                                          J 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          9

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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