W01 not waking from machine.deepsleep
I am trying to use the machine.deepsleep([time_ms]) function. The module will go into some kind of low power state but will not wake up. I also notice that the 1V8 pin remains at 1V8, it does not switch to 0V as it should. The power consumption of the module drops to 30mA and it stops running so something is happening.
import pycom import time import machine print("Hello") pycom.heartbeat(False) #machine.pin_deepsleep_wakeup( pins=( 'P10', 'P13', 'P23' ), mode=machine.WAKEUP_ANY_HIGH, enable_pull=False ) print("RED") pycom.rgbled(0xFF0000) # Red time.sleep(5) print("GREEN") pycom.rgbled(0x00FF00) # Green time.sleep(2) print("BLUE") pycom.rgbled(0x0000FF) # Blue time.sleep(2) machine.deepsleep(5000)
(sysname='GPy', nodename='GPy', release='1.18.1.r7', version='v1.8.6-849-d1c5ea9 on 2018-12-17', machine='GPy with ESP32')
Any ideas what might be wrong?
Thanks. this should be reset within a couple of hours. Once its reset the firmware tool will let you select the board type again.
@changeddaily If you can send me the device id ill ask for it to be reset in the firmware database so you can chose the correct w01 firmware.
@protean Hi, thanks for looking at this. Yes those are the lines I was referring to. Perhaps I didn't make it clear - I think the issue is fixed by programming the module with the latest Wipy firmware, I am using pre-built with the Pycom firmware update tool. However, when I run the update tool it still recognises the module as Gpy so that is where I think the fault is. When I first upgraded the firmware I most probably didn't notice that it was set to Gpy instead of Wipy. By selecting to program from a file I am able to select and program the Wipy firmware.
As far as I can tell, W01 is just a WiPy.
When you build your firmware, are you passing the WiPy flag?
$ make BOARD=WIPY clean $ make BOARD=WIPY TARGET=boot $ make BOARD=WIPY TARGET=app $ make BOARD=WIPY flash
If you're using a pre-built firmware, I dunno what to tell you...
In looking through the firmware for machine.c I saw that if the unit is reported as either "FIPY" or "GPY" it will try to power down the LTE. Since my module is W01 and has no LTE I believe the code will hang there.
I have re-programmed my module with Wipy firmware and I can confirm that the deepsleep function now works correctly - 20uA in deepsleep and it wakes up correctly.
I double checked in the firmware upgrade tool after manually downgrading to the Wipy firmware and the module still reports as Gpy which I think is the root cause of my problems here.