mirror of
https://github.com/meshtastic/python.git
synced 2025-12-24 08:27:55 -05:00
21 lines
461 B
Python
21 lines
461 B
Python
"""Simple program to demo how to use meshtastic library.
|
|
To run: python examples/info.py
|
|
"""
|
|
|
|
import meshtastic
|
|
import meshtastic.serial_interface
|
|
|
|
iface = meshtastic.serial_interface.SerialInterface()
|
|
|
|
# call showInfo() just to ensure values are populated
|
|
# info = iface.showInfo()
|
|
|
|
|
|
if iface.nodes:
|
|
for n in iface.nodes.values():
|
|
if n["num"] == iface.myInfo.my_node_num:
|
|
print(n["user"]["hwModel"])
|
|
break
|
|
|
|
iface.close()
|