Lopy4 deep sleep problem
-
Hi everyone,
I have a Lopy4.
My code in boot.py :
from network import WLAN from network import Bluetooth import pycom pycom.wifi_on_boot(False) # disable the heartbeat LED pycom.heartbeat(False) # Disable bluetooth bluetooth = Bluetooth() bluetooth.deinit() # Disable wifi wlan = WLAN() wlan.deinit()
My code in main.py :
from network import LoRa import socket import machine import time lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868) while not lora.has_joined(): time.sleep(2.5) s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) s.setsockopt(socket.SOL_LORA, socket.SO_DR, 5) s.setblocking(True) s.send(my sensor data) s.setblocking(False) print("enter sleep") # time.sleep(config.timeToSleepLora) machine.deepsleep(20000)
My Lopy consume 80mA during deepsleep step, is it normal ?
I power it with a power supply on 5V and no led.Thanks.
-
@jcaron Of course!
-
@robert-hh I think you mean the 3.3V pin is an output, and one should never power the board through it?
-
@pierremarsot that module should step down 12V to 5V or 3.3V. If your LoPy4 still works, then you probably used it fine. Only the 3.3V pin of the xxPy devies is an Input. Always power them throuh Vin.
-
Hi @sympatron
Yes, I connected the 12V to the 3.3V and 5V PINs ...
I thought my power supply transformed the 12V input in 5V output but after some tests, it didn't ...
-
@pierremarsot said in Lopy4 deep sleep problem:
Basic circuit. Powered by a power supply (12Vdc / 3A) on 3.3V PIN
What do you mean by that? Did you connect 12V to the 3.3V Pin? This would certainly damage the device...
-
@pierremarsot, well it might very well be that your Lopy was damaged in some way or something got shortened , do you have another device that you can try?
-
@iwahdan
Ok, thanks for this issue, sorry ...I just tried with an 5.5V power supply (checked with multimeter) and i got a consumption around 63mA in deep sleep.
Same circuit, just changed power supply input and connected with 5.5v PIN.
-
@pierremarsot , This is NOT how you power on any of pycom Devices.
Maximum voltage you can use is 5.5v and you Connect to Vin not 3.3v pin! , the 3.3v pin is actually used for supplying 3.3v output.
please use this pinout diagram as a guideline
-
Tanks @iwahdan
Can you see clearly on this picture ?Basic circuit. Powered by a power supply (12Vdc / 3A) on 3.3V PIN
I tried on 5V PIN, i got a consumption around 65mA
-
Hi @pierremarsot, I cannot totally get from the picture how you setup the circuit , if you could share the circuit diagram along with pin connections I could try to test with your setup.
-
@iwahdan Sorry but i have an consumption higher (see picture)
Maybe i didn't do the right thing ...
-
@iwahdan Strange ...
I'll check again the consumption tonight but i was pretty sure
-
Hi @pierremarsot , Actually there is no need to disable bt/wifi or Heartbeat before deepsleep, they are disabled automatically when calling
machine.deepsleep
also the LoRa modem is turned off in deepsleep.I've actually ran you code on a LoPy4 and I get an Avg current consumption in deepsleep = 27uA.
-
@pierremarsot said in Lopy4 deep sleep problem:
000
Try to close the socket ( s.close ) after your "s.setblocking(False)" and check if the radio module goes to sleep.
-
So, do you have any idea why the LoPy4 consume 80mA in sleep mode ?
-
@pierremarsot Very good to know, thanks for confirming :)
-
@tobz No. It's not disable by default. You need to called deinit function
-
@pierremarsot Yeah I saw that, I just assume d it was already off... is that not the case?
-