31 lines
No EOL
811 B
Python
31 lines
No EOL
811 B
Python
import asyncio
|
|
from meshcore import MeshCore, EventType
|
|
|
|
PRESETS = [
|
|
(250,11,5), # LongFast
|
|
(250,10,5), # MediumSlow
|
|
(250,9,5), # MediumFast
|
|
(250,8,5), # ShortSlow
|
|
(250,7,5), # ShortFast
|
|
(125,8,5), # MeshOregon
|
|
(62,7,5), # MC Narrow
|
|
(500,11,8), # LongTurbo
|
|
(500,7,5), # ShortTurbo
|
|
]
|
|
|
|
|
|
async def main():
|
|
meshcore = await MeshCore.create_serial("/dev/tty.usbmodem1301")
|
|
print(meshcore)
|
|
print(await meshcore.commands.set_tx_power(1))
|
|
await asyncio.sleep(1)
|
|
for (bw,sf,cr) in PRESETS:
|
|
await meshcore.commands.set_radio(912.4, bw, sf, cr)
|
|
result = await meshcore.commands.send_chan_msg(0, "The quick brown fox jumped over the lazy dog")
|
|
print(result)
|
|
await asyncio.sleep(1)
|
|
|
|
|
|
await meshcore.disconnect()
|
|
|
|
asyncio.run(main()) |