From 6472beccc53bbcfd63818e68344cb74e38d4d91f Mon Sep 17 00:00:00 2001
From: Kevin Hester
Date: Thu, 18 Mar 2021 19:43:10 +0800
Subject: [PATCH] 1.2.11
---
docs/meshtastic/admin_pb2.html | 19 ++-
docs/meshtastic/index.html | 38 +++++
docs/meshtastic/mesh_pb2.html | 213 +++++++++++++++++++++------
docs/meshtastic/remote_hardware.html | 46 ++++--
docs/meshtastic/test.html | 57 ++++++-
proto | 2 +-
setup.py | 2 +-
7 files changed, 309 insertions(+), 68 deletions(-)
diff --git a/docs/meshtastic/admin_pb2.html b/docs/meshtastic/admin_pb2.html
index 881a415..1c2363f 100644
--- a/docs/meshtastic/admin_pb2.html
+++ b/docs/meshtastic/admin_pb2.html
@@ -51,7 +51,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
syntax='proto3',
serialized_options=b'\n\023com.geeksville.meshB\013AdminProtosH\003',
create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x0b\x61\x64min.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\x1a\rchannel.proto\"\xc7\x02\n\x0c\x41\x64minMessage\x12!\n\tset_radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1a\n\tset_owner\x18\x02 \x01(\x0b\x32\x05.UserH\x00\x12\x1f\n\x0bset_channel\x18\x03 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_radio_request\x18\x04 \x01(\x08H\x00\x12*\n\x12get_radio_response\x18\x05 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1d\n\x13get_channel_request\x18\x06 \x01(\rH\x00\x12(\n\x14get_channel_response\x18\x07 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1d\n\x13\x63onfirm_set_channel\x18 \x01(\x08H\x00\x12\x1b\n\x11\x63onfirm_set_radio\x18! \x01(\x08H\x00\x42\t\n\x07variantB$\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosH\x03\x62\x06proto3'
+ serialized_pb=b'\n\x0b\x61\x64min.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\x1a\rchannel.proto\"\xe1\x02\n\x0c\x41\x64minMessage\x12!\n\tset_radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1a\n\tset_owner\x18\x02 \x01(\x0b\x32\x05.UserH\x00\x12\x1f\n\x0bset_channel\x18\x03 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_radio_request\x18\x04 \x01(\x08H\x00\x12*\n\x12get_radio_response\x18\x05 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1d\n\x13get_channel_request\x18\x06 \x01(\rH\x00\x12(\n\x14get_channel_response\x18\x07 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1d\n\x13\x63onfirm_set_channel\x18 \x01(\x08H\x00\x12\x1b\n\x11\x63onfirm_set_radio\x18! \x01(\x08H\x00\x12\x18\n\x0e\x65xit_simulator\x18\" \x01(\x08H\x00\x42\t\n\x07variantB$\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosH\x03\x62\x06proto3'
,
dependencies=[mesh__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,channel__pb2.DESCRIPTOR,])
@@ -129,6 +129,13 @@ _ADMINMESSAGE = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ _descriptor.FieldDescriptor(
+ name='exit_simulator', full_name='AdminMessage.exit_simulator', index=9,
+ number=34, type=8, cpp_type=7, label=1,
+ has_default_value=False, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
@@ -147,7 +154,7 @@ _ADMINMESSAGE = _descriptor.Descriptor(
fields=[]),
],
serialized_start=62,
- serialized_end=389,
+ serialized_end=415,
)
_ADMINMESSAGE.fields_by_name['set_radio'].message_type = radioconfig__pb2._RADIOCONFIG
@@ -182,6 +189,9 @@ _ADMINMESSAGE.fields_by_name['confirm_set_channel'].containing_oneof = _
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
_ADMINMESSAGE.fields_by_name['confirm_set_radio'])
_ADMINMESSAGE.fields_by_name['confirm_set_radio'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+ _ADMINMESSAGE.fields_by_name['exit_simulator'])
+_ADMINMESSAGE.fields_by_name['exit_simulator'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
DESCRIPTOR.message_types_by_name['AdminMessage'] = _ADMINMESSAGE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@@ -234,6 +244,10 @@ DESCRIPTOR._options = None
Field AdminMessage.confirm_set_radio
+var exit_simulator
+
+Field AdminMessage.exit_simulator
+
var get_channel_request
Field AdminMessage.get_channel_request
@@ -286,6 +300,7 @@ DESCRIPTOR._options = None
DESCRIPTOR
confirm_set_channel
confirm_set_radio
+exit_simulator
get_channel_request
get_channel_response
get_radio_request
diff --git a/docs/meshtastic/index.html b/docs/meshtastic/index.html
index 70e1759..81797b8 100644
--- a/docs/meshtastic/index.html
+++ b/docs/meshtastic/index.html
@@ -380,6 +380,15 @@ class Node:
wantResponse=True,
onResponse=onResponse)
+ def exitSimulator(self):
+ """
+ Tell a simulator node to exit (this message is ignored for other nodes)
+ """
+ p = admin_pb2.AdminMessage()
+ p.exit_simulator = True
+
+ return self._sendAdmin(p)
+
def _requestChannel(self, channelNum: int):
"""
Done with initial config messages, now send regular MeshPackets to ask for settings
@@ -2434,6 +2443,15 @@ wantResponse – True if you want the service on the other side to send an a
wantResponse=True,
onResponse=onResponse)
+ def exitSimulator(self):
+ """
+ Tell a simulator node to exit (this message is ignored for other nodes)
+ """
+ p = admin_pb2.AdminMessage()
+ p.exit_simulator = True
+
+ return self._sendAdmin(p)
+
def _requestChannel(self, channelNum: int):
"""
Done with initial config messages, now send regular MeshPackets to ask for settings
@@ -2515,6 +2533,25 @@ def channelURL(self):
Methods
+
+def exitSimulator(self)
+
+-
+
Tell a simulator node to exit (this message is ignored for other nodes)
+
+
+Expand source code
+
+def exitSimulator(self):
+ """
+ Tell a simulator node to exit (this message is ignored for other nodes)
+ """
+ p = admin_pb2.AdminMessage()
+ p.exit_simulator = True
+
+ return self._sendAdmin(p)
+
+
def getChannelByName(self, name)
@@ -3221,6 +3258,7 @@ hostname {string} – Hostname/IP address of the device to connect to
Node
channelURL
+exitSimulator
getChannelByName
getDisabledChannel
requestConfig
diff --git a/docs/meshtastic/mesh_pb2.html b/docs/meshtastic/mesh_pb2.html
index bccb000..40a002c 100644
--- a/docs/meshtastic/mesh_pb2.html
+++ b/docs/meshtastic/mesh_pb2.html
@@ -50,10 +50,106 @@ DESCRIPTOR = _descriptor.FileDescriptor(
syntax='proto3',
serialized_options=b'\n\023com.geeksville.meshB\nMeshProtosH\003',
create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\nmesh.proto\x1a\x0eportnums.proto\"v\n\x08Position\x12\x12\n\nlatitude_i\x18\x01 \x01(\x0f\x12\x13\n\x0blongitude_i\x18\x02 \x01(\x0f\x12\x10\n\x08\x61ltitude\x18\x03 \x01(\x05\x12\x15\n\rbattery_level\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\t \x01(\x07J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"J\n\x04User\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tlong_name\x18\x02 \x01(\t\x12\x12\n\nshort_name\x18\x03 \x01(\t\x12\x0f\n\x07macaddr\x18\x04 \x01(\x0c\"\x1f\n\x0eRouteDiscovery\x12\r\n\x05route\x18\x02 \x03(\x07\"\xa0\x02\n\x07Routing\x12(\n\rroute_request\x18\x01 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12&\n\x0broute_reply\x18\x02 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12&\n\x0c\x65rror_reason\x18\x03 \x01(\x0e\x32\x0e.Routing.ErrorH\x00\"\x8f\x01\n\x05\x45rror\x12\x08\n\x04NONE\x10\x00\x12\x0c\n\x08NO_ROUTE\x10\x01\x12\x0b\n\x07GOT_NAK\x10\x02\x12\x0b\n\x07TIMEOUT\x10\x03\x12\x10\n\x0cNO_INTERFACE\x10\x04\x12\x12\n\x0eMAX_RETRANSMIT\x10\x05\x12\x0e\n\nNO_CHANNEL\x10\x06\x12\r\n\tTOO_LARGE\x10\x07\x12\x0f\n\x0bNO_RESPONSE\x10\x08\x42\t\n\x07variant\"{\n\x04\x44\x61ta\x12\x19\n\x07portnum\x18\x01 \x01(\x0e\x32\x08.PortNum\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\x12\x15\n\rwant_response\x18\x03 \x01(\x08\x12\x0c\n\x04\x64\x65st\x18\x04 \x01(\x07\x12\x0e\n\x06source\x18\x05 \x01(\x07\x12\x12\n\nrequest_id\x18\x06 \x01(\x07\"\xcf\x02\n\nMeshPacket\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x07\x12\n\n\x02to\x18\x02 \x01(\x07\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\r\x12\x18\n\x07\x64\x65\x63oded\x18\x04 \x01(\x0b\x32\x05.DataH\x00\x12\x13\n\tencrypted\x18\x05 \x01(\x0cH\x00\x12\n\n\x02id\x18\x06 \x01(\x07\x12\x0f\n\x07rx_time\x18\x07 \x01(\x07\x12\x0e\n\x06rx_snr\x18\x08 \x01(\x02\x12\x11\n\thop_limit\x18\n \x01(\r\x12\x10\n\x08want_ack\x18\x0b \x01(\x08\x12&\n\x08priority\x18\x0c \x01(\x0e\x32\x14.MeshPacket.Priority\"[\n\x08Priority\x12\t\n\x05UNSET\x10\x00\x12\x07\n\x03MIN\x10\x01\x12\x0e\n\nBACKGROUND\x10\n\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10@\x12\x0c\n\x08RELIABLE\x10\x46\x12\x07\n\x03\x41\x43K\x10x\x12\x07\n\x03MAX\x10\x7f\x42\x10\n\x0epayloadVariant\"h\n\x08NodeInfo\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x13\n\x04user\x18\x02 \x01(\x0b\x32\x05.User\x12\x1b\n\x08position\x18\x03 \x01(\x0b\x32\t.Position\x12\x0b\n\x03snr\x18\x07 \x01(\x02\x12\x10\n\x08next_hop\x18\x05 \x01(\r\"\xa6\x02\n\nMyNodeInfo\x12\x13\n\x0bmy_node_num\x18\x01 \x01(\r\x12\x0f\n\x07has_gps\x18\x02 \x01(\x08\x12\x11\n\tnum_bands\x18\x03 \x01(\r\x12\x14\n\x0cmax_channels\x18\x0f \x01(\r\x12\x12\n\x06region\x18\x04 \x01(\tB\x02\x18\x01\x12\x10\n\x08hw_model\x18\x05 \x01(\t\x12\x18\n\x10\x66irmware_version\x18\x06 \x01(\t\x12&\n\nerror_code\x18\x07 \x01(\x0e\x32\x12.CriticalErrorCode\x12\x15\n\rerror_address\x18\x08 \x01(\r\x12\x13\n\x0b\x65rror_count\x18\t \x01(\r\x12\x1c\n\x14message_timeout_msec\x18\r \x01(\r\x12\x17\n\x0fmin_app_version\x18\x0e \x01(\r\"\xb5\x01\n\tLogRecord\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x07\x12\x0e\n\x06source\x18\x03 \x01(\t\x12\x1f\n\x05level\x18\x04 \x01(\x0e\x32\x10.LogRecord.Level\"X\n\x05Level\x12\t\n\x05UNSET\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x32\x12\t\n\x05\x45RROR\x10(\x12\x0b\n\x07WARNING\x10\x1e\x12\x08\n\x04INFO\x10\x14\x12\t\n\x05\x44\x45\x42UG\x10\n\x12\t\n\x05TRACE\x10\x05\"\xe9\x01\n\tFromRadio\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x1d\n\x06packet\x18\x0b \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x1e\n\x07my_info\x18\x03 \x01(\x0b\x32\x0b.MyNodeInfoH\x00\x12\x1e\n\tnode_info\x18\x04 \x01(\x0b\x32\t.NodeInfoH\x00\x12 \n\nlog_record\x18\x07 \x01(\x0b\x32\n.LogRecordH\x00\x12\x1c\n\x12\x63onfig_complete_id\x18\x08 \x01(\rH\x00\x12\x12\n\x08rebooted\x18\t \x01(\x08H\x00\x42\x10\n\x0epayloadVariantJ\x04\x08\x02\x10\x03J\x04\x08\x06\x10\x07\"l\n\x07ToRadio\x12\x1d\n\x06packet\x18\x02 \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x18\n\x0ewant_config_id\x18\x64 \x01(\rH\x00\x42\x10\n\x0epayloadVariantJ\x04\x08\x01\x10\x02J\x04\x08\x65\x10\x66J\x04\x08\x66\x10gJ\x04\x08g\x10h*.\n\tConstants\x12\n\n\x06Unused\x10\x00\x12\x15\n\x10\x44\x41TA_PAYLOAD_LEN\x10\xf0\x01*\xbd\x01\n\x11\x43riticalErrorCode\x12\x08\n\x04None\x10\x00\x12\x0e\n\nTxWatchdog\x10\x01\x12\x12\n\x0eSleepEnterWait\x10\x02\x12\x0b\n\x07NoRadio\x10\x03\x12\x0f\n\x0bUnspecified\x10\x04\x12\x13\n\x0fUBloxInitFailed\x10\x05\x12\x0c\n\x08NoAXP192\x10\x06\x12\x17\n\x13InvalidRadioSetting\x10\x07\x12\x12\n\x0eTransmitFailed\x10\x08\x12\x0c\n\x08\x42rownout\x10\tB#\n\x13\x63om.geeksville.meshB\nMeshProtosH\x03\x62\x06proto3'
+ serialized_pb=b'\n\nmesh.proto\x1a\x0eportnums.proto\"v\n\x08Position\x12\x12\n\nlatitude_i\x18\x01 \x01(\x0f\x12\x13\n\x0blongitude_i\x18\x02 \x01(\x0f\x12\x10\n\x08\x61ltitude\x18\x03 \x01(\x05\x12\x15\n\rbattery_level\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\t \x01(\x07J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"l\n\x04User\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tlong_name\x18\x02 \x01(\t\x12\x12\n\nshort_name\x18\x03 \x01(\t\x12\x0f\n\x07macaddr\x18\x04 \x01(\x0c\x12 \n\x08hw_model\x18\x06 \x01(\x0e\x32\x0e.HardwareModel\"\x1f\n\x0eRouteDiscovery\x12\r\n\x05route\x18\x02 \x03(\x07\"\xa0\x02\n\x07Routing\x12(\n\rroute_request\x18\x01 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12&\n\x0broute_reply\x18\x02 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12&\n\x0c\x65rror_reason\x18\x03 \x01(\x0e\x32\x0e.Routing.ErrorH\x00\"\x8f\x01\n\x05\x45rror\x12\x08\n\x04NONE\x10\x00\x12\x0c\n\x08NO_ROUTE\x10\x01\x12\x0b\n\x07GOT_NAK\x10\x02\x12\x0b\n\x07TIMEOUT\x10\x03\x12\x10\n\x0cNO_INTERFACE\x10\x04\x12\x12\n\x0eMAX_RETRANSMIT\x10\x05\x12\x0e\n\nNO_CHANNEL\x10\x06\x12\r\n\tTOO_LARGE\x10\x07\x12\x0f\n\x0bNO_RESPONSE\x10\x08\x42\t\n\x07variant\"{\n\x04\x44\x61ta\x12\x19\n\x07portnum\x18\x01 \x01(\x0e\x32\x08.PortNum\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\x12\x15\n\rwant_response\x18\x03 \x01(\x08\x12\x0c\n\x04\x64\x65st\x18\x04 \x01(\x07\x12\x0e\n\x06source\x18\x05 \x01(\x07\x12\x12\n\nrequest_id\x18\x06 \x01(\x07\"\xcf\x02\n\nMeshPacket\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x07\x12\n\n\x02to\x18\x02 \x01(\x07\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\r\x12\x18\n\x07\x64\x65\x63oded\x18\x04 \x01(\x0b\x32\x05.DataH\x00\x12\x13\n\tencrypted\x18\x05 \x01(\x0cH\x00\x12\n\n\x02id\x18\x06 \x01(\x07\x12\x0f\n\x07rx_time\x18\x07 \x01(\x07\x12\x0e\n\x06rx_snr\x18\x08 \x01(\x02\x12\x11\n\thop_limit\x18\n \x01(\r\x12\x10\n\x08want_ack\x18\x0b \x01(\x08\x12&\n\x08priority\x18\x0c \x01(\x0e\x32\x14.MeshPacket.Priority\"[\n\x08Priority\x12\t\n\x05UNSET\x10\x00\x12\x07\n\x03MIN\x10\x01\x12\x0e\n\nBACKGROUND\x10\n\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10@\x12\x0c\n\x08RELIABLE\x10\x46\x12\x07\n\x03\x41\x43K\x10x\x12\x07\n\x03MAX\x10\x7f\x42\x10\n\x0epayloadVariant\"V\n\x08NodeInfo\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x13\n\x04user\x18\x02 \x01(\x0b\x32\x05.User\x12\x1b\n\x08position\x18\x03 \x01(\x0b\x32\t.Position\x12\x0b\n\x03snr\x18\x07 \x01(\x02\"\xb5\x02\n\nMyNodeInfo\x12\x13\n\x0bmy_node_num\x18\x01 \x01(\r\x12\x0f\n\x07has_gps\x18\x02 \x01(\x08\x12\x11\n\tnum_bands\x18\x03 \x01(\r\x12\x14\n\x0cmax_channels\x18\x0f \x01(\r\x12\x12\n\x06region\x18\x04 \x01(\tB\x02\x18\x01\x12\x1f\n\x13hw_model_deprecated\x18\x05 \x01(\tB\x02\x18\x01\x12\x18\n\x10\x66irmware_version\x18\x06 \x01(\t\x12&\n\nerror_code\x18\x07 \x01(\x0e\x32\x12.CriticalErrorCode\x12\x15\n\rerror_address\x18\x08 \x01(\r\x12\x13\n\x0b\x65rror_count\x18\t \x01(\r\x12\x1c\n\x14message_timeout_msec\x18\r \x01(\r\x12\x17\n\x0fmin_app_version\x18\x0e \x01(\r\"\xb5\x01\n\tLogRecord\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x07\x12\x0e\n\x06source\x18\x03 \x01(\t\x12\x1f\n\x05level\x18\x04 \x01(\x0e\x32\x10.LogRecord.Level\"X\n\x05Level\x12\t\n\x05UNSET\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x32\x12\t\n\x05\x45RROR\x10(\x12\x0b\n\x07WARNING\x10\x1e\x12\x08\n\x04INFO\x10\x14\x12\t\n\x05\x44\x45\x42UG\x10\n\x12\t\n\x05TRACE\x10\x05\"\xe9\x01\n\tFromRadio\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x1d\n\x06packet\x18\x0b \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x1e\n\x07my_info\x18\x03 \x01(\x0b\x32\x0b.MyNodeInfoH\x00\x12\x1e\n\tnode_info\x18\x04 \x01(\x0b\x32\t.NodeInfoH\x00\x12 \n\nlog_record\x18\x07 \x01(\x0b\x32\n.LogRecordH\x00\x12\x1c\n\x12\x63onfig_complete_id\x18\x08 \x01(\rH\x00\x12\x12\n\x08rebooted\x18\t \x01(\x08H\x00\x42\x10\n\x0epayloadVariantJ\x04\x08\x02\x10\x03J\x04\x08\x06\x10\x07\"l\n\x07ToRadio\x12\x1d\n\x06packet\x18\x02 \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x18\n\x0ewant_config_id\x18\x64 \x01(\rH\x00\x42\x10\n\x0epayloadVariantJ\x04\x08\x01\x10\x02J\x04\x08\x65\x10\x66J\x04\x08\x66\x10gJ\x04\x08g\x10h*\xfd\x01\n\rHardwareModel\x12\t\n\x05UNSET\x10\x00\x12\x0c\n\x08TLORA_V2\x10\x01\x12\x0c\n\x08TLORA_V1\x10\x02\x12\x12\n\x0eTLORA_V2_1_1p6\x10\x03\x12\t\n\x05TBEAM\x10\x04\x12\n\n\x06HELTEC\x10\x05\x12\x0c\n\x08TBEAM0p7\x10\x06\x12\n\n\x06T_ECHO\x10\x07\x12\x10\n\x0cTLORA_V1_1p3\x10\x08\x12\x11\n\rLORA_RELAY_V1\x10 \x12\x0e\n\nNRF52840DK\x10!\x12\x07\n\x03PPR\x10\"\x12\x0f\n\x0bGENIEBLOCKS\x10#\x12\x11\n\rNRF52_UNKNOWN\x10$\x12\r\n\tPORTDUINO\x10%\x12\x0f\n\x0b\x41NDROID_SIM\x10&*.\n\tConstants\x12\n\n\x06Unused\x10\x00\x12\x15\n\x10\x44\x41TA_PAYLOAD_LEN\x10\xf0\x01*\xbd\x01\n\x11\x43riticalErrorCode\x12\x08\n\x04None\x10\x00\x12\x0e\n\nTxWatchdog\x10\x01\x12\x12\n\x0eSleepEnterWait\x10\x02\x12\x0b\n\x07NoRadio\x10\x03\x12\x0f\n\x0bUnspecified\x10\x04\x12\x13\n\x0fUBloxInitFailed\x10\x05\x12\x0c\n\x08NoAXP192\x10\x06\x12\x17\n\x13InvalidRadioSetting\x10\x07\x12\x12\n\x0eTransmitFailed\x10\x08\x12\x0c\n\x08\x42rownout\x10\tB#\n\x13\x63om.geeksville.meshB\nMeshProtosH\x03\x62\x06proto3'
,
dependencies=[portnums__pb2.DESCRIPTOR,])
+_HARDWAREMODEL = _descriptor.EnumDescriptor(
+ name='HardwareModel',
+ full_name='HardwareModel',
+ filename=None,
+ file=DESCRIPTOR,
+ create_key=_descriptor._internal_create_key,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='UNSET', index=0, number=0,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='TLORA_V2', index=1, number=1,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='TLORA_V1', index=2, number=2,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='TLORA_V2_1_1p6', index=3, number=3,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='TBEAM', index=4, number=4,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='HELTEC', index=5, number=5,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='TBEAM0p7', index=6, number=6,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='T_ECHO', index=7, number=7,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='TLORA_V1_1p3', index=8, number=8,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='LORA_RELAY_V1', index=9, number=32,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='NRF52840DK', index=10, number=33,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='PPR', index=11, number=34,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='GENIEBLOCKS', index=12, number=35,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='NRF52_UNKNOWN', index=13, number=36,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='PORTDUINO', index=14, number=37,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='ANDROID_SIM', index=15, number=38,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ ],
+ containing_type=None,
+ serialized_options=None,
+ serialized_start=1978,
+ serialized_end=2231,
+)
+_sym_db.RegisterEnumDescriptor(_HARDWAREMODEL)
+
+HardwareModel = enum_type_wrapper.EnumTypeWrapper(_HARDWAREMODEL)
_CONSTANTS = _descriptor.EnumDescriptor(
name='Constants',
full_name='Constants',
@@ -74,8 +170,8 @@ _CONSTANTS = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=1946,
- serialized_end=1992,
+ serialized_start=2233,
+ serialized_end=2279,
)
_sym_db.RegisterEnumDescriptor(_CONSTANTS)
@@ -140,12 +236,28 @@ _CRITICALERRORCODE = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=1995,
- serialized_end=2184,
+ serialized_start=2282,
+ serialized_end=2471,
)
_sym_db.RegisterEnumDescriptor(_CRITICALERRORCODE)
CriticalErrorCode = enum_type_wrapper.EnumTypeWrapper(_CRITICALERRORCODE)
+UNSET = 0
+TLORA_V2 = 1
+TLORA_V1 = 2
+TLORA_V2_1_1p6 = 3
+TBEAM = 4
+HELTEC = 5
+TBEAM0p7 = 6
+T_ECHO = 7
+TLORA_V1_1p3 = 8
+LORA_RELAY_V1 = 32
+NRF52840DK = 33
+PPR = 34
+GENIEBLOCKS = 35
+NRF52_UNKNOWN = 36
+PORTDUINO = 37
+ANDROID_SIM = 38
Unused = 0
DATA_PAYLOAD_LEN = 240
globals()['None'] = 0
@@ -215,8 +327,8 @@ _ROUTING_ERROR = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=394,
- serialized_end=537,
+ serialized_start=428,
+ serialized_end=571,
)
_sym_db.RegisterEnumDescriptor(_ROUTING_ERROR)
@@ -265,8 +377,8 @@ _MESHPACKET_PRIORITY = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=902,
- serialized_end=993,
+ serialized_start=936,
+ serialized_end=1027,
)
_sym_db.RegisterEnumDescriptor(_MESHPACKET_PRIORITY)
@@ -315,8 +427,8 @@ _LOGRECORD_LEVEL = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=1510,
- serialized_end=1598,
+ serialized_start=1541,
+ serialized_end=1629,
)
_sym_db.RegisterEnumDescriptor(_LOGRECORD_LEVEL)
@@ -417,6 +529,13 @@ _USER = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ _descriptor.FieldDescriptor(
+ name='hw_model', full_name='User.hw_model', index=4,
+ number=6, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
@@ -430,7 +549,7 @@ _USER = _descriptor.Descriptor(
oneofs=[
],
serialized_start=150,
- serialized_end=224,
+ serialized_end=258,
)
@@ -461,8 +580,8 @@ _ROUTEDISCOVERY = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
- serialized_start=226,
- serialized_end=257,
+ serialized_start=260,
+ serialized_end=291,
)
@@ -513,8 +632,8 @@ _ROUTING = _descriptor.Descriptor(
create_key=_descriptor._internal_create_key,
fields=[]),
],
- serialized_start=260,
- serialized_end=548,
+ serialized_start=294,
+ serialized_end=582,
)
@@ -580,8 +699,8 @@ _DATA = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
- serialized_start=550,
- serialized_end=673,
+ serialized_start=584,
+ serialized_end=707,
)
@@ -688,8 +807,8 @@ _MESHPACKET = _descriptor.Descriptor(
create_key=_descriptor._internal_create_key,
fields=[]),
],
- serialized_start=676,
- serialized_end=1011,
+ serialized_start=710,
+ serialized_end=1045,
)
@@ -729,13 +848,6 @@ _NODEINFO = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='next_hop', full_name='NodeInfo.next_hop', index=4,
- number=5, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
@@ -748,8 +860,8 @@ _NODEINFO = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
- serialized_start=1013,
- serialized_end=1117,
+ serialized_start=1047,
+ serialized_end=1133,
)
@@ -797,12 +909,12 @@ _MYNODEINFO = _descriptor.Descriptor(
is_extension=False, extension_scope=None,
serialized_options=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
- name='hw_model', full_name='MyNodeInfo.hw_model', index=5,
+ name='hw_model_deprecated', full_name='MyNodeInfo.hw_model_deprecated', index=5,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ serialized_options=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='firmware_version', full_name='MyNodeInfo.firmware_version', index=6,
number=6, type=9, cpp_type=9, label=1,
@@ -857,8 +969,8 @@ _MYNODEINFO = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
- serialized_start=1120,
- serialized_end=1414,
+ serialized_start=1136,
+ serialized_end=1445,
)
@@ -911,8 +1023,8 @@ _LOGRECORD = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
- serialized_start=1417,
- serialized_end=1598,
+ serialized_start=1448,
+ serialized_end=1629,
)
@@ -990,8 +1102,8 @@ _FROMRADIO = _descriptor.Descriptor(
create_key=_descriptor._internal_create_key,
fields=[]),
],
- serialized_start=1601,
- serialized_end=1834,
+ serialized_start=1632,
+ serialized_end=1865,
)
@@ -1034,10 +1146,11 @@ _TORADIO = _descriptor.Descriptor(
create_key=_descriptor._internal_create_key,
fields=[]),
],
- serialized_start=1836,
- serialized_end=1944,
+ serialized_start=1867,
+ serialized_end=1975,
)
+_USER.fields_by_name['hw_model'].enum_type = _HARDWAREMODEL
_ROUTING.fields_by_name['route_request'].message_type = _ROUTEDISCOVERY
_ROUTING.fields_by_name['route_reply'].message_type = _ROUTEDISCOVERY
_ROUTING.fields_by_name['error_reason'].enum_type = _ROUTING_ERROR
@@ -1106,6 +1219,7 @@ DESCRIPTOR.message_types_by_name['MyNodeInfo'] = _MYNODEINFO
DESCRIPTOR.message_types_by_name['LogRecord'] = _LOGRECORD
DESCRIPTOR.message_types_by_name['FromRadio'] = _FROMRADIO
DESCRIPTOR.message_types_by_name['ToRadio'] = _TORADIO
+DESCRIPTOR.enum_types_by_name['HardwareModel'] = _HARDWAREMODEL
DESCRIPTOR.enum_types_by_name['Constants'] = _CONSTANTS
DESCRIPTOR.enum_types_by_name['CriticalErrorCode'] = _CRITICALERRORCODE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@@ -1190,6 +1304,7 @@ _sym_db.RegisterMessage(ToRadio)
DESCRIPTOR._options = None
_MYNODEINFO.fields_by_name['region']._options = None
+_MYNODEINFO.fields_by_name['hw_model_deprecated']._options = None
# @@protoc_insertion_point(module_scope)
@@ -1506,9 +1621,9 @@ _MYNODEINFO.fields_by_name['region']._options = None
-
-var hw_model
+var hw_model_deprecated
-
-
Field MyNodeInfo.hw_model
+Field MyNodeInfo.hw_model_deprecated
var max_channels
-
@@ -1556,10 +1671,6 @@ _MYNODEINFO.fields_by_name['region']._options = None
Instance variables
-var next_hop
--
-
-
var num
-
@@ -1770,6 +1881,10 @@ _MYNODEINFO.fields_by_name['region']._options = None
Instance variables
+var hw_model
+-
+
+
var id
-
@@ -1881,7 +1996,7 @@ _MYNODEINFO.fields_by_name['region']._options = None
error_count
firmware_version
has_gps
-hw_model
+hw_model_deprecated
max_channels
message_timeout_msec
min_app_version
@@ -1892,9 +2007,8 @@ _MYNODEINFO.fields_by_name['region']._options = None
-
-
-
-
+
DESCRIPTOR
+hw_model
id
long_name
macaddr
diff --git a/docs/meshtastic/remote_hardware.html b/docs/meshtastic/remote_hardware.html
index a0ffd0b..7524b03 100644
--- a/docs/meshtastic/remote_hardware.html
+++ b/docs/meshtastic/remote_hardware.html
@@ -29,14 +29,16 @@
from . import portnums_pb2, remote_hardware_pb2
from pubsub import pub
+
def onGPIOreceive(packet, interface):
"""Callback for received GPIO responses
-
+
FIXME figure out how to do closures with methods in python"""
pb = remote_hardware_pb2.HardwareMessage()
pb.ParseFromString(packet["decoded"]["data"]["payload"])
print(f"Received RemoteHardware typ={pb.typ}, gpio_value={pb.gpio_value}")
+
class RemoteHardwareClient:
"""
This is the client code to control/monitor simple hardware built into the
@@ -51,8 +53,17 @@ class RemoteHardwareClient:
iface is the already open MeshInterface instance
"""
self.iface = iface
+ ch = iface.localNode.getChannelByName("gpio")
+ if not ch:
+ raise Exception(
+ "No gpio channel found, please create before using this (secured) service")
+ self.channelIndex = ch.index
- pub.subscribe(onGPIOreceive, "meshtastic.receive.data.REMOTE_HARDWARE_APP")
+ pub.subscribe(
+ onGPIOreceive, "meshtastic.receive.data.REMOTE_HARDWARE_APP")
+
+ def _sendHardware(self, nodeid, r):
+ return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck=True, channelIndex=self.channelIndex)
def writeGPIOs(self, nodeid, mask, vals):
"""
@@ -63,21 +74,21 @@ class RemoteHardwareClient:
r.typ = remote_hardware_pb2.HardwareMessage.Type.WRITE_GPIOS
r.gpio_mask = mask
r.gpio_value = vals
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
def readGPIOs(self, nodeid, mask):
"""Read the specified bits from GPIO inputs on the device"""
r = remote_hardware_pb2.HardwareMessage()
r.typ = remote_hardware_pb2.HardwareMessage.Type.READ_GPIOS
r.gpio_mask = mask
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
def watchGPIOs(self, nodeid, mask):
"""Watch the specified bits from GPIO inputs on the device for changes"""
r = remote_hardware_pb2.HardwareMessage()
r.typ = remote_hardware_pb2.HardwareMessage.Type.WATCH_GPIOS
r.gpio_mask = mask
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
@@ -99,7 +110,7 @@ class RemoteHardwareClient:
def onGPIOreceive(packet, interface):
"""Callback for received GPIO responses
-
+
FIXME figure out how to do closures with methods in python"""
pb = remote_hardware_pb2.HardwareMessage()
pb.ParseFromString(packet["decoded"]["data"]["payload"])
@@ -140,8 +151,17 @@ code for how you can connect to your own custom meshtastic services
iface is the already open MeshInterface instance
"""
self.iface = iface
+ ch = iface.localNode.getChannelByName("gpio")
+ if not ch:
+ raise Exception(
+ "No gpio channel found, please create before using this (secured) service")
+ self.channelIndex = ch.index
- pub.subscribe(onGPIOreceive, "meshtastic.receive.data.REMOTE_HARDWARE_APP")
+ pub.subscribe(
+ onGPIOreceive, "meshtastic.receive.data.REMOTE_HARDWARE_APP")
+
+ def _sendHardware(self, nodeid, r):
+ return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck=True, channelIndex=self.channelIndex)
def writeGPIOs(self, nodeid, mask, vals):
"""
@@ -152,21 +172,21 @@ code for how you can connect to your own custom meshtastic services
r.typ = remote_hardware_pb2.HardwareMessage.Type.WRITE_GPIOS
r.gpio_mask = mask
r.gpio_value = vals
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
def readGPIOs(self, nodeid, mask):
"""Read the specified bits from GPIO inputs on the device"""
r = remote_hardware_pb2.HardwareMessage()
r.typ = remote_hardware_pb2.HardwareMessage.Type.READ_GPIOS
r.gpio_mask = mask
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
def watchGPIOs(self, nodeid, mask):
"""Watch the specified bits from GPIO inputs on the device for changes"""
r = remote_hardware_pb2.HardwareMessage()
r.typ = remote_hardware_pb2.HardwareMessage.Type.WATCH_GPIOS
r.gpio_mask = mask
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
Methods
@@ -184,7 +204,7 @@ code for how you can connect to your own custom meshtastic services
r = remote_hardware_pb2.HardwareMessage()
r.typ = remote_hardware_pb2.HardwareMessage.Type.READ_GPIOS
r.gpio_mask = mask
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
@@ -201,7 +221,7 @@ code for how you can connect to your own custom meshtastic services
r = remote_hardware_pb2.HardwareMessage()
r.typ = remote_hardware_pb2.HardwareMessage.Type.WATCH_GPIOS
r.gpio_mask = mask
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
@@ -224,7 +244,7 @@ are 1 will be changed
r.typ = remote_hardware_pb2.HardwareMessage.Type.WRITE_GPIOS
r.gpio_mask = mask
r.gpio_value = vals
- return self.iface.sendData(r, nodeid, portnums_pb2.REMOTE_HARDWARE_APP, wantAck = True)
+ return self._sendHardware(nodeid, r)
diff --git a/docs/meshtastic/test.html b/docs/meshtastic/test.html
index 0a4ddc7..9b68426 100644
--- a/docs/meshtastic/test.html
+++ b/docs/meshtastic/test.html
@@ -28,7 +28,7 @@
import logging
from . import util
-from . import SerialInterface, BROADCAST_NUM
+from . import SerialInterface, TCPInterface, BROADCAST_NUM
from pubsub import pub
import time
import sys
@@ -178,7 +178,26 @@ def testAll():
testThread()
for i in interfaces:
- i.close()
+ i.close()
+
+def testSimulator():
+ """
+ Assume that someone has launched meshtastic-native as a simulated node.
+ Talk to that node over TCP, do some operations and if they are successful
+ exit the process with a success code, else exit with a non zero exit code.
+
+ Run with
+ python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
+ """
+ logging.basicConfig(level=logging.DEBUG if False else logging.INFO)
+ logging.info("Connecting to simulator on localhost!")
+ iface = TCPInterface("localhost")
+ iface.showInfo()
+ iface.localNode.showInfo()
+ iface.localNode.exitSimulator()
+ iface.close()
+ logging.info("Integration test successful!")
+ sys.exit(0)
@@ -405,6 +424,39 @@ toInterface {[type]} – [description]
return False # Failed to send
+
+def testSimulator()
+
+-
+
Assume that someone has launched meshtastic-native as a simulated node.
+Talk to that node over TCP, do some operations and if they are successful
+exit the process with a success code, else exit with a non zero exit code.
+
Run with
+python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
+
+
+Expand source code
+
+def testSimulator():
+ """
+ Assume that someone has launched meshtastic-native as a simulated node.
+ Talk to that node over TCP, do some operations and if they are successful
+ exit the process with a success code, else exit with a non zero exit code.
+
+ Run with
+ python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
+ """
+ logging.basicConfig(level=logging.DEBUG if False else logging.INFO)
+ logging.info("Connecting to simulator on localhost!")
+ iface = TCPInterface("localhost")
+ iface.showInfo()
+ iface.localNode.showInfo()
+ iface.localNode.exitSimulator()
+ iface.close()
+ logging.info("Integration test successful!")
+ sys.exit(0)
+
+
def testThread(numTests=50)
@@ -451,6 +503,7 @@ toInterface {[type]} – [description]
subscribe
testAll
testSend
+testSimulator
testThread
diff --git a/proto b/proto
index 943c3c2..b8c0499 160000
--- a/proto
+++ b/proto
@@ -1 +1 @@
-Subproject commit 943c3c24ec1e5116536cdabe31f496cb5b58a18e
+Subproject commit b8c0499f28f9673d1df17d04da562e30703f01cb
diff --git a/setup.py b/setup.py
index c540aa7..5f768c5 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ with open("README.md", "r") as fh:
# This call to setup() does all the work
setup(
name="meshtastic",
- version="1.2.10",
+ version="1.2.11",
description="Python API & client shell for talking to Meshtastic devices",
long_description=long_description,
long_description_content_type="text/markdown",