E220-900T22S Python Library for Raspberry Pi.
Project description
RPi_E220-900T22S_LoRa_library
E220-900T22S Python Library for Raspberry Pi
Installation
pip install rpi-e220-900t22s-lora-library
Example
# uart setup
sudo usermod -aG dialout <username>
sudo usermod -aG gpio <username>
sudo raspi-config
-> Interface Options
-> Serial Port
-> PC serial: no
-> Hardware serial: yes
-> ok
# reboot
from e220_900t22s.module import E220_900T22S
from e220_900t22s.register import Register
from e220_900t22s.enums import (SerialPortRateChoices, AirDataRateChoices,
SubPacketLengthChoices, TxPowerChoices,
TxMethodChoices, WORCycleChoices, Mode)
from RPi_GPIO_Helper import GPIO
# Port Initialize
dev = '/dev/ttyS0'
m0 = 23
m1 = 24
aux = 25
GPIO.cleanup(m0)
GPIO.cleanup(m1)
GPIO.cleanup(aux)
GPIO.setmode(GPIO.BCM)
# Register Setting
reg = Register(
address=0x0000,
serial_port_rate=SerialPortRateChoices.BPS9600,
air_data_rate=AirDataRateChoices.BPS1758_SF9_BW125KHZ,
sub_packet_length=SubPacketLengthChoices.BYTE200,
rssi_noise_enable=True,
tx_power=TxPowerChoices.DBM13,
channel=0,
rssi_byte_enable=True,
tx_method=TxMethodChoices.FIX,
wor_cycle=WORCycleChoices.MS2000,
crypt_key=0x0000,
)
module = E220_900T22S.create(reg, dev, m0, m1, aux)
module.configure()
module.change_mode(Mode.NORMAL)
# Sender
ret = module.send(0x0000, 0, bytes('Hello world'))
# Receiver
ret = module.read()
print(ret)
module.change_mode(Mode.SLEEP)
module.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
e220_900t22s-1.0.0.tar.gz
(7.7 kB
view details)
Built Distribution
File details
Details for the file e220_900t22s-1.0.0.tar.gz
.
File metadata
- Download URL: e220_900t22s-1.0.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20de523f10c159d112c9b5e15ba21f36c5b4eb34141e43e519f0f3b864f26b6a |
|
MD5 | 9ba99fcff5484ceb201419dd49b0d469 |
|
BLAKE2b-256 | 0932c12c77799f4669aa17101b381f7acce4e1580bb2f3d0d710efd046b965fd |
File details
Details for the file e220_900t22s-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: e220_900t22s-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d7324e0e0d22a46d5c38fd6f28f86654a00a5c5e7ca29cd67b604771c4848df |
|
MD5 | 0ad6062815747a8a64b3cd99649fcce1 |
|
BLAKE2b-256 | 786ec0303114980b6756c8e68cf889a996c2e9f958a60a36dae3ec8fbb2ffd77 |