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 5.3k 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.
  • hekH Offline
    hekH Offline
    hek
    Admin
    wrote on last edited by
    #2

    Haven't heard of this. Can you reproduce it again?

    epierreE GoppoG YveauxY 3 Replies Last reply
    0
    • hekH hek

      Haven't heard of this. Can you reproduce it again?

      epierreE Offline
      epierreE Offline
      epierre
      Hero Member
      wrote on last edited by
      #3

      @hek I'm not sure I can reproduce it since I read the serial port, but it happened twice yesterday for me... and the same program on a different machine (but in 1.3) never has this issue)

      z-wave - Vera -> Domoticz
      rfx - Domoticz <- MyDomoAtHome <- Imperihome
      mysensors -> mysensors-gw -> Domoticz

      1 Reply Last reply
      0
      • hekH hek

        Haven't heard of this. Can you reproduce it again?

        GoppoG Offline
        GoppoG Offline
        Goppo
        wrote on last edited by
        #4

        @hek yep, always with the result.

        1 Reply Last reply
        0
        • GoppoG Offline
          GoppoG Offline
          Goppo
          wrote on last edited by
          #5

          Damn.
          Yestersday I could freeze the gateway all the the time.
          2 minutes ago, it' worked.

          I will observe it and clarify the conditions

          1 Reply Last reply
          0
          • hekH hek

            Haven't heard of this. Can you reproduce it again?

            YveauxY Offline
            YveauxY Offline
            Yveaux
            Mod
            wrote on last edited by
            #6

            @hek Could it be that the transmit buffer is not flushed when a transmission fails after automatic-ack retrying?
            Didn't look in the code yet...

            http://yveaux.blogspot.nl

            hekH 1 Reply Last reply
            0
            • YveauxY Yveaux

              @hek Could it be that the transmit buffer is not flushed when a transmission fails after automatic-ack retrying?
              Didn't look in the code yet...

              hekH Offline
              hekH Offline
              hek
              Admin
              wrote on last edited by
              #7

              @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.

              GoppoG YveauxY 3 Replies Last reply
              0
              • hekH 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.

                GoppoG Offline
                GoppoG 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
                • hekH 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.

                  YveauxY Offline
                  YveauxY 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
                  • hekH 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.

                    YveauxY Offline
                    YveauxY 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

                    hekH 1 Reply Last reply
                    0
                    • YveauxY 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...

                      hekH Offline
                      hekH 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?

                      YveauxY 1 Reply Last reply
                      0
                      • hekH 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?

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

                        @hek after every failed send.

                        http://yveaux.blogspot.nl

                        hekH 1 Reply Last reply
                        0
                        • YveauxY Yveaux

                          @hek after every failed send.

                          hekH Offline
                          hekH 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?

                          YveauxY 1 Reply Last reply
                          0
                          • hekH 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?

                            YveauxY Offline
                            YveauxY 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

                            hekH 1 Reply Last reply
                            0
                            • YveauxY Yveaux

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

                              hekH Offline
                              hekH 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:

                              YveauxY 1 Reply Last reply
                              0
                              • hekH hek

                                @Yveaux

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

                                YveauxY Offline
                                YveauxY 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

                                hekH 1 Reply Last reply
                                0
                                • YveauxY 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...

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

                                  @Yveaux

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

                                  YveauxY 1 Reply Last reply
                                  0
                                  • hekH hek

                                    @Yveaux

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

                                    YveauxY Offline
                                    YveauxY 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

                                    hekH 1 Reply Last reply
                                    0
                                    • YveauxY 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;
                                      }
                                      
                                      hekH Offline
                                      hekH Offline
                                      hek
                                      Admin
                                      wrote on last edited by
                                      #19

                                      @Yveaux

                                      Ohh.. nice digging anyway.

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


                                      13

                                      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