SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Hi,
I wrote a SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi.
https://github.com/Wei1234c/SX127x_driv ... on_ESP8266
put all *.py into the root directory of ESP8266/ESP32 and it will send and receive packets in half duplex mode.
Pin-assignment of SX127x and ESP8266/ESP32:
The driver origins from: https://github.com/sandeepmistry/arduino-LoRa
Also, you may be interested in viewtopic.php?f=18&t=3906
FYI
Wei Lin
Last edited by Wei Lin on Mon Feb 19, 2018 1:54 am, edited 7 times in total.
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Super!
P.s. is the Semtech SX1276 also Class C compatible? I need no / very low latency for my project and can't seem to find this info on the site of Semtech. Do you also know if it's possible to implement this unit (and this driver) to the Pyboard v1.1?
with kind regards, Jeroen
P.s. is the Semtech SX1276 also Class C compatible? I need no / very low latency for my project and can't seem to find this info on the site of Semtech. Do you also know if it's possible to implement this unit (and this driver) to the Pyboard v1.1?
with kind regards, Jeroen
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
I have no SX1276 nor PyBoard, unable to answer your questions, sorry!
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Hi,
bought two of this boards https://de.aliexpress.com/item/Ra-01-SX ... 4c4dchvsOj
and connected one to ESP32 DEVKIT V1 using your code from github and run the example 'DuplexCallback' code. Get no error messages. It seems to run fine.
Then I connected the second one to a ESP8266 board https://de.aliexpress.com/item/1PCS-Wir ... st=ae803_4 and got at startup:
Traceback (most recent call last):
File "main.py", line 11, in <module>
File "test.py", line 41, in main
File "controller.py", line 64, in add_transceiver
File "sx127x.py", line 97, in init
Exception: Invalid version.
Print out the version it shows version is 0.
I exchanged this board to ESP32 and there is no error message. This tells me, the problem is not at the SX1278.
I double checked more than once my wiring and cannot find any fault.
Test runs with MicroPython v1.9.4-8-ga9a3caad0 on 2018-05-11 and with esp8266-20190125-v1.10. Both same result.
By the way on ESP32 I use also esp8266-20190125-v1.10.
Do you have any idea what could be wrong?
Regards
Kurt
bought two of this boards https://de.aliexpress.com/item/Ra-01-SX ... 4c4dchvsOj
and connected one to ESP32 DEVKIT V1 using your code from github and run the example 'DuplexCallback' code. Get no error messages. It seems to run fine.
Then I connected the second one to a ESP8266 board https://de.aliexpress.com/item/1PCS-Wir ... st=ae803_4 and got at startup:
Traceback (most recent call last):
File "main.py", line 11, in <module>
File "test.py", line 41, in main
File "controller.py", line 64, in add_transceiver
File "sx127x.py", line 97, in init
Exception: Invalid version.
Print out the version it shows version is 0.
I exchanged this board to ESP32 and there is no error message. This tells me, the problem is not at the SX1278.
I double checked more than once my wiring and cannot find any fault.
Test runs with MicroPython v1.9.4-8-ga9a3caad0 on 2018-05-11 and with esp8266-20190125-v1.10. Both same result.
By the way on ESP32 I use also esp8266-20190125-v1.10.
Do you have any idea what could be wrong?
Regards
Kurt
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
The error message means that the SPI communication failed. Sometimes it fails after h/w reset until s/w reset.
I have no oscilloscope hence not sure why it is so.
I have no oscilloscope hence not sure why it is so.
Last edited by Wei Lin on Sat Feb 09, 2019 11:38 am, edited 1 time in total.
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Hi,
the solution is using thicker cable for VCC and GND.
ESP8266 3.3V output seems to critical if both modules are driven via a USB cable.
Kurt
the solution is using thicker cable for VCC and GND.
ESP8266 3.3V output seems to critical if both modules are driven via a USB cable.
Kurt
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Perhaps someone should do the maths How much spare current capacity does the ESP8266 voltage regulator have? How much power does the LoRa device require? Should the LoRa device be powered from a separate 3.3V regulator?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Neither the ESP8266 chip itself, not the ESP8266 modules, have a 3.3V voltage regulator. There is usually a voltage regulator on the development boards, but it varies between the board make and version, so there is no single answer to that.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Fair point, my terminology was inexact. I'd still advocate doing the sums for whatever board is in use
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi
Hi
I have the same error after deepsleep wake up.
First time work perfect, but after wakeup reset this error appears.
thank