mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
25 lines
547 B
Python
Executable file
25 lines
547 B
Python
Executable file
#!/usr/bin/python
|
|
DISPLAYNAME="Center at MC node location"
|
|
|
|
import asyncio
|
|
|
|
from meshcore import MeshCore
|
|
from meshcore import BLEConnection
|
|
|
|
ADDRESS = "t1000"
|
|
|
|
async def main () :
|
|
con = BLEConnection(ADDRESS)
|
|
await con.connect()
|
|
mc = MeshCore(con)
|
|
await mc.connect()
|
|
|
|
infos = mc.self_info
|
|
|
|
lat=infos["adv_lat"]
|
|
lon=infos["adv_lon"]
|
|
|
|
print('[{"cmd":"prefset_n","args":{"pref":"lat","value":' + str(lat) + '}},')
|
|
print('{"cmd":"prefset_n","args":{"pref":"lon","value":' + str(lon) + '}}]')
|
|
|
|
asyncio.run(main())
|