Skip to content
Discussion options

You must be logged in to vote

Hi! Please can you try adding setDeepSleep(0) as the first line in your run function?

On the STM32 Espruino boards, when you do setDeepSleep it enables the deep sleep mode, which shuts down the main oscillator when no JS code is executing. Unfortunately the downside of that is the UART (which communicates with the WiFi module) also shuts down, so it can't receive data from Wifi properly.

So when you have Wifi enabled you need to add setDeepSleep(0) and then as you're doing, when you disconnect you can do setDeepSleep(1);. It might be worth delaying enabling it at the end though - so setTimeout(() => setDeepSleep(1), 1000) just to ensure the wifi has had a chance to power down properly.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ps-igel
Comment options

Answer selected by ps-igel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants