Description
Hello there.
Solving my last Problem Can be found here lead me to a new Problem.
Because of reasons I don’t understand my HX711 Scale A/D Converter and LittlevGL can’t work together.
My ESP Code has 2 boot options.
Wakeup from Deepsleep by touch -> go to GUI
Wakeup from Deepsleep by timer -> go read your sensors and go back to deepsleep
My GUI has a button for going to Deepsleep. If I click this Button the ESP goes to deepsleep but the GUI is still drawn to the display and is frozen even if he wakes up.
Then after awakening from deepsleep HX711 and the half dead rests of LittlevGL are conflicting and the ESP dies.
What MCU/Processor/Board and compiler are you using?
ESP32, Wroom32, Devkit C, Arduino IDE
What do you want to achieve?
If I press the Deepsleep button on the GUI i want that my Display goes dead again before entering deepsleep mode.
Is there a way to end LittlevGL and the GUI? This would be really great.
What have you tried so far?
I searched the Forum and the documentation but didn’t find anything helpful.
I changed the esp_deep_sleep_start(); command against ESP.restart(); but the GUI keeps drawn on the Display and the ESP is crashing when the HX711 code is called. Just a
Code to reproduce
This is my code for the the 2 wakeup modes.
#LittlevGL Defines
#Sensor Defines
void loop()
{
while (Touch == true){
if (i == 0) // on the first round(i=0)through the while all setup related things are set
// after i>0 just the else is repeated
{
All LittlevGL setup stuff in here
} //end IF
else
lv_task_handler(); /* let the GUI do its work */
delay(5);
timerWrite(timer, 0); //sets watchdog to 0
++i;
} //end of while
Rest of loop for normal sensor code
} //end of void_loop
This is my code in the Callback
static void event_handler(lv_obj_t * obj, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
printf("Clicked\n");
printf("Going to Deepsleep\n");
esp_sleep_enable_timer_wakeup(SleepTime * ConversionSeconds); //Set Deep Sleep Time
esp_deep_sleep_start(); // Start Deep Sleep
}
else if(event == LV_EVENT_VALUE_CHANGED) {
printf("Toggled\n");
}
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.