2025-03-29 12:32:10 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
DISPLAYNAME="Center at MC node location"
|
|
|
|
|
|
|
|
|
|
import asyncio
|
|
|
|
|
|
2025-03-30 08:36:39 +02:00
|
|
|
from meshcore import MeshCore
|
|
|
|
|
from meshcore import BLEConnection
|
|
|
|
|
|
2025-03-29 12:32:10 +01:00
|
|
|
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())
|