From 6896e70c314cd6280e2ecf36a7add89a192b4545 Mon Sep 17 00:00:00 2001
From: Jm Casler
var Bw250Cr46Sf2048var Bw250Cr47Sf1024var Bw31_25Cr48Sf512BANDWIDTH_FIELD_NUMBERBw125Cr45Sf128Bw125Cr48Sf4096Bw250Cr46Sf2048Bw250Cr47Sf1024Bw31_25Cr48Sf512Bw500Cr45Sf128ByteSizemeshtastic.testTesting
meshtastic.tunnelCode for IP tunnel over a mesh …
meshtastic.utilUtility functions.
MeshInterface:
closegetLongNamegetMyNodeInfogetMyUsergetNodegetShortNamesendDatasendPositionsendTextGet long name
def getLongName(self):
+ """Get long name"""
user = self.getMyUser()
if user is not None:
return user.get('longName', None)
@@ -2004,12 +2019,13 @@ noProto – If True, don't try to run our protocol on the link - just be a d
def getMyNodeInfo(self)
Get info about my node.
def getMyNodeInfo(self):
+ """Get info about my node."""
if self.myInfo is None:
return None
return self.nodesByNum.get(self.myInfo.my_node_num)
@@ -2019,12 +2035,13 @@ noProto – If True, don't try to run our protocol on the link - just be a d
def getMyUser(self)
Get user
def getMyUser(self):
+ """Get user"""
nodeInfo = self.getMyNodeInfo()
if nodeInfo is not None:
return nodeInfo.get('user')
@@ -2056,12 +2073,13 @@ noProto – If True, don't try to run our protocol on the link - just be a d
def getShortName(self)
Get short name
def getShortName(self):
+ """Get short name"""
user = self.getMyUser()
if user is not None:
return user.get('shortName', None)
@@ -2079,7 +2097,8 @@ destinationId {nodeId or nodeNum} – where to send this message (default: {
portNum – the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list
wantAck – True if you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)
wantResponse – True if you want the service on the other side to send an application layer response
-onResponse – A closure of the form funct(packet), that will be called when a response packet arrives (or the transaction is NAKed due to non receipt)
+onResponse – A closure of the form funct(packet), that will be called when a response packet arrives
+(or the transaction is NAKed due to non receipt)
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
@@ -2099,7 +2118,8 @@ onResponse – A closure of the form funct(packet), that will be called when
portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list
wantAck -- True if you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)
wantResponse -- True if you want the service on the other side to send an application layer response
- onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives (or the transaction is NAKed due to non receipt)
+ onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives
+ (or the transaction is NAKed due to non receipt)
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
"""
@@ -2151,13 +2171,13 @@ the local position.
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
"""
p = mesh_pb2.Position()
- if(latitude != 0.0):
+ if latitude != 0.0:
p.latitude_i = int(latitude / 1e-7)
- if(longitude != 0.0):
+ if longitude != 0.0:
p.longitude_i = int(longitude / 1e-7)
- if(altitude != 0):
+ if altitude != 0:
p.altitude = int(altitude)
if timeSec == 0:
@@ -2213,7 +2233,7 @@ wantResponse – True if you want the service on the other side to send an a
wantResponse=wantResponse,
hopLimit=hopLimit,
onResponse=onResponse,
- channelIndex=channelIndex);
+ channelIndex=channelIndex)
@@ -2394,7 +2414,7 @@ debugOut {stream} – If a stream is provided, any debug serial output from
# rts=False Needed to prevent TBEAMs resetting on OSX, because rts is connected to reset
self.stream.port = devPath
-
+
# HACK: If the platform driving the serial port is unable to leave the RTS pin in high-impedance
# mode, set RTS to false so that the device platform won't be reset spuriously.
# Linux does this properly, so don't apply this hack on Linux (because it makes the reset button not work).
@@ -2404,30 +2424,30 @@ debugOut {stream} – If a stream is provided, any debug serial output from
StreamInterface.__init__(
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow)
-
+
"""true if platform driving the serial port is Windows Subsystem for Linux 1."""
def _isWsl1(self):
- # WSL1 identifies itself as Linux, but has a special char device at /dev/lxss for use with session control,
- # e.g. /init. We should treat WSL1 as Windows for the RTS-driving hack because the underlying platfrom
+ # WSL1 identifies itself as Linux, but has a special char device at /dev/lxss for use with session control,
+ # e.g. /init. We should treat WSL1 as Windows for the RTS-driving hack because the underlying platfrom
# serial driver for the CP21xx still exhibits the buggy behavior.
- # WSL2 is not covered here, as it does not (as of 2021-May-25) support the appropriate functionality to
+ # WSL2 is not covered here, as it does not (as of 2021-May-25) support the appropriate functionality to
# share or pass-through serial ports.
try:
# Claims to be Linux, but has /dev/lxss; must be WSL 1
- return platform.system() == 'Linux' and stat.S_ISCHR(os.stat('/dev/lxss').st_mode);
+ return platform.system() == 'Linux' and stat.S_ISCHR(os.stat('/dev/lxss').st_mode)
except:
# Couldn't stat /dev/lxss special device; not WSL1
- return False;
-
+ return False
+
def _hostPlatformAlwaysDrivesUartRts(self):
# OS-X/Windows seems to have a bug in its CP21xx serial drivers. It ignores that we asked for no RTSCTS
# control and will always drive RTS either high or low (rather than letting the CP102 leave
# it as an open-collector floating pin).
- # TODO: When WSL2 supports USB passthrough, this will get messier. If/when WSL2 gets virtual serial
- # ports that "share" the Windows serial port (and thus the Windows drivers), this code will need to be
+ # TODO: When WSL2 supports USB passthrough, this will get messier. If/when WSL2 gets virtual serial
+ # ports that "share" the Windows serial port (and thus the Windows drivers), this code will need to be
# updated to reflect that as well -- or if T-Beams get made with an alternate USB to UART bridge that has
# a less buggy driver.
- return platform.system() != 'Linux' or self._isWsl1();
+ return platform.system() != 'Linux' or self._isWsl1()
closeconnectgetLongNamegetMyNodeInfogetMyUsergetNodegetShortNamesendDatasendPositionsendTextInterface class for meshtastic devices over a stream link (serial, TCP, etc)
-Constructor, opens a connection to self.stream
+Constructor, opens a connection to self.stream
Keyword Arguments: devPath {string} – A filepath to a device, i.e. /dev/ttyUSB0 (default: {None}) debugOut {stream} – If a stream is provided, any debug serial output from the device will be emitted to that stream. (default: {None})
@@ -2476,7 +2500,7 @@ debugOut {stream} – If a stream is provided, any debug serial output from """Interface class for meshtastic devices over a stream link (serial, TCP, etc)""" def __init__(self, debugOut=None, noProto=False, connectNow=True): - """Constructor, opens a connection to self.stream + """Constructor, opens a connection to self.stream Keyword Arguments: devPath {string} -- A filepath to a device, i.e. /dev/ttyUSB0 (default: {None}) @@ -2692,7 +2716,11 @@ start the reading thread later.MeshInterface:
getLongNamegetMyNodeInfogetMyUsergetNodegetShortNamesendDatasendPositionsendTextcloseconnectgetLongNamegetMyNodeInfogetMyUsergetNodegetShortNamesendDatasendPositionsendTextvar BITRATE_FIELD_NUMBERvar DESCRIPTORvar bitrateGetter for bitrate.
def getter(self):
+ # TODO(protobuf-team): This may be broken since there may not be
+ # default_value. Combine with has_default_value somehow.
+ return self._fields.get(field, default_value)
+var error_addressGetter for error_address.
MyNodeInfoBITRATE_FIELD_NUMBERByteSizeClearClearFieldSetInParentUnknownFieldsWhichOneofbitrateerror_addresserror_codeerror_count
-def setOwner(self, long_name, short_name=None, is_licensed=False)
+def setOwner(self, long_name=None, short_name=None, is_licensed=False, team=None)
Set device owner name
def setOwner(self, long_name, short_name=None, is_licensed=False):
+def setOwner(self, long_name=None, short_name=None, is_licensed=False, team=None):
"""Set device owner name"""
nChars = 3
minChars = 2
@@ -1034,6 +1032,8 @@ class Node:
short_name = short_name[:nChars]
p.set_owner.short_name = short_name
p.set_owner.is_licensed = is_licensed
+ if team is not None:
+ p.set_owner.team = team
return self._sendAdmin(p)
def setURL(self, url):
"""Set mesh network URL"""
- if self.radioConfig == None:
+ if self.radioConfig is None:
raise Exception("No RadioConfig has been read")
# URLs are of the form https://www.meshtastic.org/d/#{base64_channel_set}
@@ -1068,6 +1068,9 @@ class Node:
channelSet = apponly_pb2.ChannelSet()
channelSet.ParseFromString(decodedURL)
+ if len(channelSet.settings) == 0:
+ raise Exception("There were no settings.")
+
i = 0
for chs in channelSet.settings:
ch = channel_pb2.Channel()
@@ -1163,7 +1166,7 @@ class Node:
def writeConfig(self):
"""Write the current (edited) radioConfig to the device"""
- if self.radioConfig == None:
+ if self.radioConfig is None:
raise Exception("No RadioConfig has been read")
p = admin_pb2.AdminMessage()
diff --git a/docs/meshtastic/radioconfig_pb2.html b/docs/meshtastic/radioconfig_pb2.html
index 9670823..bb1b452 100644
--- a/docs/meshtastic/radioconfig_pb2.html
+++ b/docs/meshtastic/radioconfig_pb2.html
@@ -47,7 +47,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package='',
syntax='proto3',
serialized_options=b'\n\023com.geeksville.meshB\021RadioConfigProtosH\003Z!github.com/meshtastic/gomeshproto',
- serialized_pb=b'\n\x11radioconfig.proto\"\xfa\x12\n\x0bRadioConfig\x12\x31\n\x0bpreferences\x18\x01 \x01(\x0b\x32\x1c.RadioConfig.UserPreferences\x1a\xb7\x12\n\x0fUserPreferences\x12\x1f\n\x17position_broadcast_secs\x18\x01 \x01(\r\x12 \n\x18position_broadcast_smart\x18\x11 \x01(\x08\x12\x1b\n\x13send_owner_interval\x18\x02 \x01(\r\x12\x1b\n\x13wait_bluetooth_secs\x18\x04 \x01(\r\x12\x16\n\x0escreen_on_secs\x18\x05 \x01(\r\x12\x1a\n\x12phone_timeout_secs\x18\x06 \x01(\r\x12\x1d\n\x15phone_sds_timeout_sec\x18\x07 \x01(\r\x12\x1d\n\x15mesh_sds_timeout_secs\x18\x08 \x01(\r\x12\x10\n\x08sds_secs\x18\t \x01(\r\x12\x0f\n\x07ls_secs\x18\n \x01(\r\x12\x15\n\rmin_wake_secs\x18\x0b \x01(\r\x12\x11\n\twifi_ssid\x18\x0c \x01(\t\x12\x15\n\rwifi_password\x18\r \x01(\t\x12\x14\n\x0cwifi_ap_mode\x18\x0e \x01(\x08\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\x12&\n\x0e\x63harge_current\x18\x10 \x01(\x0e\x32\x0e.ChargeCurrent\x12\x11\n\tis_router\x18% \x01(\x08\x12\x14\n\x0cis_low_power\x18& \x01(\x08\x12\x16\n\x0e\x66ixed_position\x18\' \x01(\x08\x12\x17\n\x0fserial_disabled\x18( \x01(\x08\x12(\n\x0elocation_share\x18 \x01(\x0e\x32\x10.LocationSharing\x12$\n\rgps_operation\x18! \x01(\x0e\x32\r.GpsOperation\x12\x1b\n\x13gps_update_interval\x18\" \x01(\r\x12\x18\n\x10gps_attempt_time\x18$ \x01(\r\x12\x15\n\rgps_accept_2d\x18- \x01(\x08\x12\x13\n\x0bgps_max_dop\x18. \x01(\r\x12\x18\n\x10\x66requency_offset\x18) \x01(\x02\x12\x13\n\x0bmqtt_server\x18* \x01(\t\x12\x15\n\rmqtt_disabled\x18+ \x01(\x08\x12(\n\ngps_format\x18, \x01(\x0e\x32\x14.GpsCoordinateFormat\x12\x15\n\rfactory_reset\x18\x64 \x01(\x08\x12\x19\n\x11\x64\x65\x62ug_log_enabled\x18\x65 \x01(\x08\x12\x17\n\x0fignore_incoming\x18g \x03(\r\x12\x1c\n\x14serialplugin_enabled\x18x \x01(\x08\x12\x19\n\x11serialplugin_echo\x18y \x01(\x08\x12\x18\n\x10serialplugin_rxd\x18z \x01(\r\x12\x18\n\x10serialplugin_txd\x18{ \x01(\r\x12\x1c\n\x14serialplugin_timeout\x18| \x01(\r\x12\x19\n\x11serialplugin_mode\x18} \x01(\r\x12\'\n\x1f\x65xt_notification_plugin_enabled\x18~ \x01(\x08\x12)\n!ext_notification_plugin_output_ms\x18\x7f \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_output\x18\x80\x01 \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_active\x18\x81\x01 \x01(\x08\x12.\n%ext_notification_plugin_alert_message\x18\x82\x01 \x01(\x08\x12+\n\"ext_notification_plugin_alert_bell\x18\x83\x01 \x01(\x08\x12\"\n\x19range_test_plugin_enabled\x18\x84\x01 \x01(\x08\x12!\n\x18range_test_plugin_sender\x18\x85\x01 \x01(\r\x12\x1f\n\x16range_test_plugin_save\x18\x86\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_enabled\x18\x94\x01 \x01(\x08\x12\'\n\x1estore_forward_plugin_heartbeat\x18\x95\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_records\x18\x89\x01 \x01(\r\x12\x30\n\'store_forward_plugin_history_return_max\x18\x8a\x01 \x01(\r\x12\x33\n*store_forward_plugin_history_return_window\x18\x8b\x01 \x01(\r\x12=\n4environmental_measurement_plugin_measurement_enabled\x18\x8c\x01 \x01(\x08\x12\x38\n/environmental_measurement_plugin_screen_enabled\x18\x8d\x01 \x01(\x08\x12\x44\n;environmental_measurement_plugin_read_error_count_threshold\x18\x8e\x01 \x01(\r\x12\x39\n0environmental_measurement_plugin_update_interval\x18\x8f\x01 \x01(\r\x12;\n2environmental_measurement_plugin_recovery_interval\x18\x90\x01 \x01(\r\x12;\n2environmental_measurement_plugin_display_farenheit\x18\x91\x01 \x01(\x08\x12v\n,environmental_measurement_plugin_sensor_type\x18\x92\x01 \x01(\x0e\x32?.RadioConfig.UserPreferences.EnvironmentalMeasurementSensorType\x12\x34\n+environmental_measurement_plugin_sensor_pin\x18\x93\x01 \x01(\r\x12\x17\n\x0eposition_flags\x18\x96\x01 \x01(\r\x12\x1a\n\x11is_always_powered\x18\x97\x01 \x01(\x08\x12\"\n\x19\x61uto_screen_carousel_secs\x18\x98\x01 \x01(\r\"<\n\"EnvironmentalMeasurementSensorType\x12\t\n\x05\x44HT11\x10\x00\x12\x0b\n\x07\x44S18B20\x10\x01J\x06\x08\x88\x01\x10\x89\x01*f\n\nRegionCode\x12\t\n\x05Unset\x10\x00\x12\x06\n\x02US\x10\x01\x12\t\n\x05\x45U433\x10\x02\x12\t\n\x05\x45U865\x10\x03\x12\x06\n\x02\x43N\x10\x04\x12\x06\n\x02JP\x10\x05\x12\x07\n\x03\x41NZ\x10\x06\x12\x06\n\x02KR\x10\x07\x12\x06\n\x02TW\x10\x08\x12\x06\n\x02RU\x10\t*\xd1\x01\n\rChargeCurrent\x12\x0b\n\x07MAUnset\x10\x00\x12\t\n\x05MA100\x10\x01\x12\t\n\x05MA190\x10\x02\x12\t\n\x05MA280\x10\x03\x12\t\n\x05MA360\x10\x04\x12\t\n\x05MA450\x10\x05\x12\t\n\x05MA550\x10\x06\x12\t\n\x05MA630\x10\x07\x12\t\n\x05MA700\x10\x08\x12\t\n\x05MA780\x10\t\x12\t\n\x05MA880\x10\n\x12\t\n\x05MA960\x10\x0b\x12\n\n\x06MA1000\x10\x0c\x12\n\n\x06MA1080\x10\r\x12\n\n\x06MA1160\x10\x0e\x12\n\n\x06MA1240\x10\x0f\x12\n\n\x06MA1320\x10\x10*j\n\x0cGpsOperation\x12\x0e\n\nGpsOpUnset\x10\x00\x12\x13\n\x0fGpsOpStationary\x10\x01\x12\x0f\n\x0bGpsOpMobile\x10\x02\x12\x11\n\rGpsOpTimeOnly\x10\x03\x12\x11\n\rGpsOpDisabled\x10\x04*\x83\x01\n\x13GpsCoordinateFormat\x12\x10\n\x0cGpsFormatDec\x10\x00\x12\x10\n\x0cGpsFormatDMS\x10\x01\x12\x10\n\x0cGpsFormatUTM\x10\x02\x12\x11\n\rGpsFormatMGRS\x10\x03\x12\x10\n\x0cGpsFormatOLC\x10\x04\x12\x11\n\rGpsFormatOSGR\x10\x05*@\n\x0fLocationSharing\x12\x0c\n\x08LocUnset\x10\x00\x12\x0e\n\nLocEnabled\x10\x01\x12\x0f\n\x0bLocDisabled\x10\x02*\xbc\x01\n\rPositionFlags\x12\x11\n\rPOS_UNDEFINED\x10\x00\x12\x10\n\x0cPOS_ALTITUDE\x10\x01\x12\x0f\n\x0bPOS_ALT_MSL\x10\x02\x12\x0f\n\x0bPOS_GEO_SEP\x10\x04\x12\x0b\n\x07POS_DOP\x10\x08\x12\r\n\tPOS_HVDOP\x10\x10\x12\x0f\n\x0bPOS_BATTERY\x10 \x12\x11\n\rPOS_SATINVIEW\x10@\x12\x10\n\x0bPOS_SEQ_NOS\x10\x80\x01\x12\x12\n\rPOS_TIMESTAMP\x10\x80\x02\x42M\n\x13\x63om.geeksville.meshB\x11RadioConfigProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
+ serialized_pb=b'\n\x11radioconfig.proto\"\xa3\x13\n\x0bRadioConfig\x12\x31\n\x0bpreferences\x18\x01 \x01(\x0b\x32\x1c.RadioConfig.UserPreferences\x1a\xe0\x12\n\x0fUserPreferences\x12\x1f\n\x17position_broadcast_secs\x18\x01 \x01(\r\x12 \n\x18position_broadcast_smart\x18\x11 \x01(\x08\x12\x1b\n\x13send_owner_interval\x18\x02 \x01(\r\x12\x1b\n\x13wait_bluetooth_secs\x18\x04 \x01(\r\x12\x16\n\x0escreen_on_secs\x18\x05 \x01(\r\x12\x1a\n\x12phone_timeout_secs\x18\x06 \x01(\r\x12\x1d\n\x15phone_sds_timeout_sec\x18\x07 \x01(\r\x12\x1d\n\x15mesh_sds_timeout_secs\x18\x08 \x01(\r\x12\x10\n\x08sds_secs\x18\t \x01(\r\x12\x0f\n\x07ls_secs\x18\n \x01(\r\x12\x15\n\rmin_wake_secs\x18\x0b \x01(\r\x12\x11\n\twifi_ssid\x18\x0c \x01(\t\x12\x15\n\rwifi_password\x18\r \x01(\t\x12\x14\n\x0cwifi_ap_mode\x18\x0e \x01(\x08\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\x12&\n\x0e\x63harge_current\x18\x10 \x01(\x0e\x32\x0e.ChargeCurrent\x12\x11\n\tis_router\x18% \x01(\x08\x12\x14\n\x0cis_low_power\x18& \x01(\x08\x12\x16\n\x0e\x66ixed_position\x18\' \x01(\x08\x12\x17\n\x0fserial_disabled\x18( \x01(\x08\x12(\n\x0elocation_share\x18 \x01(\x0e\x32\x10.LocationSharing\x12$\n\rgps_operation\x18! \x01(\x0e\x32\r.GpsOperation\x12\x1b\n\x13gps_update_interval\x18\" \x01(\r\x12\x18\n\x10gps_attempt_time\x18$ \x01(\r\x12\x15\n\rgps_accept_2d\x18- \x01(\x08\x12\x13\n\x0bgps_max_dop\x18. \x01(\r\x12\x18\n\x10\x66requency_offset\x18) \x01(\x02\x12\x13\n\x0bmqtt_server\x18* \x01(\t\x12\x15\n\rmqtt_disabled\x18+ \x01(\x08\x12(\n\ngps_format\x18, \x01(\x0e\x32\x14.GpsCoordinateFormat\x12\x15\n\rfactory_reset\x18\x64 \x01(\x08\x12\x19\n\x11\x64\x65\x62ug_log_enabled\x18\x65 \x01(\x08\x12\x17\n\x0fignore_incoming\x18g \x03(\r\x12\x1c\n\x14serialplugin_enabled\x18x \x01(\x08\x12\x19\n\x11serialplugin_echo\x18y \x01(\x08\x12\x18\n\x10serialplugin_rxd\x18z \x01(\r\x12\x18\n\x10serialplugin_txd\x18{ \x01(\r\x12\x1c\n\x14serialplugin_timeout\x18| \x01(\r\x12\x19\n\x11serialplugin_mode\x18} \x01(\r\x12\'\n\x1f\x65xt_notification_plugin_enabled\x18~ \x01(\x08\x12)\n!ext_notification_plugin_output_ms\x18\x7f \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_output\x18\x80\x01 \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_active\x18\x81\x01 \x01(\x08\x12.\n%ext_notification_plugin_alert_message\x18\x82\x01 \x01(\x08\x12+\n\"ext_notification_plugin_alert_bell\x18\x83\x01 \x01(\x08\x12\"\n\x19range_test_plugin_enabled\x18\x84\x01 \x01(\x08\x12!\n\x18range_test_plugin_sender\x18\x85\x01 \x01(\r\x12\x1f\n\x16range_test_plugin_save\x18\x86\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_enabled\x18\x94\x01 \x01(\x08\x12\'\n\x1estore_forward_plugin_heartbeat\x18\x95\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_records\x18\x89\x01 \x01(\r\x12\x30\n\'store_forward_plugin_history_return_max\x18\x8a\x01 \x01(\r\x12\x33\n*store_forward_plugin_history_return_window\x18\x8b\x01 \x01(\r\x12=\n4environmental_measurement_plugin_measurement_enabled\x18\x8c\x01 \x01(\x08\x12\x38\n/environmental_measurement_plugin_screen_enabled\x18\x8d\x01 \x01(\x08\x12\x44\n;environmental_measurement_plugin_read_error_count_threshold\x18\x8e\x01 \x01(\r\x12\x39\n0environmental_measurement_plugin_update_interval\x18\x8f\x01 \x01(\r\x12;\n2environmental_measurement_plugin_recovery_interval\x18\x90\x01 \x01(\r\x12;\n2environmental_measurement_plugin_display_farenheit\x18\x91\x01 \x01(\x08\x12v\n,environmental_measurement_plugin_sensor_type\x18\x92\x01 \x01(\x0e\x32?.RadioConfig.UserPreferences.EnvironmentalMeasurementSensorType\x12\x34\n+environmental_measurement_plugin_sensor_pin\x18\x93\x01 \x01(\r\x12\x17\n\x0eposition_flags\x18\x96\x01 \x01(\r\x12\x1a\n\x11is_always_powered\x18\x97\x01 \x01(\x08\x12\"\n\x19\x61uto_screen_carousel_secs\x18\x98\x01 \x01(\r\x12\'\n\x1eon_battery_shutdown_after_secs\x18\x99\x01 \x01(\r\"<\n\"EnvironmentalMeasurementSensorType\x12\t\n\x05\x44HT11\x10\x00\x12\x0b\n\x07\x44S18B20\x10\x01J\x06\x08\x88\x01\x10\x89\x01*f\n\nRegionCode\x12\t\n\x05Unset\x10\x00\x12\x06\n\x02US\x10\x01\x12\t\n\x05\x45U433\x10\x02\x12\t\n\x05\x45U865\x10\x03\x12\x06\n\x02\x43N\x10\x04\x12\x06\n\x02JP\x10\x05\x12\x07\n\x03\x41NZ\x10\x06\x12\x06\n\x02KR\x10\x07\x12\x06\n\x02TW\x10\x08\x12\x06\n\x02RU\x10\t*\xd1\x01\n\rChargeCurrent\x12\x0b\n\x07MAUnset\x10\x00\x12\t\n\x05MA100\x10\x01\x12\t\n\x05MA190\x10\x02\x12\t\n\x05MA280\x10\x03\x12\t\n\x05MA360\x10\x04\x12\t\n\x05MA450\x10\x05\x12\t\n\x05MA550\x10\x06\x12\t\n\x05MA630\x10\x07\x12\t\n\x05MA700\x10\x08\x12\t\n\x05MA780\x10\t\x12\t\n\x05MA880\x10\n\x12\t\n\x05MA960\x10\x0b\x12\n\n\x06MA1000\x10\x0c\x12\n\n\x06MA1080\x10\r\x12\n\n\x06MA1160\x10\x0e\x12\n\n\x06MA1240\x10\x0f\x12\n\n\x06MA1320\x10\x10*j\n\x0cGpsOperation\x12\x0e\n\nGpsOpUnset\x10\x00\x12\x13\n\x0fGpsOpStationary\x10\x01\x12\x0f\n\x0bGpsOpMobile\x10\x02\x12\x11\n\rGpsOpTimeOnly\x10\x03\x12\x11\n\rGpsOpDisabled\x10\x04*\x83\x01\n\x13GpsCoordinateFormat\x12\x10\n\x0cGpsFormatDec\x10\x00\x12\x10\n\x0cGpsFormatDMS\x10\x01\x12\x10\n\x0cGpsFormatUTM\x10\x02\x12\x11\n\rGpsFormatMGRS\x10\x03\x12\x10\n\x0cGpsFormatOLC\x10\x04\x12\x11\n\rGpsFormatOSGR\x10\x05*@\n\x0fLocationSharing\x12\x0c\n\x08LocUnset\x10\x00\x12\x0e\n\nLocEnabled\x10\x01\x12\x0f\n\x0bLocDisabled\x10\x02*\xbc\x01\n\rPositionFlags\x12\x11\n\rPOS_UNDEFINED\x10\x00\x12\x10\n\x0cPOS_ALTITUDE\x10\x01\x12\x0f\n\x0bPOS_ALT_MSL\x10\x02\x12\x0f\n\x0bPOS_GEO_SEP\x10\x04\x12\x0b\n\x07POS_DOP\x10\x08\x12\r\n\tPOS_HVDOP\x10\x10\x12\x0f\n\x0bPOS_BATTERY\x10 \x12\x11\n\rPOS_SATINVIEW\x10@\x12\x10\n\x0bPOS_SEQ_NOS\x10\x80\x01\x12\x12\n\rPOS_TIMESTAMP\x10\x80\x02\x42M\n\x13\x63om.geeksville.meshB\x11RadioConfigProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
)
_REGIONCODE = _descriptor.EnumDescriptor(
@@ -99,8 +99,8 @@ _REGIONCODE = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=2450,
- serialized_end=2552,
+ serialized_start=2491,
+ serialized_end=2593,
)
_sym_db.RegisterEnumDescriptor(_REGIONCODE)
@@ -182,8 +182,8 @@ _CHARGECURRENT = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=2555,
- serialized_end=2764,
+ serialized_start=2596,
+ serialized_end=2805,
)
_sym_db.RegisterEnumDescriptor(_CHARGECURRENT)
@@ -217,8 +217,8 @@ _GPSOPERATION = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=2766,
- serialized_end=2872,
+ serialized_start=2807,
+ serialized_end=2913,
)
_sym_db.RegisterEnumDescriptor(_GPSOPERATION)
@@ -256,8 +256,8 @@ _GPSCOORDINATEFORMAT = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=2875,
- serialized_end=3006,
+ serialized_start=2916,
+ serialized_end=3047,
)
_sym_db.RegisterEnumDescriptor(_GPSCOORDINATEFORMAT)
@@ -283,8 +283,8 @@ _LOCATIONSHARING = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=3008,
- serialized_end=3072,
+ serialized_start=3049,
+ serialized_end=3113,
)
_sym_db.RegisterEnumDescriptor(_LOCATIONSHARING)
@@ -338,8 +338,8 @@ _POSITIONFLAGS = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
- serialized_start=3075,
- serialized_end=3263,
+ serialized_start=3116,
+ serialized_end=3304,
)
_sym_db.RegisterEnumDescriptor(_POSITIONFLAGS)
@@ -414,8 +414,8 @@ _RADIOCONFIG_USERPREFERENCES_ENVIRONMENTALMEASUREMENTSENSORTYPE = _descriptor.En
],
containing_type=None,
serialized_options=None,
- serialized_start=2380,
- serialized_end=2440,
+ serialized_start=2421,
+ serialized_end=2481,
)
_sym_db.RegisterEnumDescriptor(_RADIOCONFIG_USERPREFERENCES_ENVIRONMENTALMEASUREMENTSENSORTYPE)
@@ -875,6 +875,13 @@ _RADIOCONFIG_USERPREFERENCES = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='on_battery_shutdown_after_secs', full_name='RadioConfig.UserPreferences.on_battery_shutdown_after_secs', index=64,
+ number=153, 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),
],
extensions=[
],
@@ -889,7 +896,7 @@ _RADIOCONFIG_USERPREFERENCES = _descriptor.Descriptor(
oneofs=[
],
serialized_start=89,
- serialized_end=2448,
+ serialized_end=2489,
)
_RADIOCONFIG = _descriptor.Descriptor(
@@ -919,7 +926,7 @@ _RADIOCONFIG = _descriptor.Descriptor(
oneofs=[
],
serialized_start=22,
- serialized_end=2448,
+ serialized_end=2489,
)
_RADIOCONFIG_USERPREFERENCES.fields_by_name['region'].enum_type = _REGIONCODE
diff --git a/docs/meshtastic/remote_hardware.html b/docs/meshtastic/remote_hardware.html
index f059454..9e85b69 100644
--- a/docs/meshtastic/remote_hardware.html
+++ b/docs/meshtastic/remote_hardware.html
@@ -26,8 +26,8 @@
Expand source code
-from . import portnums_pb2, remote_hardware_pb2
-from pubsub import pub
+from pubsub import pub
+from . import portnums_pb2, remote_hardware_pb2
def onGPIOreceive(packet, interface):
@@ -40,7 +40,7 @@ def onGPIOreceive(packet, interface):
class RemoteHardwareClient:
"""
- This is the client code to control/monitor simple hardware built into the
+ This is the client code to control/monitor simple hardware built into the
meshtastic devices. It is intended to be both a useful API/service and example
code for how you can connect to your own custom meshtastic services
"""
@@ -141,7 +141,7 @@ code for how you can connect to your own custom meshtastic services
class RemoteHardwareClient:
"""
- This is the client code to control/monitor simple hardware built into the
+ This is the client code to control/monitor simple hardware built into the
meshtastic devices. It is intended to be both a useful API/service and example
code for how you can connect to your own custom meshtastic services
"""
diff --git a/docs/meshtastic/storeforward_pb2.html b/docs/meshtastic/storeforward_pb2.html
index 0e162c9..c4fd22d 100644
--- a/docs/meshtastic/storeforward_pb2.html
+++ b/docs/meshtastic/storeforward_pb2.html
@@ -46,14 +46,14 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package='',
syntax='proto3',
serialized_options=b'\n\023com.geeksville.meshB\017StoreAndForwardH\003Z!github.com/meshtastic/gomeshproto',
- serialized_pb=b'\n\x12storeforward.proto\"\x8d\x05\n\x16StoreAndForwardMessage\x12\x33\n\x02rr\x18\x01 \x01(\x0e\x32\'.StoreAndForwardMessage.RequestResponse\x12\x31\n\x05stats\x18\x02 \x01(\x0b\x32\".StoreAndForwardMessage.Statistics\x12\x30\n\x07history\x18\x03 \x01(\x0b\x32\x1f.StoreAndForwardMessage.History\x1a\xc6\x01\n\nStatistics\x12\x15\n\rMessagesTotal\x18\x01 \x01(\r\x12\x15\n\rMessagesSaved\x18\x02 \x01(\r\x12\x13\n\x0bMessagesMax\x18\x03 \x01(\r\x12\x0e\n\x06UpTime\x18\x04 \x01(\r\x12\x10\n\x08Requests\x18\x05 \x01(\r\x12\x17\n\x0fRequestsHistory\x18\x06 \x01(\r\x12\x11\n\tHeartbeat\x18\x07 \x01(\x08\x12\x11\n\tReturnMax\x18\x08 \x01(\r\x12\x14\n\x0cReturnWindow\x18\t \x01(\r\x1a\x32\n\x07History\x12\x17\n\x0fHistoryMessages\x18\x01 \x01(\r\x12\x0e\n\x06Window\x18\x02 \x01(\r\"\xdb\x01\n\x0fRequestResponse\x12\t\n\x05UNSET\x10\x00\x12\x10\n\x0cROUTER_ERROR\x10\x01\x12\x14\n\x10ROUTER_HEARTBEAT\x10\x02\x12\x0f\n\x0bROUTER_PING\x10\x03\x12\x0f\n\x0bROUTER_PONG\x10\x04\x12\x0f\n\x0bROUTER_BUSY\x10\x05\x12\x10\n\x0c\x43LIENT_ERROR\x10\x65\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x66\x12\x10\n\x0c\x43LIENT_STATS\x10g\x12\x0f\n\x0b\x43LIENT_PING\x10h\x12\x0f\n\x0b\x43LIENT_PONG\x10i\x12\x08\n\x03MAX\x10\xff\x01\x42K\n\x13\x63om.geeksville.meshB\x0fStoreAndForwardH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
+ serialized_pb=b'\n\x12storeforward.proto\"\xe7\x04\n\x0fStoreAndForward\x12,\n\x02rr\x18\x01 \x01(\x0e\x32 .StoreAndForward.RequestResponse\x12*\n\x05stats\x18\x02 \x01(\x0b\x32\x1b.StoreAndForward.Statistics\x12)\n\x07history\x18\x03 \x01(\x0b\x32\x18.StoreAndForward.History\x1a\xc6\x01\n\nStatistics\x12\x15\n\rMessagesTotal\x18\x01 \x01(\r\x12\x15\n\rMessagesSaved\x18\x02 \x01(\r\x12\x13\n\x0bMessagesMax\x18\x03 \x01(\r\x12\x0e\n\x06UpTime\x18\x04 \x01(\r\x12\x10\n\x08Requests\x18\x05 \x01(\r\x12\x17\n\x0fRequestsHistory\x18\x06 \x01(\r\x12\x11\n\tHeartbeat\x18\x07 \x01(\x08\x12\x11\n\tReturnMax\x18\x08 \x01(\r\x12\x14\n\x0cReturnWindow\x18\t \x01(\r\x1a\x32\n\x07History\x12\x17\n\x0fHistoryMessages\x18\x01 \x01(\r\x12\x0e\n\x06Window\x18\x02 \x01(\r\"\xd1\x01\n\x0fRequestResponse\x12\t\n\x05UNSET\x10\x00\x12\x10\n\x0cROUTER_ERROR\x10\x01\x12\x14\n\x10ROUTER_HEARTBEAT\x10\x02\x12\x0f\n\x0bROUTER_PING\x10\x03\x12\x0f\n\x0bROUTER_PONG\x10\x04\x12\x0f\n\x0bROUTER_BUSY\x10\x05\x12\x10\n\x0c\x43LIENT_ERROR\x10\x65\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x66\x12\x10\n\x0c\x43LIENT_STATS\x10g\x12\x0f\n\x0b\x43LIENT_PING\x10h\x12\x0f\n\x0b\x43LIENT_PONG\x10iBK\n\x13\x63om.geeksville.meshB\x0fStoreAndForwardH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
)
-_STOREANDFORWARDMESSAGE_REQUESTRESPONSE = _descriptor.EnumDescriptor(
+_STOREANDFORWARD_REQUESTRESPONSE = _descriptor.EnumDescriptor(
name='RequestResponse',
- full_name='StoreAndForwardMessage.RequestResponse',
+ full_name='StoreAndForward.RequestResponse',
filename=None,
file=DESCRIPTOR,
values=[
@@ -101,84 +101,80 @@ _STOREANDFORWARDMESSAGE_REQUESTRESPONSE = _descriptor.EnumDescriptor(
name='CLIENT_PONG', index=10, number=105,
serialized_options=None,
type=None),
- _descriptor.EnumValueDescriptor(
- name='MAX', index=11, number=255,
- serialized_options=None,
- type=None),
],
containing_type=None,
serialized_options=None,
- serialized_start=457,
- serialized_end=676,
+ serialized_start=429,
+ serialized_end=638,
)
-_sym_db.RegisterEnumDescriptor(_STOREANDFORWARDMESSAGE_REQUESTRESPONSE)
+_sym_db.RegisterEnumDescriptor(_STOREANDFORWARD_REQUESTRESPONSE)
-_STOREANDFORWARDMESSAGE_STATISTICS = _descriptor.Descriptor(
+_STOREANDFORWARD_STATISTICS = _descriptor.Descriptor(
name='Statistics',
- full_name='StoreAndForwardMessage.Statistics',
+ full_name='StoreAndForward.Statistics',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
- name='MessagesTotal', full_name='StoreAndForwardMessage.Statistics.MessagesTotal', index=0,
+ name='MessagesTotal', full_name='StoreAndForward.Statistics.MessagesTotal', index=0,
number=1, 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),
_descriptor.FieldDescriptor(
- name='MessagesSaved', full_name='StoreAndForwardMessage.Statistics.MessagesSaved', index=1,
+ name='MessagesSaved', full_name='StoreAndForward.Statistics.MessagesSaved', index=1,
number=2, 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),
_descriptor.FieldDescriptor(
- name='MessagesMax', full_name='StoreAndForwardMessage.Statistics.MessagesMax', index=2,
+ name='MessagesMax', full_name='StoreAndForward.Statistics.MessagesMax', index=2,
number=3, 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),
_descriptor.FieldDescriptor(
- name='UpTime', full_name='StoreAndForwardMessage.Statistics.UpTime', index=3,
+ name='UpTime', full_name='StoreAndForward.Statistics.UpTime', index=3,
number=4, 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),
_descriptor.FieldDescriptor(
- name='Requests', full_name='StoreAndForwardMessage.Statistics.Requests', index=4,
+ name='Requests', full_name='StoreAndForward.Statistics.Requests', 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),
_descriptor.FieldDescriptor(
- name='RequestsHistory', full_name='StoreAndForwardMessage.Statistics.RequestsHistory', index=5,
+ name='RequestsHistory', full_name='StoreAndForward.Statistics.RequestsHistory', index=5,
number=6, 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),
_descriptor.FieldDescriptor(
- name='Heartbeat', full_name='StoreAndForwardMessage.Statistics.Heartbeat', index=6,
+ name='Heartbeat', full_name='StoreAndForward.Statistics.Heartbeat', index=6,
number=7, 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),
_descriptor.FieldDescriptor(
- name='ReturnMax', full_name='StoreAndForwardMessage.Statistics.ReturnMax', index=7,
+ name='ReturnMax', full_name='StoreAndForward.Statistics.ReturnMax', index=7,
number=8, 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),
_descriptor.FieldDescriptor(
- name='ReturnWindow', full_name='StoreAndForwardMessage.Statistics.ReturnWindow', index=8,
+ name='ReturnWindow', full_name='StoreAndForward.Statistics.ReturnWindow', index=8,
number=9, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
@@ -196,26 +192,26 @@ _STOREANDFORWARDMESSAGE_STATISTICS = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
- serialized_start=204,
- serialized_end=402,
+ serialized_start=176,
+ serialized_end=374,
)
-_STOREANDFORWARDMESSAGE_HISTORY = _descriptor.Descriptor(
+_STOREANDFORWARD_HISTORY = _descriptor.Descriptor(
name='History',
- full_name='StoreAndForwardMessage.History',
+ full_name='StoreAndForward.History',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
- name='HistoryMessages', full_name='StoreAndForwardMessage.History.HistoryMessages', index=0,
+ name='HistoryMessages', full_name='StoreAndForward.History.HistoryMessages', index=0,
number=1, 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),
_descriptor.FieldDescriptor(
- name='Window', full_name='StoreAndForwardMessage.History.Window', index=1,
+ name='Window', full_name='StoreAndForward.History.Window', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
@@ -233,33 +229,33 @@ _STOREANDFORWARDMESSAGE_HISTORY = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
- serialized_start=404,
- serialized_end=454,
+ serialized_start=376,
+ serialized_end=426,
)
-_STOREANDFORWARDMESSAGE = _descriptor.Descriptor(
- name='StoreAndForwardMessage',
- full_name='StoreAndForwardMessage',
+_STOREANDFORWARD = _descriptor.Descriptor(
+ name='StoreAndForward',
+ full_name='StoreAndForward',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
- name='rr', full_name='StoreAndForwardMessage.rr', index=0,
+ name='rr', full_name='StoreAndForward.rr', index=0,
number=1, 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),
_descriptor.FieldDescriptor(
- name='stats', full_name='StoreAndForwardMessage.stats', index=1,
+ name='stats', full_name='StoreAndForward.stats', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
- name='history', full_name='StoreAndForwardMessage.history', index=2,
+ name='history', full_name='StoreAndForward.history', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
@@ -268,9 +264,9 @@ _STOREANDFORWARDMESSAGE = _descriptor.Descriptor(
],
extensions=[
],
- nested_types=[_STOREANDFORWARDMESSAGE_STATISTICS, _STOREANDFORWARDMESSAGE_HISTORY, ],
+ nested_types=[_STOREANDFORWARD_STATISTICS, _STOREANDFORWARD_HISTORY, ],
enum_types=[
- _STOREANDFORWARDMESSAGE_REQUESTRESPONSE,
+ _STOREANDFORWARD_REQUESTRESPONSE,
],
serialized_options=None,
is_extendable=False,
@@ -279,40 +275,40 @@ _STOREANDFORWARDMESSAGE = _descriptor.Descriptor(
oneofs=[
],
serialized_start=23,
- serialized_end=676,
+ serialized_end=638,
)
-_STOREANDFORWARDMESSAGE_STATISTICS.containing_type = _STOREANDFORWARDMESSAGE
-_STOREANDFORWARDMESSAGE_HISTORY.containing_type = _STOREANDFORWARDMESSAGE
-_STOREANDFORWARDMESSAGE.fields_by_name['rr'].enum_type = _STOREANDFORWARDMESSAGE_REQUESTRESPONSE
-_STOREANDFORWARDMESSAGE.fields_by_name['stats'].message_type = _STOREANDFORWARDMESSAGE_STATISTICS
-_STOREANDFORWARDMESSAGE.fields_by_name['history'].message_type = _STOREANDFORWARDMESSAGE_HISTORY
-_STOREANDFORWARDMESSAGE_REQUESTRESPONSE.containing_type = _STOREANDFORWARDMESSAGE
-DESCRIPTOR.message_types_by_name['StoreAndForwardMessage'] = _STOREANDFORWARDMESSAGE
+_STOREANDFORWARD_STATISTICS.containing_type = _STOREANDFORWARD
+_STOREANDFORWARD_HISTORY.containing_type = _STOREANDFORWARD
+_STOREANDFORWARD.fields_by_name['rr'].enum_type = _STOREANDFORWARD_REQUESTRESPONSE
+_STOREANDFORWARD.fields_by_name['stats'].message_type = _STOREANDFORWARD_STATISTICS
+_STOREANDFORWARD.fields_by_name['history'].message_type = _STOREANDFORWARD_HISTORY
+_STOREANDFORWARD_REQUESTRESPONSE.containing_type = _STOREANDFORWARD
+DESCRIPTOR.message_types_by_name['StoreAndForward'] = _STOREANDFORWARD
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-StoreAndForwardMessage = _reflection.GeneratedProtocolMessageType('StoreAndForwardMessage', (_message.Message,), {
+StoreAndForward = _reflection.GeneratedProtocolMessageType('StoreAndForward', (_message.Message,), {
'Statistics' : _reflection.GeneratedProtocolMessageType('Statistics', (_message.Message,), {
- 'DESCRIPTOR' : _STOREANDFORWARDMESSAGE_STATISTICS,
+ 'DESCRIPTOR' : _STOREANDFORWARD_STATISTICS,
'__module__' : 'storeforward_pb2'
- # @@protoc_insertion_point(class_scope:StoreAndForwardMessage.Statistics)
+ # @@protoc_insertion_point(class_scope:StoreAndForward.Statistics)
})
,
'History' : _reflection.GeneratedProtocolMessageType('History', (_message.Message,), {
- 'DESCRIPTOR' : _STOREANDFORWARDMESSAGE_HISTORY,
+ 'DESCRIPTOR' : _STOREANDFORWARD_HISTORY,
'__module__' : 'storeforward_pb2'
- # @@protoc_insertion_point(class_scope:StoreAndForwardMessage.History)
+ # @@protoc_insertion_point(class_scope:StoreAndForward.History)
})
,
- 'DESCRIPTOR' : _STOREANDFORWARDMESSAGE,
+ 'DESCRIPTOR' : _STOREANDFORWARD,
'__module__' : 'storeforward_pb2'
- # @@protoc_insertion_point(class_scope:StoreAndForwardMessage)
+ # @@protoc_insertion_point(class_scope:StoreAndForward)
})
-_sym_db.RegisterMessage(StoreAndForwardMessage)
-_sym_db.RegisterMessage(StoreAndForwardMessage.Statistics)
-_sym_db.RegisterMessage(StoreAndForwardMessage.History)
+_sym_db.RegisterMessage(StoreAndForward)
+_sym_db.RegisterMessage(StoreAndForward.Statistics)
+_sym_db.RegisterMessage(StoreAndForward.History)
DESCRIPTOR._options = None
@@ -328,8 +324,8 @@ DESCRIPTOR._options = None
Classes
-
-class StoreAndForwardMessage
+
+class StoreAndForward
(**kwargs)
-
@@ -344,35 +340,35 @@ shown below.
var CLIENT_ERRORvar CLIENT_ERRORvar CLIENT_HISTORYvar CLIENT_HISTORYvar CLIENT_PINGvar CLIENT_PINGvar CLIENT_PONGvar CLIENT_PONGvar CLIENT_STATSvar CLIENT_STATSvar DESCRIPTORvar DESCRIPTORvar HISTORY_FIELD_NUMBERvar HISTORY_FIELD_NUMBERvar Historyvar HistoryAbstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol @@ -380,43 +376,39 @@ compiler. These generated types subclass Message and implement the methods shown below.
var MAXvar ROUTER_BUSYvar ROUTER_BUSYvar ROUTER_ERRORvar ROUTER_ERRORvar ROUTER_HEARTBEATvar ROUTER_HEARTBEATvar ROUTER_PINGvar ROUTER_PINGvar ROUTER_PONGvar ROUTER_PONGvar RR_FIELD_NUMBERvar RR_FIELD_NUMBERvar RequestResponsevar RequestResponsevar STATS_FIELD_NUMBERvar STATS_FIELD_NUMBERvar Statisticsvar StatisticsAbstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol @@ -424,14 +416,14 @@ compiler. These generated types subclass Message and implement the methods shown below.
var UNSETvar UNSET
+
def FromString(s)
-
@@ -446,7 +438,7 @@ shown below.
return message
-
+
def RegisterExtension(extension_handle)
-
@@ -466,7 +458,7 @@ shown below.
var historyvar historyGetter for history.
var rrvar rrGetter for rr.
var statsvar statsGetter for stats.
+
def ByteSize(self)
-
@@ -559,7 +551,7 @@ shown below.
return size
-
+
def Clear(self)
-
@@ -581,7 +573,7 @@ shown below.
self._Modified()
-
+
def ClearField(self, field_name)
-
@@ -624,7 +616,7 @@ shown below.
self._Modified()
-
+
def DiscardUnknownFields(self)
-
@@ -649,7 +641,7 @@ shown below.
value.DiscardUnknownFields()
-
+
def FindInitializationErrors(self)
-
@@ -707,7 +699,7 @@ the top-level message, e.g. "foo.bar[5].baz".
return errors
-
+
def HasField(self, field_name)
-
@@ -735,7 +727,7 @@ the top-level message, e.g. "foo.bar[5].baz".
return field in self._fields
-
+
def IsInitialized(self, errors=None)
-
@@ -792,7 +784,7 @@ paths of all missing required fields.
return True
-
+
def ListFields(self)
-
@@ -807,7 +799,7 @@ paths of all missing required fields.
return all_fields
-
+
def MergeFrom(self, msg)
-
@@ -859,7 +851,7 @@ paths of all missing required fields.
self._unknown_field_set._extend(msg._unknown_field_set)
-
+
def MergeFromString(self, serialized)
-
@@ -884,7 +876,7 @@ paths of all missing required fields.
return length # Return this for legacy reasons.
-
+
def SerializePartialToString(self, **kwargs)
-
@@ -899,7 +891,7 @@ paths of all missing required fields.
return out.getvalue()
-
+
def SerializeToString(self, **kwargs)
-
@@ -917,7 +909,7 @@ paths of all missing required fields.
return self.SerializePartialToString(**kwargs)
-
+
def SetInParent(self)
-
@@ -943,7 +935,7 @@ and propagates this to our listener iff this was a state change.
self._listener.Modified()
-
+
def UnknownFields(self)
-
@@ -959,7 +951,7 @@ and propagates this to our listener iff this was a state change.
return self._unknown_field_set # pylint: disable=protected-access
-
+
def WhichOneof(self, oneof_name)
-
@@ -1002,47 +994,46 @@ and propagates this to our listener iff this was a state change.
Classes
-
-
StoreAndForwardMessage
+StoreAndForward
-ByteSize
-CLIENT_ERROR
-CLIENT_HISTORY
-CLIENT_PING
-CLIENT_PONG
-CLIENT_STATS
-Clear
-ClearField
-DESCRIPTOR
-DiscardUnknownFields
-FindInitializationErrors
-FromString
-HISTORY_FIELD_NUMBER
-HasField
-History
-IsInitialized
-ListFields
-MAX
-MergeFrom
-MergeFromString
-ROUTER_BUSY
-ROUTER_ERROR
-ROUTER_HEARTBEAT
-ROUTER_PING
-ROUTER_PONG
-RR_FIELD_NUMBER
-RegisterExtension
-RequestResponse
-STATS_FIELD_NUMBER
-SerializePartialToString
-SerializeToString
-SetInParent
-Statistics
-UNSET
-UnknownFields
-WhichOneof
-history
-rr
-stats
+ByteSize
+CLIENT_ERROR
+CLIENT_HISTORY
+CLIENT_PING
+CLIENT_PONG
+CLIENT_STATS
+Clear
+ClearField
+DESCRIPTOR
+DiscardUnknownFields
+FindInitializationErrors
+FromString
+HISTORY_FIELD_NUMBER
+HasField
+History
+IsInitialized
+ListFields
+MergeFrom
+MergeFromString
+ROUTER_BUSY
+ROUTER_ERROR
+ROUTER_HEARTBEAT
+ROUTER_PING
+ROUTER_PONG
+RR_FIELD_NUMBER
+RegisterExtension
+RequestResponse
+STATS_FIELD_NUMBER
+SerializePartialToString
+SerializeToString
+SetInParent
+Statistics
+UNSET
+UnknownFields
+WhichOneof
+history
+rr
+stats
diff --git a/docs/meshtastic/test.html b/docs/meshtastic/test.html
index d2242c1..a6bd8f7 100644
--- a/docs/meshtastic/test.html
+++ b/docs/meshtastic/test.html
@@ -5,7 +5,7 @@
meshtastic.test API documentation
-
+
@@ -22,18 +22,21 @@
Module meshtastic.test
+Testing
Expand source code
-import logging
-from . import util
-from . import SerialInterface, TCPInterface, BROADCAST_NUM
-from pubsub import pub
+""" Testing
+"""
+import logging
import time
import sys
-import threading, traceback
+import traceback
from dotmap import DotMap
+from pubsub import pub
+from . import util
+from . import SerialInterface, TCPInterface, BROADCAST_NUM
"""The interfaces we are using for our tests"""
interfaces = None
@@ -59,7 +62,7 @@ def onReceive(packet, interface):
if p.decoded.portnum == "TEXT_MESSAGE_APP":
# We only care a about clear text packets
- if receivedPackets != None:
+ if receivedPackets is not None:
receivedPackets.append(p)
@@ -103,18 +106,19 @@ def testSend(fromInterface, toInterface, isBroadcast=False, asBinary=False, want
else:
fromInterface.sendData((f"Binary {testNumber}").encode(
"utf-8"), toNode, wantAck=wantAck)
- for sec in range(60): # max of 60 secs before we timeout
+ for _ in range(60): # max of 60 secs before we timeout
time.sleep(1)
- if (len(receivedPackets) >= 1):
+ if len(receivedPackets) >= 1:
return True
return False # Failed to send
def runTests(numTests=50, wantAck=False, maxFailures=0):
+ """Run the tests."""
logging.info(f"Running {numTests} tests with wantAck={wantAck}")
numFail = 0
numSuccess = 0
- for i in range(numTests):
+ for _ in range(numTests):
global testNumber
testNumber = testNumber + 1
isBroadcast = True
@@ -144,6 +148,7 @@ def runTests(numTests=50, wantAck=False, maxFailures=0):
def testThread(numTests=50):
+ """Test thread"""
logging.info("Found devices, starting tests...")
runTests(numTests, wantAck=True)
# Allow a few dropped packets
@@ -156,6 +161,7 @@ def onConnection(topic=pub.AUTO_TOPIC):
def openDebugLog(portName):
+ """Open the debug log file"""
debugname = "log" + portName.replace("/", "_")
logging.info(f"Writing serial debugging to {debugname}")
return open(debugname, 'w+', buffering=1)
@@ -169,7 +175,7 @@ def testAll():
Exception: If not enough devices are found
"""
ports = util.findPorts()
- if (len(ports) < 2):
+ if len(ports) < 2:
raise Exception("Must have at least two devices connected to USB")
pub.subscribe(onConnection, "meshtastic.connection")
@@ -272,7 +278,7 @@ def testSimulator():
if p.decoded.portnum == "TEXT_MESSAGE_APP":
# We only care a about clear text packets
- if receivedPackets != None:
+ if receivedPackets is not None:
receivedPackets.append(p)
@@ -280,12 +286,13 @@ def testSimulator():
def openDebugLog(portName)
Open the debug log file
def openDebugLog(portName):
+ """Open the debug log file"""
debugname = "log" + portName.replace("/", "_")
logging.info(f"Writing serial debugging to {debugname}")
return open(debugname, 'w+', buffering=1)
@@ -295,16 +302,17 @@ def testSimulator():
def runTests(numTests=50, wantAck=False, maxFailures=0)
Run the tests.
def runTests(numTests=50, wantAck=False, maxFailures=0):
+ """Run the tests."""
logging.info(f"Running {numTests} tests with wantAck={wantAck}")
numFail = 0
numSuccess = 0
- for i in range(numTests):
+ for _ in range(numTests):
global testNumber
testNumber = testNumber + 1
isBroadcast = True
@@ -370,7 +378,7 @@ def testSimulator():
Exception: If not enough devices are found
"""
ports = util.findPorts()
- if (len(ports) < 2):
+ if len(ports) < 2:
raise Exception("Must have at least two devices connected to USB")
pub.subscribe(onConnection, "meshtastic.connection")
@@ -429,9 +437,9 @@ toInterface {[type]} – [description]
else:
fromInterface.sendData((f"Binary {testNumber}").encode(
"utf-8"), toNode, wantAck=wantAck)
- for sec in range(60): # max of 60 secs before we timeout
+ for _ in range(60): # max of 60 secs before we timeout
time.sleep(1)
- if (len(receivedPackets) >= 1):
+ if len(receivedPackets) >= 1:
return True
return False # Failed to send
Test thread
def testThread(numTests=50):
+ """Test thread"""
logging.info("Found devices, starting tests...")
runTests(numTests, wantAck=True)
# Allow a few dropped packets
diff --git a/docs/meshtastic/tunnel.html b/docs/meshtastic/tunnel.html
index d952a92..61e0224 100644
--- a/docs/meshtastic/tunnel.html
+++ b/docs/meshtastic/tunnel.html
@@ -5,7 +5,7 @@
meshtastic.tunnel API documentation
-
+
@@ -22,11 +22,25 @@
Module meshtastic.tunnel
+Code for IP tunnel over a mesh
+Note python-pytuntap was too buggy
+using pip3 install pytap2
+make sure to "sudo setcap cap_net_admin+eip /usr/bin/python3.8" so python can access tun device without being root
+sudo ip tuntap del mode tun tun0
+sudo bin/run.sh –port /dev/ttyUSB0 –setch-shortfast
+sudo bin/run.sh –port /dev/ttyUSB0 –tunnel –debug
+ssh -Y root@192.168.10.151 (or dietpi), default password p
+ncat -e /bin/cat -k -u -l 1235
+ncat -u 10.115.64.152 1235
+ping -c 1 -W 20 10.115.64.152
+ping -i 30 -W 30 10.115.64.152
+FIXME: use a more optimal MTU
Expand source code
-# code for IP tunnel over a mesh
+""" Code for IP tunnel over a mesh
+
# Note python-pytuntap was too buggy
# using pip3 install pytap2
# make sure to "sudo setcap cap_net_admin+eip /usr/bin/python3.8" so python can access tun device without being root
@@ -40,11 +54,12 @@
# ping -i 30 -W 30 10.115.64.152
# FIXME: use a more optimal MTU
+"""
-from . import portnums_pb2
-from pubsub import pub
import logging
import threading
+from pubsub import pub
+from . import portnums_pb2
# A new non standard log level that is lower level than DEBUG
LOG_TRACE = 5
@@ -545,7 +560,20 @@ subnet is used to construct our network number (normally 10.115.x.x)
-
-
+
Queue up the work
Expand source code
def queueWork(self, runnable):
+ """ Queue up the work"""
self.queue.put(runnable)
@@ -252,12 +264,13 @@ class DeferredExecution():
(maxSecs=20)
-
-
+
Timeout class
Expand source code
class Timeout:
+ """Timeout class"""
def __init__(self, maxSecs=20):
self.expireTime = 0
self.sleepInterval = 0.1