Reset pins to low level on reboot??

lifefive
Posts: 3
Joined: Mon Apr 26, 2021 8:16 pm

Reset pins to low level on reboot??

Postby lifefive » Sun Oct 02, 2022 10:20 am

Good day. Please help advice. Immediately I apologize for my English. When using the ESP.restart() command, all pins remain at the same level as they were previously set. Can you tell me how can I reset some or all of the pins to a low level after using the ESP.restart() command? Thanks a lot in advance.

username
Posts: 477
Joined: Thu May 03, 2018 1:18 pm

Re: Reset pins to low level on reboot??

Postby username » Thu Oct 06, 2022 6:46 pm

How about trying gpio_reset_pin(GPIO_NUM_X); on the pins you want to reset before calling ESP.restart()

lifefive
Posts: 3
Joined: Mon Apr 26, 2021 8:16 pm

Re: Reset pins to low level on reboot??

Postby lifefive » Sun Oct 09, 2022 1:02 pm

Unfortunately this option doesn't work for me. Since this pin should work until the reboot itself. In fact, my situation is slightly different, I just took ESP.restart as an example. My situation is as follows: my esp32 periodically turns on the electric motor, and both the esp32 and the electric motor are powered by one large battery. So, when the battery is slightly discharged, esp32 starts the electric motor, thereby causing a voltage drop and esp32 reboots, but after a reboot, the Pin that controls the electric motor remains one, respectively, the electric motor starts up again and drawdown and reboot again, and this cycle lasts until the Battery is completely discharged. I want that at the first drawdown and reboot, the pin goes to zero, and the electric motor does not start. In general, something like this) I hope you understand me.)

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: Reset pins to low level on reboot??

Postby ESP_Sprite » Sun Oct 09, 2022 1:17 pm

If the voltage on the ESP32 goes too low, the ESP browns out and random stuff can happen. The proper way to fix this is to change your design: either make sure the ESP power supply is properly buffered so it doesn't dip down when the motor starts, or add a voltage monitor that properly resets the ESP if the power goes too low.

Who is online

Users browsing this forum: No registered users and 122 guests