Why is esp32.reset_reason != 1 after power on ?
# help
k
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.reset_reason > led_ := GPIO.Pin GPIO_LED_RED --output > led_.set 1 > sleep --ms=1000 > led_.set 0 > > if restartReason == 1: > led_.set 1 > > while true: > sleep --ms=1000 https://cdn.discordapp.com/attachments/1175197828683931809/1175197828834922516/test.toit?ex=656a5b44&is=6557e644&hm=0b12aaacb572b9461d0f86dd99d7b75e9afe103091f333f296881d98f5a06067&
f
What is the value you get?
k
7 or 8
f
8 is deep sleep. That would sound reasonable in many cases
k
but after power off | on cycle i dont get a "1"
f
I agree that's strange.
I will try it myself tomorrow and see if I can reproduce. Feel free to remind me
k
👍🏻
🎯 it works (reset_reason == 1) properly, if powered via Vin (5V or 3.3V, but not USB)
f
USB should just be 5V. Which board do you use?
the (newer) board from AZ delivery behaves correctly Connecting.... Chip is ESP32-D0WDQ6 (revision v0.0) Features: WiFi, BT, Dual Core, Coding Scheme None