Page 1 of 1

SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Tue Oct 03, 2017 3:30 pm
by Wei Lin
Image

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:

Image

Image


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

Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Thu Oct 05, 2017 6:54 am
by joena
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

Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Thu Oct 05, 2017 4:18 pm
by Wei Lin
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

Posted: Wed Feb 06, 2019 8:18 pm
by kurt
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

Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Wed Feb 06, 2019 10:01 pm
by Wei Lin
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.

Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Thu Feb 07, 2019 5:08 pm
by kurt
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

Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Fri Feb 08, 2019 8:03 am
by pythoncoder
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?

Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Fri Feb 08, 2019 10:51 am
by deshipu
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.

Re: SX127x (LoRa transceiver) driver for (Micro)Python on ESP8266/ESP32/Raspberry_Pi

Posted: Sat Feb 09, 2019 11:01 am
by pythoncoder
Fair point, my terminology was inexact. I'd still advocate doing the sums for whatever board is in use ;)