QuickSpot / walter-micropython

This repository contains all libraries and software to use Walter in the MicroPython framework
Other
7 stars 5 forks source link

Energy Consumption Deepsleep #1

Open hernae opened 10 months ago

hernae commented 10 months ago

Hello,

for some reason I can't manage to reach deepsleep with low energy consumption. I already tried to write a shutdown method to Power Down the modem before going to sleep. Any hints to accomplish that? `

import uasyncio import esp32 import walter import _walter import machine import esp32_ulp

import micropython

import time from esp32 import ULP from machine import mem32
from machine import Pin from micropython import const
_sleep_in_s = const(20)

variables

modem = None

async def sleepwalter():
print("sleepwalter")

(wake_reason, gpio_list) = machine.wake_reason()

#machine.pin_sleep_wakeup(('P3', 'P4'), mode=machine.WAKEUP_ANY_HIGH, enable_pull=True) 
wake1 = Pin(4, mode = Pin.IN)
esp32.wake_on_ext0(pin = wake1, level = esp32.WAKEUP_ANY_HIGH)
print("going to sleep")
await uasyncio.sleep_ms(1)
machine.deepsleep(1000*_sleep_in_s)  #sleep for n-seconds, or wakeup when P4 is HIGH
print("not reachable")

async def shutdownModem(): print("Modem shutdown") await uasyncio.sleep_ms(1) await modem.shutdown() print("shutdown called")

async def main(): await shutdownModem() await sleepwalter()

modem = walter.Modem() modem.begin(main) ` Output:

import deepsleep Modem shutdown RX:[bytearray(b'\x00')] RX:[bytearray(b'\r\n+SYSSTART\r\n')] TX:[AT+CMEE=1] RX:[bytearray(b'\r\nOK\r\n')] TX:[AT+CEREG=1] RX:[bytearray(b'\r\nOK\r\n')] TX:[AT+SQNSSHDN] shutdown called sleepwalter going to sleep FATAL ERROR: Error reading from serial device

image

daanpape commented 5 months ago

Hi, @vThibo will pick up this issue, sorry for the delay. Could you please let us know what version of Walter you are using?

daanpape commented 2 months ago

Hi, @hernae would you be able to send us the hardware revision of Walter that you are using?

tfeseker commented 1 week ago

Are there any news on how to reach minimum power consumption during deepsleep?