mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
Fix example
This commit is contained in:
@@ -3,16 +3,18 @@
|
||||
import asyncio
|
||||
from meshcore import MeshCore
|
||||
|
||||
PORT = "/dev/ttyUSB0"
|
||||
PORT = "/dev/tty.usbserial-583A0069501"
|
||||
BAUDRATE = 115200
|
||||
DEST = "mchome"
|
||||
DEST = "🦄"
|
||||
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)
|
||||
contact = mc.get_contact_by_name(DEST)
|
||||
await mc.commands.send_msg(bytes.fromhex(contact["public_key"])[0:6], MSG)
|
||||
print ("Message sent ... awaiting")
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user