lemariva / uPyLoRaWAN

ESP32 using MicroPython meets LoRa and LoRaWAN.
https://lemariva.com/blog/category/lora
Apache License 2.0
225 stars 55 forks source link

sx127x.py crash after deep sleep #14

Open dancom81 opened 4 years ago

dancom81 commented 4 years ago

Hello, I'm using your code on the TTGO LORA 868. It works, great job! anyway in my main.py I wanted to use a machine.deepsleep() to optimize the current consumption when not used. but after every reset it crashes, giving some error on the sx127x.py. it is known that this chip need special power on after reset, but I don't know ho to do it here.. https://github.com/Wei1234c/SX127x_driver_for_MicroPython_on_ESP8266/issues/14 there they use other files and command which aren't compatible with yours. In the main, after definitions, I just use the "lora = SX127x(device_spi, pins=device_config, parameters=lora_parameters)" command which I thought it works as init, and I cannot find a proper reset. so before I tried to force the pin 14 (reset) low and high (like they do in the other library), but still not working. also the command "lora.sleep()" doesn't help. but maybe I must use another one? Thank you regards