mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
deal with serial_cx issues
This commit is contained in:
parent
190fde8a45
commit
d4278b8afa
5 changed files with 12 additions and 10 deletions
|
|
@ -44,6 +44,8 @@ async def main():
|
|||
|
||||
print("Connected to MeshCore device")
|
||||
|
||||
res = await meshcore.commands.send_device_query()
|
||||
|
||||
# Get contacts
|
||||
result = await meshcore.commands.get_contacts()
|
||||
if result.type == EventType.ERROR:
|
||||
|
|
@ -118,4 +120,4 @@ if __name__ == "__main__":
|
|||
# This prevents the KeyboardInterrupt traceback from being shown
|
||||
print("\nExited cleanly")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
print(f"Error: {e}")
|
||||
|
|
|
|||
|
|
@ -113,4 +113,4 @@ async def set_channel_config(mc):
|
|||
print()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
asyncio.run(main())
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import asyncio
|
||||
|
||||
from meshcore import MeshCore
|
||||
from meshcore import MeshCore, EventType
|
||||
|
||||
PORT = "/dev/tty.usbserial-583A0069501"
|
||||
BAUDRATE = 115200
|
||||
|
||||
async def main():
|
||||
mc = await MeshCore.create_serial(PORT, BAUDRATE)
|
||||
|
||||
|
||||
print(mc.self_info)
|
||||
|
||||
await mc.disconnect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue