hiveeyes / hanimandl

HaniMandl ist ein halbautomatischer Honig-Abfüll-Roboter.
https://hanimandl.readthedocs.io/
GNU General Public License v3.0
38 stars 28 forks source link

Random crashes when using the rotary encoder #32

Closed InstructionDecode closed 1 year ago

InstructionDecode commented 1 year ago

Compiled the code and flashed it on the Heltec. The program starts and when I try to change settings the response is very slow and by using the rotary encoder the program crashes at a random point. The serial monitor shows some kind of exception in the task scheduler. Going to investigate the reasons and post the error message later.

InstructionDecode commented 1 year ago

assert failed: taskSelectHighestPriorityTaskSMP tasks.c:3446 (xTaskScheduled == pdTRUE)

Backtrace:0x40084688:0x3ffbd4000x3ffbd4bd:0x3ffbd4e0 |<-CORRUPTED

ELF file SHA256: 0000000000000000

doc2005 commented 1 year ago

same issue on esp32 wroom. setting version of espressif to 3.5.0 does not help at all

amotl commented 1 year ago

Dear @InstructionDecode,

thank you for submitting GH-33, and good to hear that this works for you. @doc2005: Could you elaborate what does not work?

Maybe @ClemensGruber outlined the correct solution how to modify the code at https://community.hiveeyes.org/t/kann-ich-auch-das-heltec-wifi-kit-32-in-der-neuen-version-v3-verwenden/4696/37?

For me the code runs stable if I comment out the line about 307 (depending on the code version): // if ( rotating ) delay (1); // wait a little until the bouncing is done

Maybe the code at the develop branch already includes those changes, and others. It is not easy to figure out and pinpoint a specific commit, because commit messages have been obfuscated.

What about doing proper versioning using Git tags, and continuing development on the main branch instead, @ClemensGruber? Let me know if you need assistance on this.

With kind regards, Andreas.

amotl commented 1 year ago

Maybe the code at the develop branch already includes those changes, and others?

It does!

https://github.com/ClemensGruber/hani-mandl/blob/2ce2b9f05a5fff6ab9590a491a08fa32d12f738e/hani-mandl.ino#L391-L393

That's the translation of the corresponding inline comment:

// Commented out, because probably the delay in the ISR function triggers a reset from ESP32 Arduino core version ≥ 2.x. // Observe if bouncing becomes a problem with this, in rudimentary tests I (cg) could not observe anything negative.

That's the corresponding changelog item:

2023-01 Clemens Gruber | 0.2.13

  • pin-Anpassungen für Hardware-Version V3 des Heltec "WiFi Kit 32 V3" mit wieder mal geändertem pin-Layout
  • Anpassungen für den ESP32 Arduino core Version ≥ 2.x
    • Display, U8g2: HW statt SW im constructor (ggf. Probleme mit älteren Heltec-Versionen)
    • Rotary: de-bouncing code im isr2 auskommentiert, da sie zu Abstürzen führte

Translation of the bottom item:

Rotary: de-bouncing code in isr2 commented out as it caused crashes.

amotl commented 1 year ago

What about doing proper versioning using Git tags, and continuing development on the main branch instead, @ClemensGruber?

It would be really sweet, to save others from needing to spend hours of debugging to resolve this issue again and again.

ClemensGruber commented 1 year ago

master / mainis now updated to the latest developbranch and rotary should also work with now work.