guild icon
Toit
#Why is esp32.reset_reason != 1 after power on ?
Thread channel in help
kaxori
kaxori 11/17/2023 10:16 PM
What is the reason?

ESP32 WROOM

Version: v1.18.0
SDK version: v2.0.0-alpha.118
Build date: 2023-11-03T09:18:28Z


import esp32
import gpio as GPIO

GPIO_LED_RED ::= 2

main:
restartReason := esp32.resetreason
led
:= GPIO.Pin GPIO_LEDRED --output
led
.set 1
sleep --ms=1000
led.set 0

if restartReason == 1:
led
.set 1

while true:
sleep --ms=1000
floitsch
floitsch 11/17/2023 10:29 PM
What is the value you get?
kaxori
kaxori 11/17/2023 10:30 PM
7 or 8
floitsch
floitsch 11/17/2023 10:31 PM
8 is deep sleep. That would sound reasonable in many cases
kaxori
kaxori 11/17/2023 10:31 PM
but after power off | on cycle i dont get a "1"
floitsch
floitsch 11/17/2023 10:31 PM
I agree that's strange.
floitsch
floitsch 11/17/2023 10:32 PM
I will try it myself tomorrow and see if I can reproduce. Feel free to remind me
kaxori
kaxori 11/17/2023 10:32 PM
:👍🏻:
kaxori
kaxori 11/18/2023 12:08 PM
:🎯: it works (reset_reason == 1) properly, if powered via Vin (5V or 3.3V, but not USB)(edited)
floitsch
floitsch 11/18/2023 12:33 PM
USB should just be 5V.
Which board do you use?
kaxori
kaxori 11/18/2023 01:47 PM
the malfactor:
kaxori
kaxori 11/18/2023 01:48 PM
the (newer) board from AZ delivery behaves correctly
Connecting....
Chip is ESP32-D0WDQ6 (revision v0.0)
Features: WiFi, BT, Dual Core, Coding Scheme None
(edited)
👍1
12 messages in total