meshcore_py/examples/serial_infos.py

22 lines
393 B
Python
Raw Normal View History

2025-03-29 12:32:10 +01:00
#!/usr/bin/python
import asyncio
2025-03-30 08:36:39 +02:00
from meshcore import MeshCore
from meshcore import SerialConnection
PORT = "/dev/ttyUSB0"
BAUDRATE = 115200
2025-03-29 12:32:10 +01:00
async def main () :
2025-03-30 08:36:39 +02:00
con = SerialConnection(PORT, BAUDRATE)
2025-03-29 12:32:10 +01:00
await con.connect()
2025-03-30 08:36:39 +02:00
await asyncio.sleep(0.1) # time for transport to establish
2025-03-29 12:32:10 +01:00
mc = MeshCore(con)
await mc.connect()
print(mc.self_info)
asyncio.run(main())