ProjectsCircuitPython - Ebyte E32 Driver

 Language  

CircuitPython - Ebyte E32 Driver View on GitHub

Introduction

This project is a simple driver for CircuitPython that allows you to easily interact with Ebyte's E32 series of LoRa modules.

Features

●  Supports all standard E32 UART modules.
●  Extra support on a per-frequency and per-power basis:
   ∘  More descriptive constants for TX power.
   ∘  Maximum packet size calculators. (TODO)
   ∘  Entirely optional via separate modules.
●  Minified versions for devices with tiny storage space:
   ∘  ~75% smaller for .py files
   ∘  ~5% smaller for .mpy files (Due to shortened local variables, mostly)

Limitations

●  No built-in packet size limit:
   ∘  Wildly different between frequencies & operating parameters.
   ∘  Not documented clearly enough in LoRA and LoRaWAN documentation.
●  No built-in protocol:
   ∘  All LoRa packets are glued back-to-back when received.
   ∘  No LoraWAN support
●  Missing support for some modules:
   ∘  Modules with 170, 400 and 900 prefix. (Will improve overtime)

Documentation

The entire documentation for this project can be found on Github.
The datasheets for all the E32 modules can also be found on "files.nibblepoker.lu".

Usage

Many usage examples can be found on GitHub in the "examples/" subfolder.
The examples cover all modes of operations for the modules, except for the wake-up and power-saving modes.

However, if you want to get a feel on how to use it, I invite you to read the code below taken from the "transmit_fixed/sender_unicast.py" example that is used to send a message in fixed mode to a specific device.

import board
import time

import ebyte_e32

PIN_M0 = board.IO13
PIN_M1 = board.IO12
PIN_RXD = board.IO11  # Pin marked as RX on the module
PIN_TXD = board.IO10  # Pin marked as TX on the module
PIN_AUX = board.IO9

e32 = ebyte_e32.E32Device(PIN_M0, PIN_M1, PIN_AUX, PIN_TXD, PIN_RXD, address=0xBEEF, channel=4)

# Switching to fixed transmission mode.
e32.tx_mode = ebyte_e32.TransmissionMode.TRANSMISSION_FIXED

# Switching to mode 0.  (Normal mode)
e32.mode = ebyte_e32.Modes.MODE_NORMAL

# Message content:
#  * Receiver's address: 0x1337  (b'\13\x37')
#  * Receiver's channel: 4  (b'\x04')
#  * Message: b'Hello World !'
message = b'\x13\x37\x04Hello World !'

# Sending message with helper method
e32.send(message)

# The message may be truncated at specific lengths depending on the frequencies used.
# Please check the documentation for more information !

IRL Tests

Some tests were conducted using this library with an E32 443T20D module transmitting at 10 mW / 10dBm and 2.4 kbps.

The maximum observed range was around 1.7km / 1.05mi with a clear LOS.

It could have probably been bigger if we hadn't ran out of beers and were ready to walk >8km to the next unobstructed point.

Downloads

License

MIT License

Links

●  GitHub Repository
●  Online Documentation

#electronic#python#circuitpython#lora#library