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. [SOLVED] latest git-snapshot causes freezes

[SOLVED] latest git-snapshot causes freezes

Scheduled Pinned Locked Moved Troubleshooting
46 Posts 6 Posters 9.7k Views 5 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.
  • cimba007C Offline
    cimba007C Offline
    cimba007
    wrote on last edited by
    #11

    no sleep = fine
    no i2c-communiction/no interrupts = fine

    both = lockup

    1 Reply Last reply
    0
    • cimba007C Offline
      cimba007C Offline
      cimba007
      wrote on last edited by
      #12

      I noticed that I can make the node crash if I trigger some interrupts by force (moving the accelerometer) .. nice ..

      I guess the sleep/interrupt code has some kind of bug since the latest rework in the developer branch.

      1 Reply Last reply
      0
      • ikkeTI Offline
        ikkeTI Offline
        ikkeT
        wrote on last edited by
        #13

        I hope you catch it, as I believe I'm hit by the same bug. It the happens similar way on Sensebender Micro & NRF24L01+. I have a thread on troubleshooting forum with topic of interrupt mystery. I'm arduino newbie, so I'm not much help. I'm just about to try it on Arduino Pro mini just for comparison.

        Somehow the enbling of interrupts lock it within a minute or so. If no interrupt enabled, no locking.

        BR,
        Ikke

        cimba007C 1 Reply Last reply
        0
        • ikkeTI ikkeT

          I hope you catch it, as I believe I'm hit by the same bug. It the happens similar way on Sensebender Micro & NRF24L01+. I have a thread on troubleshooting forum with topic of interrupt mystery. I'm arduino newbie, so I'm not much help. I'm just about to try it on Arduino Pro mini just for comparison.

          Somehow the enbling of interrupts lock it within a minute or so. If no interrupt enabled, no locking.

          BR,
          Ikke

          cimba007C Offline
          cimba007C Offline
          cimba007
          wrote on last edited by
          #14

          @ikkeT Are you using the latest stable or snapshot version?

          tekkaT ikkeTI 2 Replies Last reply
          0
          • cimba007C cimba007

            @ikkeT Are you using the latest stable or snapshot version?

            tekkaT Offline
            tekkaT Offline
            tekka
            Admin
            wrote on last edited by tekka
            #15

            @cimba007 Thanks, I'll try to reproduce it. What Arduino IDE & AVR Board defs are you using?
            @ikkeT Same here, can you upload your (minimal) sketch to reproduce and also indicate MySensors, Arduino IDE and AVR board def versions?

            cimba007C ikkeTI 2 Replies Last reply
            0
            • scalzS Offline
              scalzS Offline
              scalz
              Hardware Contributor
              wrote on last edited by scalz
              #16

              @cimba007
              just an idea..i don't know if it can help at all..but it looks there is a while loop in FaBo3Axis::readI2c
              do you think if adding some debug here you get something??
              i was just thinking..a freeze that's weird..no wdt?

              cimba007C 1 Reply Last reply
              0
              • tekkaT tekka

                @cimba007 Thanks, I'll try to reproduce it. What Arduino IDE & AVR Board defs are you using?
                @ikkeT Same here, can you upload your (minimal) sketch to reproduce and also indicate MySensors, Arduino IDE and AVR board def versions?

                cimba007C Offline
                cimba007C Offline
                cimba007
                wrote on last edited by
                #17

                @tekka Arduiono 1.6.12

                ##############################################################
                # Add the new board to boards.txt (normally located at "C:\Program Files\Arduino\hardware\arduino\avr"
                # The *.bootloader.* etries only matters if you want to program bootloader (and fuses) from Arduino IDE. 
                # See http://www.engbedded.com/fusecalc (select Atmega328p) for interpretation of fuse values and how 
                # extended fuses are written in different applications (07h in Arduino IDE = FFh in Atmel studio).
                ##############################################################
                
                apm96.name=APM Optiboot internal 1MHz noBOD 9600baud
                
                apm96.upload.tool=avrdude
                apm96.upload.protocol=arduino
                apm96.upload.maximum_size=32256
                apm96.upload.speed=9600
                apm96.bootloader.tool=avrdude
                apm96.bootloader.low_fuses=0x62
                apm96.bootloader.high_fuses=0xde
                apm96.bootloader.extended_fuses=0x06
                apm96.bootloader.path=optiboot_v50
                apm96.bootloader.file=atmega328_1a.hex
                apm96.bootloader.unlock_bits=0x3F
                apm96.bootloader.lock_bits=0x2F
                apm96.build.board=AVR_APM96
                apm96.build.mcu=atmega328p
                apm96.build.f_cpu=1000000L
                apm96.build.core=arduino
                apm96.build.variant=standard
                
                ##############################################################
                

                I changed the fuses to include BDOUT @ 1,8Volt
                VCC of my setup is 2-3Volt

                1 Reply Last reply
                0
                • scalzS scalz

                  @cimba007
                  just an idea..i don't know if it can help at all..but it looks there is a while loop in FaBo3Axis::readI2c
                  do you think if adding some debug here you get something??
                  i was just thinking..a freeze that's weird..no wdt?

                  cimba007C Offline
                  cimba007C Offline
                  cimba007
                  wrote on last edited by cimba007
                  #18

                  @scalz Thanks for the hint with the while-loop. I changed the i2c-read the following way:

                  void FaBo3Axis::readI2c(uint8_t register_addr, uint8_t num, uint8_t buffer[])
                  {
                    Wire.beginTransmission(_i2caddr);
                    Wire.write(register_addr);
                    Wire.endTransmission();
                  
                    Wire.requestFrom(_i2caddr, num);
                  
                    int i = 0;
                    uint8_t limit = num;
                    while(Wire.available() && limit--)
                    {
                  	Serial.print("r");
                      buffer[i] = Wire.read();
                      i++;
                    }
                  }
                  

                  Now it should under no circumstanced read more then the number given. Sadly this had no impact:

                   | 34291
                  34291 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                  34357 TSF:MSG:ACK
                  134390 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                  r34471 MCO:SLP:MS=16,SMS=0,I1=1,M1=3,I2=255,M2=255
                  34537 MCO:SLP:TPD
                  34553 MCO:SLP:WUP=1
                   | 34553
                  34553 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                  34553 TSF:MSG:ACK
                  134553 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                  

                  Just before the sleep ..

                  I then added a Serial.flush() to the "r"-output ..

                  void FaBo3Axis::readI2c(uint8_t register_addr, uint8_t num, uint8_t buffer[])
                  {
                  	Serial.print("readI2c");
                  	Serial.flush();
                    Wire.beginTransmission(_i2caddr);
                    Wire.write(register_addr);
                    Wire.endTransmission();
                  
                    Wire.requestFrom(_i2caddr, num);
                  
                    int i = 0;
                    uint8_t limit = num;
                    while(Wire.available() && limit--)
                    {
                  	Serial.print("r");
                  	Serial.flush();
                      buffer[i] = Wire.read();
                      i++;
                    }
                  }
                  
                  54706 MCO:SLP:WUP=1
                   | 54706
                  54706 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                  54706 TSF:MSG:ACK
                  154706 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                  

                  Now the freeze is clearly before entering the sleep function ..

                  but then .. on another round ..

                   | 56623
                  56623 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                  56623 TSF:MSG:ACK
                  156623 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                  readI2c
                  
                  readI2cgot # from slave: 1
                  r78987 MCO:SLP:MS=16,SMS=0,I1=1,M1=3,I2=255,M2=255
                  79052 MCO:SLP:TPD
                  79069 MCO:SLP:WUP=1
                   | 79069
                  79069 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                  79069 TSF:MSG:ACK
                  179069 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                  readI2c
                  

                  So .. your tip was very good .. it seems to be related to the

                    Wire.beginTransmission(_i2caddr);
                    Wire.write(register_addr);
                    Wire.endTransmission();
                  

                  -call .. only one questions remains .. why was it working perfectly on the stable library?

                  Just to be sure I will run exactly the same code in a non-stop loop with the stable library ..

                  tekkaT 1 Reply Last reply
                  0
                  • cimba007C cimba007

                    @scalz Thanks for the hint with the while-loop. I changed the i2c-read the following way:

                    void FaBo3Axis::readI2c(uint8_t register_addr, uint8_t num, uint8_t buffer[])
                    {
                      Wire.beginTransmission(_i2caddr);
                      Wire.write(register_addr);
                      Wire.endTransmission();
                    
                      Wire.requestFrom(_i2caddr, num);
                    
                      int i = 0;
                      uint8_t limit = num;
                      while(Wire.available() && limit--)
                      {
                    	Serial.print("r");
                        buffer[i] = Wire.read();
                        i++;
                      }
                    }
                    

                    Now it should under no circumstanced read more then the number given. Sadly this had no impact:

                     | 34291
                    34291 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                    34357 TSF:MSG:ACK
                    134390 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                    r34471 MCO:SLP:MS=16,SMS=0,I1=1,M1=3,I2=255,M2=255
                    34537 MCO:SLP:TPD
                    34553 MCO:SLP:WUP=1
                     | 34553
                    34553 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                    34553 TSF:MSG:ACK
                    134553 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                    

                    Just before the sleep ..

                    I then added a Serial.flush() to the "r"-output ..

                    void FaBo3Axis::readI2c(uint8_t register_addr, uint8_t num, uint8_t buffer[])
                    {
                    	Serial.print("readI2c");
                    	Serial.flush();
                      Wire.beginTransmission(_i2caddr);
                      Wire.write(register_addr);
                      Wire.endTransmission();
                    
                      Wire.requestFrom(_i2caddr, num);
                    
                      int i = 0;
                      uint8_t limit = num;
                      while(Wire.available() && limit--)
                      {
                    	Serial.print("r");
                    	Serial.flush();
                        buffer[i] = Wire.read();
                        i++;
                      }
                    }
                    
                    54706 MCO:SLP:WUP=1
                     | 54706
                    54706 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                    54706 TSF:MSG:ACK
                    154706 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                    

                    Now the freeze is clearly before entering the sleep function ..

                    but then .. on another round ..

                     | 56623
                    56623 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                    56623 TSF:MSG:ACK
                    156623 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                    readI2c
                    
                    readI2cgot # from slave: 1
                    r78987 MCO:SLP:MS=16,SMS=0,I1=1,M1=3,I2=255,M2=255
                    79052 MCO:SLP:TPD
                    79069 MCO:SLP:WUP=1
                     | 79069
                    79069 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                    79069 TSF:MSG:ACK
                    179069 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                    readI2c
                    

                    So .. your tip was very good .. it seems to be related to the

                      Wire.beginTransmission(_i2caddr);
                      Wire.write(register_addr);
                      Wire.endTransmission();
                    

                    -call .. only one questions remains .. why was it working perfectly on the stable library?

                    Just to be sure I will run exactly the same code in a non-stop loop with the stable library ..

                    tekkaT Offline
                    tekkaT Offline
                    tekka
                    Admin
                    wrote on last edited by
                    #19

                    @cimba007 What AVR board defs are you on?

                    1 Reply Last reply
                    0
                    • cimba007C Offline
                      cimba007C Offline
                      cimba007
                      wrote on last edited by
                      #20

                      @tekka said:

                      AVR board def

                      What do you mean with AVR board def?

                      https://forum.mysensors.org/topic/4999/latest-git-snapshot-causes-freezes/17

                      I am using an arduino pro-mini china clone (328p) with 8mhz internal oscillator and DIV_8 fuse.

                      The bootloader is an "APM Optiboot 1Mhz" .. cant find the link right now.

                      tekkaT 1 Reply Last reply
                      0
                      • cimba007C cimba007

                        @tekka said:

                        AVR board def

                        What do you mean with AVR board def?

                        https://forum.mysensors.org/topic/4999/latest-git-snapshot-causes-freezes/17

                        I am using an arduino pro-mini china clone (328p) with 8mhz internal oscillator and DIV_8 fuse.

                        The bootloader is an "APM Optiboot 1Mhz" .. cant find the link right now.

                        tekkaT Offline
                        tekkaT Offline
                        tekka
                        Admin
                        wrote on last edited by tekka
                        #21

                        @cimba007 You'll find the information in your Boards Manager (under Tools | Board | Boards Manager)

                        1 Reply Last reply
                        0
                        • cimba007C Offline
                          cimba007C Offline
                          cimba007
                          wrote on last edited by
                          #22

                          yeah .. sorry

                          0_1475435692355_upload-68958f1f-2d52-4640-bdf0-b33688831f9f

                          tekkaT 1 Reply Last reply
                          0
                          • cimba007C cimba007

                            yeah .. sorry

                            0_1475435692355_upload-68958f1f-2d52-4640-bdf0-b33688831f9f

                            tekkaT Offline
                            tekkaT Offline
                            tekka
                            Admin
                            wrote on last edited by
                            #23

                            @cimba007 ok, do you see it hapepening if you downgrade the AVR board defs to 1.6.12 or 13?

                            1 Reply Last reply
                            0
                            • cimba007C Offline
                              cimba007C Offline
                              cimba007
                              wrote on last edited by
                              #24

                              btw .. the "old" library is running happy for 6 minutes now ... still continuing

                              TSP:MSG:READ 0-0-14 s=0,c=1,t=16,pt=2,l=2,sg=0:0
                              1TSP:MSG:SEND 14-14-0-0 s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=ok:0
                              readI2cgot # from slave: 1
                              r | 373997
                              TSP:MSG:READ 0-0-14 s=0,c=1,t=16,pt=2,l=2,sg=0:0
                              1TSP:MSG:SEND 14-14-0-0 s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=ok:0
                              readI2cgot # from slave: 1
                              r | 374177

                              @tekka: I will try the "new snapshot" with the board defs you mentioned .. standby

                              1 Reply Last reply
                              0
                              • cimba007C Offline
                                cimba007C Offline
                                cimba007
                                wrote on last edited by
                                #25

                                @1.6.12 board defs

                                r68550 MCO:SLP:MS=16,SMS=0,I1=1,M1=3,I2=255,M2=255
                                68599 MCO:SLP:TPD
                                68632 MCO:SLP:WUP=1
                                 | 68632
                                68632 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                                68632 TSF:MSG:ACK
                                168632 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                readI2c
                                

                                @1.6.13 board defs

                                readI2cgot # from slave: 1
                                r62914 MCO:SLP:MS=16,SMS=0,I1=1,M1=3,I2=255,M2=255
                                62980 MCO:SLP:TPD
                                62996 MCO:SLP:WUP=1
                                 | 62996
                                62996 TSF:MSG:READ,0-0-14,s=0,c=1,t=16,pt=2,l=2,sg=0:0
                                62996 TSF:MSG:ACK
                                162996 TSF:MSG:SEND,14-14-0-0,s=0,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
                                readI2c
                                
                                1 Reply Last reply
                                0
                                • scalzS Offline
                                  scalzS Offline
                                  scalz
                                  Hardware Contributor
                                  wrote on last edited by scalz
                                  #26

                                  hmm..too bad that didn't do the trick..but there was something (and that's an issue which can appear easily when using other libs, "hidden" while) and difficult to reproduce exactly the same case on my side as i'm not using the same radio.
                                  i've dl the latest snpashot. so i will check on my side if one of my sketch is still running fine (with 4ints) and if i get the problem i'll try to debug it too. but i hope to not get it lol :)

                                  1 Reply Last reply
                                  0
                                  • cimba007C Offline
                                    cimba007C Offline
                                    cimba007
                                    wrote on last edited by
                                    #27

                                    That would be nice .. my latest findings point out that the i2c-function is getting stuck. I investigated the i2c-source of arduino a bit and found out it is quite depending on interrupts.

                                    This is now

                                    wild speculation

                                    For some reason interrupts got disabled while the i2c library is trying to write some data on the i2c-bus ..

                                    wild-speculation-end

                                    1 Reply Last reply
                                    1
                                    • cimba007C Offline
                                      cimba007C Offline
                                      cimba007
                                      wrote on last edited by cimba007
                                      #28

                                      Code working: (4minutes+)

                                        sei();
                                        fabo3axis.readIntStatus();
                                      

                                      Code not working:

                                        //sei();
                                        fabo3axis.readIntStatus();
                                      

                                      I noticed that interrupts in the sleep function are only detached if the intrrupt occurs ..

                                      whereas in the stable

                                      	detachInterrupt(interrupt1);
                                      	if (interrupt2!=0xFF) detachInterrupt(interrupt2);
                                      

                                      They get detached after the wakeup in the sleep ..

                                      What if .. for some strange reason the interrupt is interfearing with .. whatever?!

                                      EDIT: with the added sei(); the node is running for 10 minutes now ...
                                      EDIT2: Running for 20 minutes now ..

                                      1 Reply Last reply
                                      1
                                      • cimba007C cimba007

                                        @ikkeT Are you using the latest stable or snapshot version?

                                        ikkeTI Offline
                                        ikkeTI Offline
                                        ikkeT
                                        wrote on last edited by
                                        #29

                                        @cimba007 I cloned the master branch from git about week ago. Or which ever is the default. I'll come back tomorrow, already in bed now.

                                        1 Reply Last reply
                                        0
                                        • tekkaT tekka

                                          @cimba007 Thanks, I'll try to reproduce it. What Arduino IDE & AVR Board defs are you using?
                                          @ikkeT Same here, can you upload your (minimal) sketch to reproduce and also indicate MySensors, Arduino IDE and AVR board def versions?

                                          ikkeTI Offline
                                          ikkeTI Offline
                                          ikkeT
                                          wrote on last edited by
                                          #30

                                          @tekka the scetch is here along with the libraries, just use it as Arduino folder to reproduce:

                                          https://github.com/ikke-t/sensebender

                                          I'll check the versions tomorrow (UTC+3). The arduino ide is 1.6.xx whatever is the very latest in Fedora 24.

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


                                          25

                                          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