mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 19:56:53 +00:00
19 lines
376 B
Python
Executable File
19 lines
376 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import asyncio
|
|
from meshcore import MeshCore
|
|
|
|
PORT = "/dev/ttyUSB0"
|
|
BAUDRATE = 115200
|
|
DEST = "mchome"
|
|
MSG = "hello from serial"
|
|
|
|
async def main () :
|
|
mc = await MeshCore.create_serial(PORT, BAUDRATE)
|
|
|
|
await mc.ensure_contacts()
|
|
await mc.commands.send_msg(bytes.fromhex(mc.get_contact_by_name(DEST)["public_key"])[0:6], MSG)
|
|
|
|
asyncio.run(main())
|
|
|