Encoder function hangs

gomez9656
Posts: 15
Joined: Mon Mar 14, 2022 7:48 pm

Encoder function hangs

Postby gomez9656 » Tue Oct 17, 2023 10:10 pm

Hello there!

I'm working on an ESP32 in the Arduino framework with a FreeRTOS architecture.

I use a task to control an MCP GPIO expander with 4 encoders working on it. The code also uses wifi, mqtt, displays, and a stepper motor.

Occasionally, my encoder task is not responding, but the motor task keeps running the motor.

This is killing me because the encoder uses a stop button to stop the motor for safety, and not being able to stop the motor is pretty concerning.

I would like to ask if someone has seen a similar issue with wifi / mqtt tasks. I think that the wifi task is hanging when the wifi or mqtt drops.

The wifi / mqtt task is running in a different core than the encoder task. The encoder task has a priority of 23.

I would appreciate any help on how to start tracking this issue because I haven't been able to replicate it.

Thanks a lot in advance

Who is online

Users browsing this forum: No registered users and 56 guests