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. Repeater node crashes

Repeater node crashes

Scheduled Pinned Locked Moved Troubleshooting
16 Posts 3 Posters 3.5k Views 3 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.
  • mimaretM Offline
    mimaretM Offline
    mimaret
    wrote on last edited by
    #6

    @rejoe2 Thank you for your reply.
    I seemed to have read that for a repeater it was necessary to replace delay () by wait (). . .
    I will adapt my program according to your recommendations and keep you informed.

    Home Assistant, Raspi MQTT Gateway , nodes MySensors

    mfalkviddM 1 Reply Last reply
    0
    • mimaretM mimaret

      @rejoe2 Thank you for your reply.
      I seemed to have read that for a repeater it was necessary to replace delay () by wait (). . .
      I will adapt my program according to your recommendations and keep you informed.

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

      @mimaret could you post the debug output from before and during the crash?
      What you're doing should work. The debug output usually gives useful info on why things don't work the way they are supposed to.

      Also, check the power problem flowchart on the page @rejoe2 linked earlier. PA_MAX puts very high stress on the power supply. My guess is that this is related to insufficient power stability.

      1 Reply Last reply
      0
      • mimaretM Offline
        mimaretM Offline
        mimaret
        wrote on last edited by
        #8

        @mfalkvidd Thank you for your reply.
        I do not think about power problem. The power supply can deliver 1A and I mounted a capacitor of 470 uF on the 3.3v and a 47 uF close to the radio module. I had doubts about hardware and I set up a second repeater.
        On the first repeater, radio module nrf24L01 + PA + LNA. On the second repeater, radio module nrf24L01 +. Same problem.
        When the repeater crashes, the interrupt is executed again. The led pin 13 that I do not manage is ON during normal operation and goes OFF when the repeater crashes.
        I noticed that by disabling the interrupt (// attachInterrupt (....), the repeater does not crash.
        I will look how to check the state of memory, stack, etc.
        I also include the debug output and I do not see anything particular.

        Home Assistant, Raspi MQTT Gateway , nodes MySensors

        1 Reply Last reply
        0
        • mimaretM Offline
          mimaretM Offline
          mimaret
          wrote on last edited by
          #9

          OOPS :

          19820560 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
          ------> Door
          19820560 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
          ------> Door
          19825700 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
          ------> Door
          19826745 !TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=NACK:0
          ------> Door
          19826745 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=1,st=OK:0
          19826747 TSF:MSG:READ,255-255-255,s=255,c=7,t=255,pt=7,l=25,sg=1: 0
          19826755 !TSF:MSG:LEN,7!=32
          ------> readDHT
          20105310 TSF:MSG:SEND,111-111-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:42.4
          H: 42.40
          ------> read1Wire
          20105426
          ------> readDHT
          20405309 TSF:MSG:SEND,111-111-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:21.8
          T: 21.80
          20405323 TSF:MSG:SEND,111-111-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:42.1
          H: 42.10
          ------> read1Wire
          20405440
          20700045 TSF:SAN:OK
          ------> readDHT
          20705310 TSF:MSG:SEND,111-111-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:41.9
          H: 41.90
          ------> read1Wire
          20705427
          ------> Door
          20707352 !TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=NACK:1
          ------> Door
          20707352 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=1,st=OK:0
          ------> Door
          20723965 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
          ------> Door
          20725862 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
          ------> Door
          20725862 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
          <------------------------------------CRASH-----------------
          ------> Door
          20729143 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
          ------> Door
          20730232 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
          ------> Door
          20730232 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
          

          Home Assistant, Raspi MQTT Gateway , nodes MySensors

          mfalkviddM 1 Reply Last reply
          0
          • mimaretM mimaret

            OOPS :

            19820560 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
            ------> Door
            19820560 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
            ------> Door
            19825700 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
            ------> Door
            19826745 !TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=NACK:0
            ------> Door
            19826745 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=1,st=OK:0
            19826747 TSF:MSG:READ,255-255-255,s=255,c=7,t=255,pt=7,l=25,sg=1: 0
            19826755 !TSF:MSG:LEN,7!=32
            ------> readDHT
            20105310 TSF:MSG:SEND,111-111-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:42.4
            H: 42.40
            ------> read1Wire
            20105426
            ------> readDHT
            20405309 TSF:MSG:SEND,111-111-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:21.8
            T: 21.80
            20405323 TSF:MSG:SEND,111-111-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:42.1
            H: 42.10
            ------> read1Wire
            20405440
            20700045 TSF:SAN:OK
            ------> readDHT
            20705310 TSF:MSG:SEND,111-111-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:41.9
            H: 41.90
            ------> read1Wire
            20705427
            ------> Door
            20707352 !TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=NACK:1
            ------> Door
            20707352 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=1,st=OK:0
            ------> Door
            20723965 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
            ------> Door
            20725862 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
            ------> Door
            20725862 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
            <------------------------------------CRASH-----------------
            ------> Door
            20729143 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
            ------> Door
            20730232 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
            ------> Door
            20730232 TSF:MSG:SEND,111-111-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
            
            mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #10

            @mimaret could you describe what you mean ny "crash"? I thought you meant that the node rebooted, but I see now that my assumption was wrong.

            1 Reply Last reply
            0
            • mimaretM Offline
              mimaretM Offline
              mimaret
              wrote on last edited by
              #11

              In fact, the node no longer executes the program and the only solution is to restart it with a reset or switch off the power supply.

              Home Assistant, Raspi MQTT Gateway , nodes MySensors

              mfalkviddM 1 Reply Last reply
              0
              • mimaretM mimaret

                In fact, the node no longer executes the program and the only solution is to restart it with a reset or switch off the power supply.

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

                @mimaret strange. The (re)start should be visible in the debug output. Did you cut it out?

                1 Reply Last reply
                0
                • mimaretM Offline
                  mimaretM Offline
                  mimaret
                  wrote on last edited by
                  #13

                  There is no restart. Only the interrupt executes when I open the door contact. The Loop () does not continue. I did not cut anything, I just added the crash line as soon as the program stopped.

                  Home Assistant, Raspi MQTT Gateway , nodes MySensors

                  mfalkviddM 1 Reply Last reply
                  0
                  • mimaretM mimaret

                    There is no restart. Only the interrupt executes when I open the door contact. The Loop () does not continue. I did not cut anything, I just added the crash line as soon as the program stopped.

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

                    @mimaret thanks for explaining.

                    I think the problem lies in calling send from within the interrupt handler. Interrupt handlers are supposed to execute very quickly. Usually they just set a flag that there is work to be done, and return.

                    From https://learn.adafruit.com/multi-tasking-the-arduino-part-2/interrupt-etiquette

                    Code in the ISR should not call anything that requires interrupts to be active (e.g. delay() or anything that uses the i2c bus). This will result in hanging your program.

                    From the debug output, send fails. That means the node must have tried to send, waited for acknowledgement until timeout, tried to send again and waited and so on until the max number of attempts is reached. That's way too much time to spend inside an interrupt handler. And the radio use

                    Try to only set a variable inside the interrupt handler, and perform the send from inside loop instead.

                    Also see https://arduino.stackexchange.com/questions/30968/how-do-interrupts-work-on-the-arduino-uno-and-similar-boards/30969

                    1 Reply Last reply
                    1
                    • mimaretM Offline
                      mimaretM Offline
                      mimaret
                      wrote on last edited by
                      #15

                      A big thank you for your contribution. I modified the program according to your proposals. Everything is working. I am attaching you the pieces of code relating to the door contact.
                      My problem is solved.

                      .
                      .
                      .
                        attachInterrupt(digitalPinToInterrupt(DOOR_PIN), DoorMoving, CHANGE);
                        DoorChange = 1;
                        LastDoor = 0;
                      }
                      void DoorMoving() {
                          DoorChange = 1;
                      }
                      
                      void readDoor() {
                        if (DoorChange) {
                          boolean Door = (digitalRead(DOOR_PIN));
                          if (Door != LastDoor) {
                            send(msgDoor.set((Door) == HIGH ? 1 : 0));
                            LastDoor = Door;
                            DoorChange = 0;
                          }
                        }
                      }
                      .
                      .
                      .
                      void loop() {
                        unsigned long currentMillis = millis();
                        readDoor();
                        if (currentMillis - previousMillis >= UPDATE_INTERVAL) {
                          previousMillis = currentMillis;
                          readDHT();
                          read1Wire();
                        }
                      }

                      Home Assistant, Raspi MQTT Gateway , nodes MySensors

                      mfalkviddM 1 Reply Last reply
                      1
                      • mimaretM mimaret

                        A big thank you for your contribution. I modified the program according to your proposals. Everything is working. I am attaching you the pieces of code relating to the door contact.
                        My problem is solved.

                        .
                        .
                        .
                          attachInterrupt(digitalPinToInterrupt(DOOR_PIN), DoorMoving, CHANGE);
                          DoorChange = 1;
                          LastDoor = 0;
                        }
                        void DoorMoving() {
                            DoorChange = 1;
                        }
                        
                        void readDoor() {
                          if (DoorChange) {
                            boolean Door = (digitalRead(DOOR_PIN));
                            if (Door != LastDoor) {
                              send(msgDoor.set((Door) == HIGH ? 1 : 0));
                              LastDoor = Door;
                              DoorChange = 0;
                            }
                          }
                        }
                        .
                        .
                        .
                        void loop() {
                          unsigned long currentMillis = millis();
                          readDoor();
                          if (currentMillis - previousMillis >= UPDATE_INTERVAL) {
                            previousMillis = currentMillis;
                            readDHT();
                            read1Wire();
                          }
                        }
                        mfalkviddM Offline
                        mfalkviddM Offline
                        mfalkvidd
                        Mod
                        wrote on last edited by
                        #16

                        @mimaret great work! Thanks for posting your solution.

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


                        22

                        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