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

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
Wei Lin
Posts: 11
Joined: Sat Jan 21, 2017 1:07 pm

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

Post by Wei Lin » Tue Oct 03, 2017 3:30 pm

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
Last edited by Wei Lin on Mon Feb 19, 2018 1:54 am, edited 7 times in total.

joena
Posts: 2
Joined: Wed Oct 04, 2017 9:15 pm

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

Post by joena » Thu Oct 05, 2017 6:54 am

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

User avatar
Wei Lin
Posts: 11
Joined: Sat Jan 21, 2017 1:07 pm

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

Post by Wei Lin » Thu Oct 05, 2017 4:18 pm

I have no SX1276 nor PyBoard, unable to answer your questions, sorry!

kurt
Posts: 20
Joined: Sun Feb 11, 2018 7:45 pm

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

Post by kurt » Wed Feb 06, 2019 8:18 pm

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

User avatar
Wei Lin
Posts: 11
Joined: Sat Jan 21, 2017 1:07 pm

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

Post by Wei Lin » Wed Feb 06, 2019 10:01 pm

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.
Last edited by Wei Lin on Sat Feb 09, 2019 11:38 am, edited 1 time in total.

kurt
Posts: 20
Joined: Sun Feb 11, 2018 7:45 pm

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

Post by kurt » Thu Feb 07, 2019 5:08 pm

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

User avatar
pythoncoder
Posts: 3245
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

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

Post by pythoncoder » Fri Feb 08, 2019 8:03 am

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

User avatar
deshipu
Posts: 1342
Joined: Thu May 28, 2015 5:54 pm

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

Post by deshipu » Fri Feb 08, 2019 10:51 am

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.

User avatar
pythoncoder
Posts: 3245
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

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

Post by pythoncoder » Sat Feb 09, 2019 11:01 am

Fair point, my terminology was inexact. I'd still advocate doing the sums for whatever board is in use ;)
Peter Hinch

Post Reply