A Python interface for ExpressLRS
Project description
ELRS Python Interface
import asyncio
from elrs import ELRS
from datetime import datetime
PORT = "/dev/ttyUSB0"
BAUD = 921600
async def main() -> None:
def callback(ftype, decoded):
ts = datetime.now().strftime('%H:%M:%S.%f')[:-3]
print(f"[{ts}] {ftype:02X} {decoded}")
elrs = ELRS(PORT, baud=BAUD, rate=50, telemetry_callback=callback)
asyncio.create_task(elrs.start())
value = 1000
while True:
channels = [value] * 16
elrs.set_channels(channels)
value = (value + 1) % 2048
await asyncio.sleep(0.1)
if __name__ == "__main__":
asyncio.run(main())
Tested with the Radiomaster Ranger Nano.
Radiomaster Ranger Nano
- Connect to the Wifi hosted by the Ranger Nano and go to
http://10.0.0.1/hardware.htmland setRX: 3TX: 1 - After it is configured make sure that after power cycling it, you send commands to it within a certain time. It seems to go into the Wifi-hosting configuration mode some time after powerup if it does not receive commands.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
elrs-0.0.6.tar.gz
(5.1 kB
view details)
File details
Details for the file elrs-0.0.6.tar.gz.
File metadata
- Download URL: elrs-0.0.6.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e9695c1835f36b3e969d3bd5013f0b1336220eea75549fff6efb66f2ff7c71b
|
|
| MD5 |
181858bb4a9b7ad42ae5eb79d64f8b6b
|
|
| BLAKE2b-256 |
8642f35677056eafc5be956bde2cbab2ecfc4b18ad02562db776589a778eb884
|