mirror of
https://github.com/meshtastic/python.git
synced 2026-01-03 05:17:55 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
055da95b8a | ||
|
|
0c2ad5c77c | ||
|
|
0a88ca6a5c | ||
|
|
51079d4f25 |
@@ -1,4 +1,4 @@
|
|||||||
# Note: Docs are generated from this command below, albeit from Vercel.
|
# Note: Docs are generated from this command below, albeit from Vercel.
|
||||||
# The docs/ dir is not used and is no longer commited.
|
# The docs/ dir is not used and is no longer committed.
|
||||||
# see sachaw if you have questions
|
# see sachaw if you have questions
|
||||||
pdoc3 --html -f --output-dir docs meshtastic
|
pdoc3 --html -f --output-dir docs meshtastic
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ LOCAL_ADDR = "^local"
|
|||||||
"""A special ID that means the local node"""
|
"""A special ID that means the local node"""
|
||||||
|
|
||||||
BROADCAST_NUM = 0xFFFFFFFF
|
BROADCAST_NUM = 0xFFFFFFFF
|
||||||
"""if using 8 bit nodenums this will be shortend on the target"""
|
"""if using 8 bit nodenums this will be shortened on the target"""
|
||||||
|
|
||||||
BROADCAST_ADDR = "^all"
|
BROADCAST_ADDR = "^all"
|
||||||
"""A special ID that means broadcast"""
|
"""A special ID that means broadcast"""
|
||||||
@@ -172,7 +172,7 @@ def _onNodeInfoReceive(iface, asDict):
|
|||||||
# update node DB as needed
|
# update node DB as needed
|
||||||
n = iface._getOrCreateByNum(asDict["from"])
|
n = iface._getOrCreateByNum(asDict["from"])
|
||||||
n["user"] = p
|
n["user"] = p
|
||||||
# We now have a node ID, make sure it is uptodate in that table
|
# We now have a node ID, make sure it is up-to-date in that table
|
||||||
iface.nodes[p["id"]] = n
|
iface.nodes[p["id"]] = n
|
||||||
_receiveInfoUpdate(iface, asDict)
|
_receiveInfoUpdate(iface, asDict)
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class MeshInterface:
|
|||||||
"""Show table summary of nodes in mesh"""
|
"""Show table summary of nodes in mesh"""
|
||||||
|
|
||||||
def formatFloat(value, precision=2, unit=""):
|
def formatFloat(value, precision=2, unit=""):
|
||||||
"""Format a float value with precsion."""
|
"""Format a float value with precision."""
|
||||||
return f"{value:.{precision}f}{unit}" if value else None
|
return f"{value:.{precision}f}{unit}" if value else None
|
||||||
|
|
||||||
def getLH(ts):
|
def getLH(ts):
|
||||||
@@ -704,13 +704,6 @@ class MeshInterface:
|
|||||||
"For more information see https://tinyurl.com/5bjsxu32"
|
"For more information see https://tinyurl.com/5bjsxu32"
|
||||||
)
|
)
|
||||||
|
|
||||||
# check for firmware too old
|
|
||||||
if self.myInfo.max_channels == 0:
|
|
||||||
failmsg = (
|
|
||||||
"This version of meshtastic-python requires device firmware version 1.2 or later. "
|
|
||||||
"For more information see https://tinyurl.com/5bjsxu32"
|
|
||||||
)
|
|
||||||
|
|
||||||
if failmsg:
|
if failmsg:
|
||||||
self.failure = Exception(failmsg)
|
self.failure = Exception(failmsg)
|
||||||
self.isConnected.set() # let waitConnected return this exception
|
self.isConnected.set() # let waitConnected return this exception
|
||||||
@@ -843,7 +836,7 @@ class MeshInterface:
|
|||||||
if nodeNum in self.nodesByNum:
|
if nodeNum in self.nodesByNum:
|
||||||
return self.nodesByNum[nodeNum]
|
return self.nodesByNum[nodeNum]
|
||||||
else:
|
else:
|
||||||
n = {"num": nodeNum} # Create a minimial node db entry
|
n = {"num": nodeNum} # Create a minimal node db entry
|
||||||
self.nodesByNum[nodeNum] = n
|
self.nodesByNum[nodeNum] = n
|
||||||
return n
|
return n
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ class Node:
|
|||||||
return ch
|
return ch
|
||||||
|
|
||||||
def deleteChannel(self, channelIndex):
|
def deleteChannel(self, channelIndex):
|
||||||
"""Delete the specifed channelIndex and shift other channels up"""
|
"""Delete the specified channelIndex and shift other channels up"""
|
||||||
ch = self.channels[channelIndex]
|
ch = self.channels[channelIndex]
|
||||||
if ch.role not in (
|
if ch.role not in (
|
||||||
channel_pb2.Channel.Role.SECONDARY,
|
channel_pb2.Channel.Role.SECONDARY,
|
||||||
@@ -654,7 +654,7 @@ class Node:
|
|||||||
return
|
return
|
||||||
|
|
||||||
c = p["decoded"]["admin"]["raw"].get_device_metadata_response
|
c = p["decoded"]["admin"]["raw"].get_device_metadata_response
|
||||||
self._timeout.reset() # We made foreward progress
|
self._timeout.reset() # We made forward progress
|
||||||
logging.debug(f"Received metadata {stripnl(c)}")
|
logging.debug(f"Received metadata {stripnl(c)}")
|
||||||
print(f"\nfirmware_version: {c.firmware_version}")
|
print(f"\nfirmware_version: {c.firmware_version}")
|
||||||
print(f"device_state_version: {c.device_state_version}")
|
print(f"device_state_version: {c.device_state_version}")
|
||||||
@@ -681,7 +681,7 @@ class Node:
|
|||||||
|
|
||||||
c = p["decoded"]["admin"]["raw"].get_channel_response
|
c = p["decoded"]["admin"]["raw"].get_channel_response
|
||||||
self.partialChannels.append(c)
|
self.partialChannels.append(c)
|
||||||
self._timeout.reset() # We made foreward progress
|
self._timeout.reset() # We made forward progress
|
||||||
logging.debug(f"Received channel {stripnl(c)}")
|
logging.debug(f"Received channel {stripnl(c)}")
|
||||||
index = c.index
|
index = c.index
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19meshtastic/portnums.proto*\xd5\x03\n\x07PortNum\x12\x0f\n\x0bUNKNOWN_APP\x10\x00\x12\x14\n\x10TEXT_MESSAGE_APP\x10\x01\x12\x17\n\x13REMOTE_HARDWARE_APP\x10\x02\x12\x10\n\x0cPOSITION_APP\x10\x03\x12\x10\n\x0cNODEINFO_APP\x10\x04\x12\x0f\n\x0bROUTING_APP\x10\x05\x12\r\n\tADMIN_APP\x10\x06\x12\x1f\n\x1bTEXT_MESSAGE_COMPRESSED_APP\x10\x07\x12\x10\n\x0cWAYPOINT_APP\x10\x08\x12\r\n\tAUDIO_APP\x10\t\x12\x19\n\x15MQTT_CLIENT_PROXY_APP\x10\n\x12\r\n\tREPLY_APP\x10 \x12\x11\n\rIP_TUNNEL_APP\x10!\x12\x0e\n\nSERIAL_APP\x10@\x12\x15\n\x11STORE_FORWARD_APP\x10\x41\x12\x12\n\x0eRANGE_TEST_APP\x10\x42\x12\x11\n\rTELEMETRY_APP\x10\x43\x12\x0b\n\x07ZPS_APP\x10\x44\x12\x11\n\rSIMULATOR_APP\x10\x45\x12\x12\n\x0eTRACEROUTE_APP\x10\x46\x12\x14\n\x10NEIGHBORINFO_APP\x10G\x12\x10\n\x0bPRIVATE_APP\x10\x80\x02\x12\x13\n\x0e\x41TAK_FORWARDER\x10\x81\x02\x12\x08\n\x03MAX\x10\xff\x03\x42]\n\x13\x63om.geeksville.meshB\x08PortnumsZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19meshtastic/portnums.proto*\xba\x03\n\x07PortNum\x12\x0f\n\x0bUNKNOWN_APP\x10\x00\x12\x14\n\x10TEXT_MESSAGE_APP\x10\x01\x12\x17\n\x13REMOTE_HARDWARE_APP\x10\x02\x12\x10\n\x0cPOSITION_APP\x10\x03\x12\x10\n\x0cNODEINFO_APP\x10\x04\x12\x0f\n\x0bROUTING_APP\x10\x05\x12\r\n\tADMIN_APP\x10\x06\x12\x1f\n\x1bTEXT_MESSAGE_COMPRESSED_APP\x10\x07\x12\x10\n\x0cWAYPOINT_APP\x10\x08\x12\r\n\tAUDIO_APP\x10\t\x12\r\n\tREPLY_APP\x10 \x12\x11\n\rIP_TUNNEL_APP\x10!\x12\x0e\n\nSERIAL_APP\x10@\x12\x15\n\x11STORE_FORWARD_APP\x10\x41\x12\x12\n\x0eRANGE_TEST_APP\x10\x42\x12\x11\n\rTELEMETRY_APP\x10\x43\x12\x0b\n\x07ZPS_APP\x10\x44\x12\x11\n\rSIMULATOR_APP\x10\x45\x12\x12\n\x0eTRACEROUTE_APP\x10\x46\x12\x14\n\x10NEIGHBORINFO_APP\x10G\x12\x10\n\x0bPRIVATE_APP\x10\x80\x02\x12\x13\n\x0e\x41TAK_FORWARDER\x10\x81\x02\x12\x08\n\x03MAX\x10\xff\x03\x42]\n\x13\x63om.geeksville.meshB\x08PortnumsZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||||
|
|
||||||
_PORTNUM = DESCRIPTOR.enum_types_by_name['PortNum']
|
_PORTNUM = DESCRIPTOR.enum_types_by_name['PortNum']
|
||||||
PortNum = enum_type_wrapper.EnumTypeWrapper(_PORTNUM)
|
PortNum = enum_type_wrapper.EnumTypeWrapper(_PORTNUM)
|
||||||
@@ -29,7 +29,6 @@ ADMIN_APP = 6
|
|||||||
TEXT_MESSAGE_COMPRESSED_APP = 7
|
TEXT_MESSAGE_COMPRESSED_APP = 7
|
||||||
WAYPOINT_APP = 8
|
WAYPOINT_APP = 8
|
||||||
AUDIO_APP = 9
|
AUDIO_APP = 9
|
||||||
MQTT_CLIENT_PROXY_APP = 10
|
|
||||||
REPLY_APP = 32
|
REPLY_APP = 32
|
||||||
IP_TUNNEL_APP = 33
|
IP_TUNNEL_APP = 33
|
||||||
SERIAL_APP = 64
|
SERIAL_APP = 64
|
||||||
@@ -50,5 +49,5 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\010PortnumsZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\010PortnumsZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||||
_PORTNUM._serialized_start=30
|
_PORTNUM._serialized_start=30
|
||||||
_PORTNUM._serialized_end=499
|
_PORTNUM._serialized_end=472
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class StreamInterface(MeshInterface):
|
|||||||
|
|
||||||
# Send some bogus UART characters to force a sleeping device to wake, and
|
# Send some bogus UART characters to force a sleeping device to wake, and
|
||||||
# if the reading statemachine was parsing a bad packet make sure
|
# if the reading statemachine was parsing a bad packet make sure
|
||||||
# we write enought start bytes to force it to resync (we don't use START1
|
# we write enough start bytes to force it to resync (we don't use START1
|
||||||
# because we want to ensure it is looking for START1)
|
# because we want to ensure it is looking for START1)
|
||||||
p = bytearray([START2] * 32)
|
p = bytearray([START2] * 32)
|
||||||
self._writeBytes(p)
|
self._writeBytes(p)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
# Do not like using hard coded sleeps, but it probably makes
|
# Do not like using hard coded sleeps, but it probably makes
|
||||||
# sense to pause for the radio at apprpriate times
|
# sense to pause for the radio at appropriate times
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from ..util import findPorts
|
from ..util import findPorts
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
# Do not like using hard coded sleeps, but it probably makes
|
# Do not like using hard coded sleeps, but it probably makes
|
||||||
# sense to pause for the radio at apprpriate times
|
# sense to pause for the radio at appropriate times
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from ..util import findPorts
|
from ..util import findPorts
|
||||||
|
|||||||
Submodule protobufs updated: e0b136f5f8...57bd75ea8b
2
setup.py
2
setup.py
@@ -13,7 +13,7 @@ with open("README.md", "r") as fh:
|
|||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(
|
setup(
|
||||||
name="meshtastic",
|
name="meshtastic",
|
||||||
version="2.1.9",
|
version="2.1.10",
|
||||||
description="Python API & client shell for talking to Meshtastic devices",
|
description="Python API & client shell for talking to Meshtastic devices",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
Reference in New Issue
Block a user