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. RFM69 ATC not working?

RFM69 ATC not working?

Scheduled Pinned Locked Moved Troubleshooting
39 Posts 6 Posters 3.6k Views 7 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.
  • gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by
    #21

    This is how I monitor RSSI and power % from the node: sending RSSI should be close to the RSSI target value set in the config file. I left atc enabled and if I move the node away from the gateway I see the power % going up while RSSI value stays more or less the same.

    #ifdef MY_RADIO_RFM69
    	rssi = RFM69_getSendingRSSI();             // read RSSI in RFM69. Measure reception signal from gw
    	send(msgRSSI1.set(rssi));                  // send RSSI level
    	wait(500);                                 // wait to get idle
    
    	rssi = RFM69_getReceivingRSSI();           // read RSSI in RFM69. Wait and measure background noise
    	send(msgRSSI2.set(rssi));                  // send RSSI level
    	wait(200);                                 // wait for next send
    
    	PwrPcnt = RFM69_getTxPowerPercent();      // read TX Power in RFM69
    	send(msgPWR.set(PwrPcnt));				  // send TX Power
    #endif
    
    T 1 Reply Last reply
    1
    • T Offline
      T Offline
      TSD
      wrote on last edited by
      #22

      @mfalkvidd
      My code now looks pretty much the same as yours, except for the OTA stuff. But I don't see gateway messages in Domoticz. The node shows up with all its measurements.

      #define MY_DEBUG_VERBOSE_GATEWAY
      #include <MySensors.h>
      
      MyMessage msgRSSI(1,V_LEVEL);
      
      #define ARDUINO 100
      // This space is intended to be used to include arduino libraries
      
      #undef ARDUINO
      
      void setup()
      {
              // Setup locally attached sensors
      }
      
      void presentation()
      {
              // Present locally attached sensors here
      present(1,S_SOUND);
      
      }
      
      void loop()
      {
              // Send locally attached sensors data here
      }
      
      void receive(const MyMessage &message)
      {
        int16_t rssiReceive = RFM69_getReceivingRSSI();
        if (message.sender == 1 ) {
          send(msgRSSI.set(rssiReceive,0));
        }
      }
      

      Is the gateway supposed to show up as a measurement? Any idea why that doesn't happen?

      1 Reply Last reply
      0
      • gohanG gohan

        This is how I monitor RSSI and power % from the node: sending RSSI should be close to the RSSI target value set in the config file. I left atc enabled and if I move the node away from the gateway I see the power % going up while RSSI value stays more or less the same.

        #ifdef MY_RADIO_RFM69
        	rssi = RFM69_getSendingRSSI();             // read RSSI in RFM69. Measure reception signal from gw
        	send(msgRSSI1.set(rssi));                  // send RSSI level
        	wait(500);                                 // wait to get idle
        
        	rssi = RFM69_getReceivingRSSI();           // read RSSI in RFM69. Wait and measure background noise
        	send(msgRSSI2.set(rssi));                  // send RSSI level
        	wait(200);                                 // wait for next send
        
        	PwrPcnt = RFM69_getTxPowerPercent();      // read TX Power in RFM69
        	send(msgPWR.set(PwrPcnt));				  // send TX Power
        #endif
        
        T Offline
        T Offline
        TSD
        wrote on last edited by
        #23

        @gohan
        I added your code to my node. It gives exactly the same results as my own code. What kind of node are you using? Are you using the HW or W version of the RFM69?

        1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #24

          it works the same, of course if you have a HW version you will see TX power % lower compared to a W module. I am not using those functions on the gateway because they are actually more node related

          T 1 Reply Last reply
          0
          • gohanG gohan

            it works the same, of course if you have a HW version you will see TX power % lower compared to a W module. I am not using those functions on the gateway because they are actually more node related

            T Offline
            T Offline
            TSD
            wrote on last edited by TSD
            #25

            @gohan @mfalkvidd
            I think it is related to the Raspberry Pi implementation of MySensors. If I use an Arduino/RFM69 gateway, the RSSI is as expected. At close range, the power drops to the minimum possible level and the RSSI is strong. I noticed that the interrupt pin is toggled during communication, see picture below (orange is node current, blue is gateway interrupt).
            0_1540320711757_arduino-gateway_node-current_gw-interrupt.bmp

            If I use the Raspberry gateway (with origin/development-3.0.0 MySensors), I get the following result (orange is node current, yellow is gateway interrupt). The same result is obtained with MySensors 2.3.0 (origin/master). I couldn't get the origin/development version to compile. It gives an error about MY_DEBUGDEVICE.
            0_1540320810723_raspberry-gateway_node-current_gw-interrupt.bmp
            Apart from the much higher node current (and worse RSSI), the interrupt pin is always high and not toggled.

            Are you guys using a Raspberry gateway, or an Arduino gateway?

            I haven't had time to dig into to the MySensors code further, but does any of you know if this could be the problem?

            mfalkviddM 1 Reply Last reply
            0
            • T TSD

              @gohan @mfalkvidd
              I think it is related to the Raspberry Pi implementation of MySensors. If I use an Arduino/RFM69 gateway, the RSSI is as expected. At close range, the power drops to the minimum possible level and the RSSI is strong. I noticed that the interrupt pin is toggled during communication, see picture below (orange is node current, blue is gateway interrupt).
              0_1540320711757_arduino-gateway_node-current_gw-interrupt.bmp

              If I use the Raspberry gateway (with origin/development-3.0.0 MySensors), I get the following result (orange is node current, yellow is gateway interrupt). The same result is obtained with MySensors 2.3.0 (origin/master). I couldn't get the origin/development version to compile. It gives an error about MY_DEBUGDEVICE.
              0_1540320810723_raspberry-gateway_node-current_gw-interrupt.bmp
              Apart from the much higher node current (and worse RSSI), the interrupt pin is always high and not toggled.

              Are you guys using a Raspberry gateway, or an Arduino gateway?

              I haven't had time to dig into to the MySensors code further, but does any of you know if this could be the problem?

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

              @tsd nice work. I'm using an esp8266 gateway but I don't use atc.

              T 1 Reply Last reply
              0
              • gohanG Offline
                gohanG Offline
                gohan
                Mod
                wrote on last edited by
                #27

                I am using raspberry with both nrf24 and rfm69 gateway on it, but I am still version 2.2.0

                T 1 Reply Last reply
                0
                • D Offline
                  D Offline
                  diogoc
                  wrote on last edited by
                  #28

                  I have problems too with the linux gateway

                  link text

                  1 Reply Last reply
                  0
                  • gohanG gohan

                    I am using raspberry with both nrf24 and rfm69 gateway on it, but I am still version 2.2.0

                    T Offline
                    T Offline
                    TSD
                    wrote on last edited by
                    #29

                    @gohan
                    I just tried with the node on MySensors 2.2.0, but I get the same result. I cannot get the gateway to compile with 2.2.0, I get the following errors:

                    In file included from ./MySensors.h:49:0,
                                     from examples_linux/mysgw.cpp:83:
                    ./drivers/RFM69/new/RFM69_new.cpp: In function ‘bool RFM69_initialise(uint32_t)’:
                    ./MyConfig.h:716:26: error: ‘DEFAULT_RFM69_IRQ_NUM’ was not declared in this scope
                     #define MY_RFM69_IRQ_NUM DEFAULT_RFM69_IRQ_NUM
                                              ^
                    ./drivers/RFM69/new/RFM69_new.cpp:230:18: note: in expansion of macro ‘MY_RFM69_IRQ_NUM’
                      attachInterrupt(MY_RFM69_IRQ_NUM, RFM69_interruptHandler, RISING);
                                      ^~~~~~~~~~~~~~~~
                    In file included from ./MySensors.h:347:0,
                                     from examples_linux/mysgw.cpp:83:
                    ./hal/transport/MyTransportRFM69.cpp: In function ‘uint8_t transportReceive(void*)’:
                    ./hal/transport/MyTransportRFM69.cpp:80:54: error: ‘RFM69_recv’ was not declared in this scope
                      return RFM69_recv((uint8_t*)data, MAX_MESSAGE_LENGTH);
                                                                          ^
                    In file included from ./MySensors.h:343:0,
                                     from examples_linux/mysgw.cpp:83:
                    ./drivers/RFM69/new/RFM69_new.cpp: At global scope:
                    ./drivers/RFM69/new/RFM69_new.cpp:749:12: warning: ‘void RFM69_encrypt(const char*)’ defined but not used [-Wunused-function]
                     LOCAL void RFM69_encrypt(const char *key)
                                ^~~~~~~~~~~~~
                    ./drivers/RFM69/new/RFM69_new.cpp:599:12: warning: ‘void RFM69_ATCmode(bool, int16_t)’ defined but not used [-Wunused-function]
                     LOCAL void RFM69_ATCmode(const bool onOff, const int16_t targetRSSI)
                                ^~~~~~~~~~~~~
                    ./drivers/RFM69/new/RFM69_new.cpp:340:15: warning: ‘uint8_t RFM69_receive(uint8_t*, uint8_t)’ defined but not used [-Wunused-function]
                     LOCAL uint8_t RFM69_receive(uint8_t *buf, const uint8_t maxBufSize)
                    
                    

                    Do you have the gateway running with 2.2.0? And ATC works for the RFM69?

                    1 Reply Last reply
                    0
                    • mfalkviddM mfalkvidd

                      @tsd nice work. I'm using an esp8266 gateway but I don't use atc.

                      T Offline
                      T Offline
                      TSD
                      wrote on last edited by
                      #30

                      @mfalkvidd
                      And if you turn on ATC? Does that work? Are you on 2.3.0?

                      mfalkviddM 1 Reply Last reply
                      0
                      • T TSD

                        @mfalkvidd
                        And if you turn on ATC? Does that work? Are you on 2.3.0?

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

                        @tsd I don't know which version I am using. I'm currently travelling so I can't check easily.

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          TSD
                          wrote on last edited by
                          #32

                          @scalz
                          I found your name in the Raspberry Pi MySensor driver files. Would you happen to know why the RSSI measurement for a RPi gateway doesn't work? I'm having trouble getting ATC to work with my RPi gateway. It works well with an Arduino gateway.

                          1 Reply Last reply
                          0
                          • gohanG Offline
                            gohanG Offline
                            gohan
                            Mod
                            wrote on last edited by
                            #33

                            I still don't understand the need to measure RSSI on gateway...

                            T 1 Reply Last reply
                            0
                            • gohanG gohan

                              I still don't understand the need to measure RSSI on gateway...

                              T Offline
                              T Offline
                              TSD
                              wrote on last edited by
                              #34

                              @gohan
                              I couldn't get the RSSI measurement on the gateway to work, so I'm not doing that.

                              I want to get ATC to work. As ATC uses RSSI to optimize power, a correct RSSI measurement (on the node) is needed. ATC (and so the RSSI measurement) works well on an Arduino gateway, but not on a RPi.

                              As I don't have a software background and am still newish to MySensors, I'm hoping someone on the forum knows what to do. In the meantime, I'll keep digging myself :)

                              1 Reply Last reply
                              1
                              • gohanG Offline
                                gohanG Offline
                                gohan
                                Mod
                                wrote on last edited by
                                #35

                                But do the nodes increase power as they are moved farther away from the gateway?

                                mfalkviddM 1 Reply Last reply
                                0
                                • gohanG gohan

                                  But do the nodes increase power as they are moved farther away from the gateway?

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

                                  @gohan as TSD has already explained earlier in this thread, the ATC nodes always transmit on max power when using the raspberry pi gateway, regardless of distance.

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    prelektr
                                    wrote on last edited by
                                    #37

                                    Was there any follow up to this issue?

                                    I can confirm that ATC does not work using Rpi gateway. Well, it kind of works when you set very low MY_RFM69_ATC_TARGET_RSSI_DBM. I tried -100dBm and then the node is finally decreasing TX power to -2dbm. Anyway, when using Rpi as a gateway I can see (from node perspective) very low (-90) TX RSSI, whereas the same parameter is -26 when using arduino serial gateway (with the same close distance between node and the gateway).

                                    Since the TX RSSI is very low, then the ATC works only when you set your target to lower than that, like mine -100 setting for test purposes.

                                    1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      TSD
                                      wrote on last edited by
                                      #38

                                      @prelektr Because I wasn't making much progress, I gave up on this and added an Arduino Nano gateway that communicates with the RPi via UART. Then the ATC works. The Nano (clone) is just a $2 board, so it isn't a big deal to add it.

                                      1 Reply Last reply
                                      1
                                      • K Offline
                                        K Offline
                                        kted
                                        wrote on last edited by
                                        #39

                                        Any news from the developers on this issue?

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


                                        18

                                        Online

                                        11.7k

                                        Users

                                        11.2k

                                        Topics

                                        113.0k

                                        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