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. Linux gateway don't receive Ack

Linux gateway don't receive Ack

Scheduled Pinned Locked Moved Troubleshooting
16 Posts 5 Posters 1.7k 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.
  • F freynder

    @diogoc
    Hi,
    I'm having a similar problem and found your post.

    From looking at the code I understand the CSMA entries mean that the transceiver is waiting for the channel to clear up before transmitting. So I suspect there must be some interference or a bad antenna.

    rozpruwaczR Offline
    rozpruwaczR Offline
    rozpruwacz
    wrote on last edited by rozpruwacz
    #3

    I had similar problems. What is happening is the rfm69 drivers is checking the rssi value before sending anything. If rssi is below some treshold the mesage is sent, and if not the driver waits 500ms and then it sends the message regardless of the rssi value. When message is send, the driver waits only 200ms for the ack, so if other end has high rssi value the ack is not received on time. So the problem is high rssi value before sending. In my case it was due to poor power supply so i would recommend powering the rfm module from separate low noise ldo regulator.

    1 Reply Last reply
    2
    • F Offline
      F Offline
      freynder
      wrote on last edited by freynder
      #4

      @rozpruwacz : Great suggestion about the power supply. I tested with a battery and added a decoupling capacitor but unfortunately that did not help in my case.

      I troubleshooted further by replacing boards, transceiver, the antenna. No improvement either.

      I'm now checking the code in detail and have a concern with the following function (v2.3.0):

      LOCAL bool RFM69_channelFree(void)
      {
      	// returns true if channel activity under RFM69_CSMA_LIMIT_DBM
      	const rfm69_RSSI_t RSSI = RFM69_readRSSI(false);
      	RFM69_DEBUG(PSTR("RFM69:CSMA:RSSI=%" PRIi16 "\n"), RFM69_internalToRSSI(RSSI));
      	return (RSSI > RFM69_RSSItoInternal(MY_RFM69_CSMA_LIMIT_DBM));
      }
      

      The function is supposed to compare RSSI with the threshold set in RFM69_CSMA_LIMIT_DBM.
      If RSSI is above the threshold then it should return true.
      However, the comparison is made with the internal representation which is defined as - (2*value)

      Since both values are negated, wouldn't the comparison operator need to be inversed as well?
      e.g.: RSSI = -80 , limit = -95
      -80 > -95 so the function should return true
      converted to internal presentation this should be:
      160 < 190 so it should also return true
      however, the function does:
      160 > 190 --> false

      Am I missing something here?

      mfalkviddM 1 Reply Last reply
      0
      • F freynder

        @rozpruwacz : Great suggestion about the power supply. I tested with a battery and added a decoupling capacitor but unfortunately that did not help in my case.

        I troubleshooted further by replacing boards, transceiver, the antenna. No improvement either.

        I'm now checking the code in detail and have a concern with the following function (v2.3.0):

        LOCAL bool RFM69_channelFree(void)
        {
        	// returns true if channel activity under RFM69_CSMA_LIMIT_DBM
        	const rfm69_RSSI_t RSSI = RFM69_readRSSI(false);
        	RFM69_DEBUG(PSTR("RFM69:CSMA:RSSI=%" PRIi16 "\n"), RFM69_internalToRSSI(RSSI));
        	return (RSSI > RFM69_RSSItoInternal(MY_RFM69_CSMA_LIMIT_DBM));
        }
        

        The function is supposed to compare RSSI with the threshold set in RFM69_CSMA_LIMIT_DBM.
        If RSSI is above the threshold then it should return true.
        However, the comparison is made with the internal representation which is defined as - (2*value)

        Since both values are negated, wouldn't the comparison operator need to be inversed as well?
        e.g.: RSSI = -80 , limit = -95
        -80 > -95 so the function should return true
        converted to internal presentation this should be:
        160 < 190 so it should also return true
        however, the function does:
        160 > 190 --> false

        Am I missing something here?

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

        @freynder internaltorssi will convert the internal value to rssi. So I don’t think that’s the case.

        Edit: Sorry, you might have a point. The rssi is indeed converted to internal. Looks strange.

        F 1 Reply Last reply
        0
        • mfalkviddM mfalkvidd

          @freynder internaltorssi will convert the internal value to rssi. So I don’t think that’s the case.

          Edit: Sorry, you might have a point. The rssi is indeed converted to internal. Looks strange.

          F Offline
          F Offline
          freynder
          wrote on last edited by
          #6

          @mfalkvidd said in Linux gateway don't receive Ack:

          @freynder internaltorssi will convert the internal value to rssi. So I don’t think that’s the case.

          Yes, that's my point. Both values in the comparison are in internal format so the comparison should be RSSI_internal < LIMIT_internal.

          Suppose an excellent RSSI: -30dbI . RSSI_internal = 60
          Limit is -95dbi. LIMIT_internal = 190
          so 60 < 190
          The function will return false although RSSI is excellent.

          mfalkviddM 1 Reply Last reply
          0
          • F freynder

            @mfalkvidd said in Linux gateway don't receive Ack:

            @freynder internaltorssi will convert the internal value to rssi. So I don’t think that’s the case.

            Yes, that's my point. Both values in the comparison are in internal format so the comparison should be RSSI_internal < LIMIT_internal.

            Suppose an excellent RSSI: -30dbI . RSSI_internal = 60
            Limit is -95dbi. LIMIT_internal = 190
            so 60 < 190
            The function will return false although RSSI is excellent.

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

            @freynder but if RSSI is excellent, it means someone else must be sending and the channel isn't free. So maybe the correct value is returned anyway in your calculation example (but the comparison is still strange)

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

              If the code was refactored like this I think it would do exactly the same thing, but it would be easier to follow:

              LOCAL bool RFM69_channelFree(void)
              {
              	// returns true if channel activity under RFM69_CSMA_LIMIT_DBM
              	const int16_t RSSI = RFM69_internalToRSSI(RFM69_readRSSI());
              	RFM69_DEBUG(PSTR("RFM69:CSMA:RSSI=%" PRIi16 "\n"), RSSI);
              	return (RSSI <= MY_RFM69_CSMA_LIMIT_DBM);
              }
              
              F 1 Reply Last reply
              0
              • mfalkviddM mfalkvidd

                If the code was refactored like this I think it would do exactly the same thing, but it would be easier to follow:

                LOCAL bool RFM69_channelFree(void)
                {
                	// returns true if channel activity under RFM69_CSMA_LIMIT_DBM
                	const int16_t RSSI = RFM69_internalToRSSI(RFM69_readRSSI());
                	RFM69_DEBUG(PSTR("RFM69:CSMA:RSSI=%" PRIi16 "\n"), RSSI);
                	return (RSSI <= MY_RFM69_CSMA_LIMIT_DBM);
                }
                
                F Offline
                F Offline
                freynder
                wrote on last edited by
                #9

                @mfalkvidd said in Linux gateway don't receive Ack:

                If the code was refactored like this I think it would do exactly the same thing, but it would be easier to follow:

                LOCAL bool RFM69_channelFree(void)
                {
                	// returns true if channel activity under RFM69_CSMA_LIMIT_DBM
                	const int16_t RSSI = RFM69_internalToRSSI(RFM69_readRSSI());
                	RFM69_DEBUG(PSTR("RFM69:CSMA:RSSI=%" PRIi16 "\n"), RSSI);
                	return (RSSI <= MY_RFM69_CSMA_LIMIT_DBM);
                }
                

                I think the comparsion should be > in this case. (e.g. -30 > -95)

                rozpruwaczR 1 Reply Last reply
                0
                • F freynder

                  @mfalkvidd said in Linux gateway don't receive Ack:

                  If the code was refactored like this I think it would do exactly the same thing, but it would be easier to follow:

                  LOCAL bool RFM69_channelFree(void)
                  {
                  	// returns true if channel activity under RFM69_CSMA_LIMIT_DBM
                  	const int16_t RSSI = RFM69_internalToRSSI(RFM69_readRSSI());
                  	RFM69_DEBUG(PSTR("RFM69:CSMA:RSSI=%" PRIi16 "\n"), RSSI);
                  	return (RSSI <= MY_RFM69_CSMA_LIMIT_DBM);
                  }
                  

                  I think the comparsion should be > in this case. (e.g. -30 > -95)

                  rozpruwaczR Offline
                  rozpruwaczR Offline
                  rozpruwacz
                  wrote on last edited by
                  #10

                  @freynder no, the function is correct. Before sending the rssi value read by this function should be lower than treshold -80dbm is not lower than - 95dbm. You should get rssi reprted around - 100dbm in this function but for some reason you have higher values.

                  F 1 Reply Last reply
                  0
                  • rozpruwaczR rozpruwacz

                    @freynder no, the function is correct. Before sending the rssi value read by this function should be lower than treshold -80dbm is not lower than - 95dbm. You should get rssi reprted around - 100dbm in this function but for some reason you have higher values.

                    F Offline
                    F Offline
                    freynder
                    wrote on last edited by
                    #11

                    @rozpruwacz

                    Ok, I must be missing something then. You say that the rssi should be around -100dbm for the channel to be clear? So lower is better for checking channel clearance? I thought higher was better.

                    rozpruwaczR 1 Reply Last reply
                    0
                    • F freynder

                      @rozpruwacz

                      Ok, I must be missing something then. You say that the rssi should be around -100dbm for the channel to be clear? So lower is better for checking channel clearance? I thought higher was better.

                      rozpruwaczR Offline
                      rozpruwaczR Offline
                      rozpruwacz
                      wrote on last edited by
                      #12

                      @freynder yes, the lower the better. You may be confused by this because the rssi is "Received Signal Strength Indication" so the higher the better, but in this function this indicator is used to check that nothing is receiving

                      F 1 Reply Last reply
                      0
                      • rozpruwaczR rozpruwacz

                        @freynder yes, the lower the better. You may be confused by this because the rssi is "Received Signal Strength Indication" so the higher the better, but in this function this indicator is used to check that nothing is receiving

                        F Offline
                        F Offline
                        freynder
                        wrote on last edited by
                        #13

                        @rozpruwacz Ok, got it now. Thank you very much.

                        1 Reply Last reply
                        0
                        • mfalkviddM mfalkvidd

                          @freynder but if RSSI is excellent, it means someone else must be sending and the channel isn't free. So maybe the correct value is returned anyway in your calculation example (but the comparison is still strange)

                          F Offline
                          F Offline
                          freynder
                          wrote on last edited by
                          #14

                          @mfalkvidd said in Linux gateway don't receive Ack:

                          @freynder but if RSSI is excellent, it means someone else must be sending and the channel isn't free. So maybe the correct value is returned anyway in your calculation example (but the comparison is still strange)

                          Indeed you were right. I had a wrong understanding on how RSSI was measured. It appears to be an indication of "the amount of energy available within the receiver channel bandwidth", so if nobody is sending it will be low.

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

                            And for newcomers, about rfm69 channel free, it helps to avoid some collisions, but this function+automatic powertransmit tuning helps to be better at FCC compatibility. RFM69 can go up to +20 dBm so it could create some mess in air..
                            FCC is related to

                            • hardware. Still, you can buy a fcc module but as soon as you place it on a custom board, so not exact same shape as manufacturer, FCC is not valid anymore. FCC is tested with specific manufacturer design, and when you change shape and layout of pcb, rf is not same as before, so FCC not ok ;)
                            • and software. You can have a FCC device, but if rf stack in framework don't check channel free etc then it's not FCC too
                            1 Reply Last reply
                            1
                            • D Offline
                              D Offline
                              diogoc
                              wrote on last edited by
                              #16

                              Ok, I understand now that the modules are measuring the noise signal strenght before sending someting.
                              Apparently the noise level is high, but with the other gateway I get low values.
                              It seems to be the linux gateway that is generating the noise ???
                              The RFM69 is powered by a separated LDO and capacitors, so I don't think it is a power supply problem.

                              The RFM69 linux driver is the same that arduino RFM69 driver? Could be some missing register parameterization?

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


                              8

                              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