One of the working devices dropped connection the same day it finally connected and after a week of testing I haven't been able to reconnect it. It briefly found a signal two days ago but wasn't able to attach and has been silent since.
No idea what could be the cause, are there some commands outside of the LTE example on docs I should try? Also the 'AT!="zsp0:npc 1"' always returns "command unknown".
Instead the init/deinit WLAN calls, I'm using pycom.wifi_on_boot(False) as you suggested. Deep sleep current lowered to 17,8 µA and I also got a better mean active current, because (according to docs) WiFi on boot flag is stored in non-volatile memory. So, after using pycom.wifi_on_boot(False) WiFi will turn-off on the next boot before executing main.py.
Updated code is:
from pysense import Pysense #Tarjeta Pysense
from LIS2HH12 import LIS2HH12 #Acelerómetro
import pycom #Usado para manejo del led RGB
import time #Usado para retardos de tiempo
py = Pysense() #Objeto para manejo de librería pysense
acc = LIS2HH12() #Objeto para manejo del acelerómetro
#Apagar el modo heartbeat si se encuentra activo
if pycom.heartbeat() == True:
#Desactivar el WiFi al iniciar, si está activo
if pycom.wifi_on_boot() == True:
print("Parpadear led tres veces...")
for i in range(3):
print(str(i + 1))
#Activar interrupción por acelerómetro (Actividad, Inactividad)
#Poner acelerómetro en modo Power-down
# Escribir 0 en los bits ODR del registro CTRL1
print("A dormir por 30 segundos...")
#Configurar tiempo y entrar en modo Deep Sleep
@jcaron thanks for pointing to this informative thread! I've looked through the library code as well, very informative. In addition, I spent half a day reverse engineering the connections and looking up cryptic SMT markings for the undocumented parts on the board (TPS78233 LDO, BQ24040 Lipo charger, TT8J13 dual P channel FET).
Thankfully I don't need the low power capabilities of this board (I need an active WiFi connection), I only need the sensors, so this simplifies things.
Let's hope Pycom releases the secrecy around this board and published PIC source code and schematics.
@rrodriguezm The link that I sent you points to the configuration, as far as I can tell. But as said, that is just one piece of the game. If the Lora driver does not release the chip, then it will not work. Looking at my LoPy4 here it seems, that the bus is released. In times when the device is not sending, MiSO can be pulled up with a resistor. And the clock frequency is 10 MHz.
And yes, it seems to be SPI3 which is used for that purpose (line 54 of the referenced file. That one indeed is inaccessible for Python code.