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. Troubleshooting
  3. RFM gateway and sensors node with range issue

RFM gateway and sensors node with range issue

Scheduled Pinned Locked Moved Troubleshooting
14 Posts 6 Posters 144 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.
  • W Offline
    W Offline
    wiredfrank
    wrote on last edited by
    #3

    @mfalkvidd thank you for quick reply, that was my copy/paste as my code is mess and i tried to paste as clean as i could hence this mistake, but i m using RFM69 radio. if rfm69 isnt lora radio then it mean range isn't going to be more then 15 to 20metter ? :cry: may be this is the problem? should i switch to rfm 95 for longer range? (i feel stupid now)

    Gateway powered on and this is on serial output

    MCO:BGN:INIT GW,CP=RPNGE---,REL=255,VER=2.3.1
    109 TSF:LRT:OK
    125 TSM:INIT
    139 TSF:WUR:MS=0
    157 TSM:INIT:TSP OK
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 7
    cnt
    connected with wifinet, channel 7
    dhcp client start...
    ip:192.168.1.5,mask:255.255.255.0,gw:192.168.1.1
    372 TSM:INIT:GW MODE
    394 TSM:READY:ID=0,PAR=0,DIS=0
    427 MCO:REG:NOT NEEDED
    451 MCO:BGN:STP
    545 MCO:BGN:INIT OK,TSP=1
    629 TSM:READY:NWD REQ
    1156 TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    

    sensors powered on and on gateway

    96189 TSF:MSG:READ,30-30-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    96250 TSF:MSG:BC
    96268 TSF:MSG:FPAR REQ,ID=30
    96298 TSF:PNG:SEND,TO=0
    96323 TSF:CKU:OK
    96341 TSF:MSG:GWL OK
    96980 TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    98261 TSF:MSG:READ,30-30-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    98322 TSF:MSG:PINGED,ID=30,HP=1
    99128 TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    99256 TSF:MSG:READ,30-30-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    100031 TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    100662 TSF:MSG:READ,30-30-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.3.1
    101229 TSF:MSG:READ,30-30-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    103299 TSF:MSG:READ,30-30-0,s=255,c=3,t=11,pt=0,l=18,sg=0:Temperature Sensor
    103867 TSF:MSG:READ,30-30-0,s=255,c=3,t=12,pt=0,l=4,sg=0:0.01
    105334 TSF:MSG:READ,30-30-0,s=0,c=0,t=6,pt=0,l=0,sg=0:
    106400 TSF:MSG:READ,30-30-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    107440 TSF:MSG:SEND,0-0-30-30,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    108074 TSF:MSG:READ,30-30-0,s=1,c=1,t=38,pt=7,l=5,sg=0:5.80
    108643 TSF:MSG:READ,30-30-0,s=255,c=3,t=0,pt=1,l=1,sg=0:164
    109530 TSF:MSG:READ,30-30-0,s=0,c=1,t=0,pt=7,l=5,sg=0:21.0
    165820 TSF:MSG:READ,30-30-0,s=1,c=1,t=38,pt=7,l=5,sg=0:4.72
    166505 TSF:MSG:READ,30-30-0,s=255,c=3,t=0,pt=1,l=1,sg=0:110
    167395 TSF:MSG:READ,30-30-0,s=0,c=1,t=0,pt=7,l=5,sg=0:20.8
    
    1 Reply Last reply
    1
    • S Offline
      S Offline
      Sasquatch
      wrote on last edited by Sasquatch
      #4

      Your node sketch is configured as HW model but you said you're using standard radio on it

      comment out line below

      #define MY_IS_RFM69HW
      

      in sketch running radio without 6 legged chip next to ant pin

      Been there done that, but I was getting 10 cm range on coil type aerials ;)

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wiredfrank
        wrote on last edited by
        #5

        i tried both radio types but can not get range more than 20m max in open air, tried coil type antenna, and all sorts things including capacitor from 10uf to 100uf, i m sure there is something missing in my setup i just dont know what it is, even nrf with pcb antenna perform better in open air, i wonder if any one even using rfm69 at all or it just me banging my head around.

        S 1 Reply Last reply
        0
        • electrikE Offline
          electrikE Offline
          electrik
          wrote on last edited by
          #6

          Like @mfalkvidd said, if you use the new driver, you have to use it on all of the nodes and the gateway, as it doesn't work together with the old one.
          You said your code is a mess, maybe it is better to step back and use examples for both the node and the gateway and start from there. If that is working you can add your code. Just to exclude something is overlooked.

          1 Reply Last reply
          1
          • W wiredfrank

            i tried both radio types but can not get range more than 20m max in open air, tried coil type antenna, and all sorts things including capacitor from 10uf to 100uf, i m sure there is something missing in my setup i just dont know what it is, even nrf with pcb antenna perform better in open air, i wonder if any one even using rfm69 at all or it just me banging my head around.

            S Offline
            S Offline
            Sasquatch
            wrote on last edited by Sasquatch
            #7

            @wiredfrank roll back to old driver, use 17cm(433Mhz)/8.5cm(868 MHz) piece of straight wire as antenna.
            Solder extra 100-470uf capacitor directly to supply pins of the radios too, especially HW versions. Transient current spikes can cause all sorts of problems.

            I'm using rfm69 mixed HW and non HW versions , and 500m meters is easily achieved, even on spider dupont wire connections and 2.4v supply(2x nimh aa cells).

            also, don't rely on controller for connection tests, use debug serial output on both ends to confirm link.

            1 Reply Last reply
            0
            • W Offline
              W Offline
              wiredfrank
              wrote on last edited by
              #8

              Thank you for suggestion, is there any sketch for ping pong type communicate to do some testing?

              scalzS 1 Reply Last reply
              0
              • W wiredfrank

                Thank you for suggestion, is there any sketch for ping pong type communicate to do some testing?

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

                @wiredfrank
                in your gw sketch, your defines should be like this:

                #define MY_RADIO_RFM69
                #define MY_RFM69_NEW_DRIVER
                #define MY_RFM69_FREQUENCY RFM69_433MHZ // Set your frequency here
                #define MY_IS_RFM69HW // Omit if your RFM is not "H"
                #define MY_RFM69_IRQ_PIN D1
                #define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN
                #define MY_RFM69_CS_PIN D8 // NSS. Use MY_RFM69_SPI_CS for older versions (before 2.2.0)
                

                and there is the RFM69_RFM95_ATC_SignalReport.ino sketch for your node, in mysensors examples

                /*
                 * 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-2019 Sensnology AB
                 * Full contributor list: https://github.com/mysensors/MySensors/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.
                 *
                 *******************************
                 *
                 * REVISION HISTORY
                 * Version 1.0 - tekka
                 *
                 * DESCRIPTION
                 * ATC mode settings and signal report functions, on RFM69 and RFM95 nodes
                 *
                 */
                
                // Enable debug prints
                #define MY_DEBUG
                
                // Enable and select radio type attached
                
                // RFM69
                #define MY_RADIO_RFM69
                #define MY_RFM69_NEW_DRIVER   // ATC on RFM69 works only with the new driver (not compatible with old=default driver)
                #define MY_RFM69_FREQUENCY RFM69_433MHZ
                //#define MY_RFM69_ATC_TARGET_RSSI_DBM (-70)  // target RSSI -70dBm
                //#define MY_RFM69_MAX_POWER_LEVEL_DBM (10)   // max. TX power 10dBm = 10mW
                
                // RFM95
                //#define MY_RADIO_RFM95
                //#define MY_RFM95_ATC_TARGET_RSSI_DBM (-70)  // target RSSI -70dBm
                //#define MY_RFM95_MAX_POWER_LEVEL_DBM (10)   // max. TX power 10dBm = 10mW
                
                #include <MySensors.h>
                
                // ID of the sensor child
                #define CHILD_ID_UPLINK_QUALITY (0)
                #define CHILD_ID_TX_LEVEL       (1)
                #define CHILD_ID_TX_PERCENT     (2)
                #define CHILD_ID_TX_RSSI        (3)
                #define CHILD_ID_RX_RSSI        (4)
                #define CHILD_ID_TX_SNR         (5)
                #define CHILD_ID_RX_SNR         (6)
                
                
                // Initialize general message
                MyMessage msgTxRSSI(CHILD_ID_TX_RSSI, V_CUSTOM);
                MyMessage msgRxRSSI(CHILD_ID_RX_RSSI, V_CUSTOM);
                MyMessage msgTxSNR(CHILD_ID_TX_SNR, V_CUSTOM);
                MyMessage msgRxSNR(CHILD_ID_RX_SNR, V_CUSTOM);
                MyMessage msgTxLevel(CHILD_ID_TX_LEVEL, V_CUSTOM);
                MyMessage msgTxPercent(CHILD_ID_TX_PERCENT, V_CUSTOM);
                MyMessage msgUplinkQuality(CHILD_ID_UPLINK_QUALITY, V_CUSTOM);
                
                void setup()
                {
                }
                
                
                void presentation()
                {
                	// Send the sketch version information to the gateway and controller
                	sendSketchInfo("ATC", "1.0");
                
                	// Register all sensors to gw (they will be created as child devices)
                	present(CHILD_ID_UPLINK_QUALITY, S_CUSTOM, "UPLINK QUALITY RSSI");
                	//present(CHILD_ID_TX_LEVEL, S_CUSTOM, "TX LEVEL DBM");
                	//present(CHILD_ID_TX_PERCENT, S_CUSTOM, "TX LEVEL PERCENT");
                	//present(CHILD_ID_TX_RSSI, S_CUSTOM, "TX RSSI");
                	//present(CHILD_ID_RX_RSSI, S_CUSTOM, "RX RSSI");
                	//present(CHILD_ID_TX_SNR, S_CUSTOM, "TX SNR");
                	//present(CHILD_ID_RX_SNR, S_CUSTOM, "RX SNR");
                }
                
                void loop()
                {
                	// send messages to GW
                	send(msgUplinkQuality.set(transportGetSignalReport(SR_UPLINK_QUALITY)));
                	//send(msgTxLevel.set(transportGetSignalReport(SR_TX_POWER_LEVEL)));
                	//send(msgTxPercent.set(transportGetSignalReport(SR_TX_POWER_PERCENT)));
                	// retrieve RSSI / SNR reports from incoming ACK
                	//send(msgTxRSSI.set(transportGetSignalReport(SR_TX_RSSI)));
                	//send(msgRxRSSI.set(transportGetSignalReport(SR_RX_RSSI)));
                	//send(msgTxSNR.set(transportGetSignalReport(SR_TX_SNR)));
                	//send(msgRxSNR.set(transportGetSignalReport(SR_RX_SNR)));
                    Serial.print("UPLINK QUALITY RSSI=");
                    Serial.println(transportInternalToRSSI(_transportSM.uplinkQualityRSSI)); // UPLINK QUALITY RSSI
                Serial.print("TX LEVEL DBM=");    
                Serial.println(transportGetTxPowerLevel());  //TX LEVEL DBM
                Serial.print("TX LEVEL PERCENT="); 
                    Serial.println(transportGetTxPowerPercent());  // TX LEVEL PERCENT
                Serial.print("RX RSSI=");
                    Serial.println(transportGetReceivingRSSI());  //RX RSSI
                Serial.print("TX RSSI=");
                    Serial.println(transportGetSendingRSSI());    //TX RSSI
                
                	// wait a bit
                	wait(5000);
                }
                

                This is in case your modules are 433mhz. Try with a straight wire (one core), with the right length. You can also reduce some length by small bits and see if it improves.
                Good to know is 433mhz requires longer antenna, and bigger gnd plane for better results, compared to upper freq like 866mhz etc.
                A last solution if the gnd plane size would be the culprit could be to use a dipole antenna for test. by connecting two opposite wires. one to ant, the other to gnd close to ant

                You should be able to get more than nrf24 or some nrf52, easily :)
                I don't think you need rfm95 but that depends on the range you really need. that said some lora modules are maybe a bit more power efficient (more recent tech). but I think it's a detail for your usecase

                Can't help you on esp8266 pin mapping, I don't use it as gw (I've esp32, nrf52 and samd as gateways for prod and dev)

                Note: the new rfm driver has compatible communication for rfm69<->rfm95. Like others said, for using new driver, you need to enable it on both ends (gw+nodes) because it uses a different packet format than old driver.

                1 Reply Last reply
                0
                • W Offline
                  W Offline
                  wiredfrank
                  wrote on last edited by
                  #10

                  Thank you everyone for reply, i been searching around for antenna and how to test them and came across this guy.
                  https://www.youtube.com/watch?v=ZpKoLvqOWyc&t

                  i m thinking to buy one of these VNA as i m shooting in dark with antenna right now and no way of knowing what is going on under the hood, i dont mind spending more to get miniVNA Tiny+ but what you experts think?

                  zboblamontZ 1 Reply Last reply
                  0
                  • W wiredfrank

                    Thank you everyone for reply, i been searching around for antenna and how to test them and came across this guy.
                    https://www.youtube.com/watch?v=ZpKoLvqOWyc&t

                    i m thinking to buy one of these VNA as i m shooting in dark with antenna right now and no way of knowing what is going on under the hood, i dont mind spending more to get miniVNA Tiny+ but what you experts think?

                    zboblamontZ Offline
                    zboblamontZ Offline
                    zboblamont
                    wrote on last edited by
                    #11

                    @wiredfrank It's a bit of overkill to be honest for hobby purposes, a quarter wave wire works fine when cut to the recommended dimension, or if concerned over the groundplane, a dipole as outlined by @scalz above.

                    A VNA is typically used to determine the exact resonant frequency of an antenna, if it's out by a fraction it won't make much difference in performance.

                    1 Reply Last reply
                    0
                    • W Offline
                      W Offline
                      wiredfrank
                      wrote on last edited by
                      #12

                      @zboblamont thank you, i think part of my problem might be allowed frequency is 868MHz as compare with mine 433MHz :( (school boy error) i have ordered 898MHz module and i will give them try.

                      zboblamontZ 1 Reply Last reply
                      0
                      • W wiredfrank

                        @zboblamont thank you, i think part of my problem might be allowed frequency is 868MHz as compare with mine 433MHz :( (school boy error) i have ordered 898MHz module and i will give them try.

                        zboblamontZ Offline
                        zboblamontZ Offline
                        zboblamont
                        wrote on last edited by
                        #13

                        @wiredfrank Not sure what you meant by 433MHz not being allowed, so far as I recall that band is permitted worldwide but has transmit duration restrictions as it's a shared band.
                        I started off with the 433MHz RFMs and never had the slightest issue, penetrating walls and floors with plenty of range outside, even at one stage buried in snow.
                        The range and penetration of 868 v 433 will be slightly reduced, but performance should still be better than 2.4GHz.
                        The point about the recommended wire length being close enough remains valid

                        1 Reply Last reply
                        0
                        • W Offline
                          W Offline
                          wiredfrank
                          wrote on last edited by
                          #14

                          sorry i wasn't clear in my reply, in my country 868MHz is listed allowed frequency.

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


                          28

                          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