E220-900T22S Python Library for Raspberry Pi.
Project description
RPi_E220-900T22S_LoRa_library
E220-900T22S Python Library for Raspberry Pi
Installation
pip install e220-900t22s
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.1.tar.gz
(7.7 kB
view details)
Built Distribution
File details
Details for the file e220_900t22s-1.0.1.tar.gz
.
File metadata
- Download URL: e220_900t22s-1.0.1.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 | 540451398bb0d903bd82581f98a621ddf8a0c8b47baafb413217d4cc843db233 |
|
MD5 | f514135fac87cd78b2ad5122a62b78eb |
|
BLAKE2b-256 | b7c041b36814ef3826d43183b92a57dee3d5d7a1605c06a9729422e3e3f9f5d9 |
File details
Details for the file e220_900t22s-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: e220_900t22s-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.0 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 | 053f3c7b33f14391ab58779745da81f4c388620224bb932b91aa85deaf02619f |
|
MD5 | 5538bdebeb93add58872aaa4f3e72524 |
|
BLAKE2b-256 | b94df710766b644d8df6f31baf8448f4b09acd3f353ca856cfca71bc47bb7173 |