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. Bug Reports
  3. 1.4 SerialGateway freezes

1.4 SerialGateway freezes

Scheduled Pinned Locked Moved Bug Reports
serialgateway
19 Posts 4 Posters 6.9k Views 1 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.
  • H hek

    @Yveaux

    Would be great if you have some kind of idea . How/where did you mean I should flush?

    @Goppo
    Do you have the amplified radio version on you gateway? I'm suspecting a powering issue. In the cases where the sensor is shut down your gateway-radio will send a burst 15 messages. This could very well cause some issues if you get a voltage drop.

    G Offline
    G Offline
    Goppo
    wrote on last edited by
    #8

    @hek
    Yes I do,
    Thanks for the tip. I will try if lowering the PA level.

    1 Reply Last reply
    0
    • H hek

      @Yveaux

      Would be great if you have some kind of idea . How/where did you mean I should flush?

      @Goppo
      Do you have the amplified radio version on you gateway? I'm suspecting a powering issue. In the cases where the sensor is shut down your gateway-radio will send a burst 15 messages. This could very well cause some issues if you get a voltage drop.

      Y Offline
      Y Offline
      Yveaux
      Mod
      wrote on last edited by
      #9

      @hek said:

      Would be great if you have some kind of idea . How/where did you mean I should flush?

      On a failed transmit the message stays in the tx buffer iirr, have to look it up in the data sheet. If this is the case you have to explicitly clear the tx buffer. I'll come back to this; no time right now...

      http://yveaux.blogspot.nl

      1 Reply Last reply
      0
      • H hek

        @Yveaux

        Would be great if you have some kind of idea . How/where did you mean I should flush?

        @Goppo
        Do you have the amplified radio version on you gateway? I'm suspecting a powering issue. In the cases where the sensor is shut down your gateway-radio will send a burst 15 messages. This could very well cause some issues if you get a voltage drop.

        Y Offline
        Y Offline
        Yveaux
        Mod
        wrote on last edited by
        #10

        @hek Looked it up in the datasheet:

        If the TX FIFO (PRX) contains more than one payload to a PTX, payloads are handled using the first in –
        first out principle. The TX FIFO (PRX) is blocked if all pending payloads are addressed to a PTX where the
        link is lost. In this case, the MCU can flush the TX FIFO (PRX) by using the FLUSH_TX command.
        .....
        While executing the Auto Retransmit feature, the number of retransmits can reach the maximum number
        defined in ARC. If this happens, the nRF24L01+ asserts the MAX_RT IRQ and returns to standby-I mode.
        .....
        MAX_RT IRQ is asserted if the auto retransmit counter (ARC_CNT) exceeds the programmed maximum limit
        (ARC). In Figure 24. the packet transmission ends with a MAX_RT IRQ. The payload in TX FIFO is NOT
        removed and the MCU decides the next step in the protocol. A toggle of the CE starts a new transmitting
        sequence of the same packet. The payload can be removed from the TX FIFO using the FLUSH_TX command.

        The FIFO is 3 entries big, so 3 successive failed transmissions to the same destination will block the transmission.
        This FIFO needs to be flushed after a failed transmission (indicated by the MAX_RT IRQ) by executing the FLUSH_TX command.
        Add the following method to the NRF24 class:

        uint8_t RF24::flush_tx(void)
        {
          return spiTrans( FLUSH_TX );
        }
        

        and when you're at it, please also add (used e.g. by the sniffer):

        uint8_t RF24::flush_rx(void)
        {
          return spiTrans( FLUSH_RX );
        }
        

        This might very well be a very nasted bug bugging the 1.4 users...

        http://yveaux.blogspot.nl

        H 1 Reply Last reply
        0
        • Y Yveaux

          @hek Looked it up in the datasheet:

          If the TX FIFO (PRX) contains more than one payload to a PTX, payloads are handled using the first in –
          first out principle. The TX FIFO (PRX) is blocked if all pending payloads are addressed to a PTX where the
          link is lost. In this case, the MCU can flush the TX FIFO (PRX) by using the FLUSH_TX command.
          .....
          While executing the Auto Retransmit feature, the number of retransmits can reach the maximum number
          defined in ARC. If this happens, the nRF24L01+ asserts the MAX_RT IRQ and returns to standby-I mode.
          .....
          MAX_RT IRQ is asserted if the auto retransmit counter (ARC_CNT) exceeds the programmed maximum limit
          (ARC). In Figure 24. the packet transmission ends with a MAX_RT IRQ. The payload in TX FIFO is NOT
          removed and the MCU decides the next step in the protocol. A toggle of the CE starts a new transmitting
          sequence of the same packet. The payload can be removed from the TX FIFO using the FLUSH_TX command.

          The FIFO is 3 entries big, so 3 successive failed transmissions to the same destination will block the transmission.
          This FIFO needs to be flushed after a failed transmission (indicated by the MAX_RT IRQ) by executing the FLUSH_TX command.
          Add the following method to the NRF24 class:

          uint8_t RF24::flush_tx(void)
          {
            return spiTrans( FLUSH_TX );
          }
          

          and when you're at it, please also add (used e.g. by the sniffer):

          uint8_t RF24::flush_rx(void)
          {
            return spiTrans( FLUSH_RX );
          }
          

          This might very well be a very nasted bug bugging the 1.4 users...

          H Offline
          H Offline
          hek
          Admin
          wrote on last edited by
          #11

          @Yveaux

          Ohh.. interesting.

          So are you saying we should flush_tx after every failed send? Or only after 3 consecutive send-fails to the same address?

          Y 1 Reply Last reply
          0
          • H hek

            @Yveaux

            Ohh.. interesting.

            So are you saying we should flush_tx after every failed send? Or only after 3 consecutive send-fails to the same address?

            Y Offline
            Y Offline
            Yveaux
            Mod
            wrote on last edited by
            #12

            @hek after every failed send.

            http://yveaux.blogspot.nl

            H 1 Reply Last reply
            0
            • Y Yveaux

              @hek after every failed send.

              H Offline
              H Offline
              hek
              Admin
              wrote on last edited by
              #13

              @Yveaux

              Can you make some tests perhaps? And create a pull req with the changes in RF24 and MySensor.cpp if you see any improvements?

              Y 1 Reply Last reply
              0
              • H hek

                @Yveaux

                Can you make some tests perhaps? And create a pull req with the changes in RF24 and MySensor.cpp if you see any improvements?

                Y Offline
                Y Offline
                Yveaux
                Mod
                wrote on last edited by
                #14

                @hek will take some time but I'll see what I can do. I'll get back with some data.

                http://yveaux.blogspot.nl

                H 1 Reply Last reply
                0
                • Y Yveaux

                  @hek will take some time but I'll see what I can do. I'll get back with some data.

                  H Offline
                  H Offline
                  hek
                  Admin
                  wrote on last edited by
                  #15

                  @Yveaux

                  Take your time. We don't have any deadlines or bosses hanging over the shoulder here :smile:

                  Y 1 Reply Last reply
                  0
                  • H hek

                    @Yveaux

                    Take your time. We don't have any deadlines or bosses hanging over the shoulder here :smile:

                    Y Offline
                    Y Offline
                    Yveaux
                    Mod
                    wrote on last edited by
                    #16

                    @hek true, but I have a gut feeling some troubles reported on this forum lately could be related to this. Furthermore I've seen strange repeated messages on air, but didn't investigate yet...

                    http://yveaux.blogspot.nl

                    H 1 Reply Last reply
                    0
                    • Y Yveaux

                      @hek true, but I have a gut feeling some troubles reported on this forum lately could be related to this. Furthermore I've seen strange repeated messages on air, but didn't investigate yet...

                      H Offline
                      H Offline
                      hek
                      Admin
                      wrote on last edited by
                      #17

                      @Yveaux

                      One shouldn't underestimate a gut feeling. They are often proven to be right.

                      Y 1 Reply Last reply
                      0
                      • H hek

                        @Yveaux

                        One shouldn't underestimate a gut feeling. They are often proven to be right.

                        Y Offline
                        Y Offline
                        Yveaux
                        Mod
                        wrote on last edited by
                        #18

                        @hek Ok, gut feeling was wrong this time ;-)
                        Buried deep inside the nRF24 driver (RF24::write) is standard flush when transmission fails:

                        //Max retries exceeded
                        if( status & _BV(MAX_RT)){
                          flush_tx(); //Only going to be 1 packet int the FIFO at a time using this method, so just flush
                          return 0;
                        }
                        

                        http://yveaux.blogspot.nl

                        H 1 Reply Last reply
                        0
                        • Y Yveaux

                          @hek Ok, gut feeling was wrong this time ;-)
                          Buried deep inside the nRF24 driver (RF24::write) is standard flush when transmission fails:

                          //Max retries exceeded
                          if( status & _BV(MAX_RT)){
                            flush_tx(); //Only going to be 1 packet int the FIFO at a time using this method, so just flush
                            return 0;
                          }
                          
                          H Offline
                          H Offline
                          hek
                          Admin
                          wrote on last edited by
                          #19

                          @Yveaux

                          Ohh.. nice digging anyway.

                          1 Reply Last reply
                          0

                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                          With your input, this post could be even better 💗

                          Register Login
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          8

                          Online

                          12.0k

                          Users

                          11.2k

                          Topics

                          113.4k

                          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