From 5d94d2fff5be94d0e6d99463e4aee4b5106643ad Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sat, 3 Apr 2021 12:26:31 +0800 Subject: [PATCH] add MQTT server option --- docs/docs.md | 2 ++ radioconfig.options | 4 +++- radioconfig.proto | 12 ++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/docs.md b/docs/docs.md index 653faa4..c0e3e93 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -1009,6 +1009,8 @@ see sw-design.md for more information on these preferences | gps_update_interval | [uint32](#uint32) | | How often should we try to get GPS position (in seconds) when we are in GpsOpMobile mode? or zero for the default of once every 30 seconds or a very large value (maxint) to update only once at boot. | | gps_attempt_time | [uint32](#uint32) | | How long should we try to get our position during each gps_update_interval attempt? (in seconds) Or if zero, use the default of 30 seconds. If we don't get a new gps fix in that time, the gps will be put into sleep until the next gps_update_rate window. | | frequency_offset | [float](#float) | | This parameter is for advanced users with advanced test equipment, we do not recommend most users use it. A frequency offset that is added to to the calculated band center frequency. Used to correct for crystal calibration errors. | +| mqtt_server | [string](#string) | | The server to use for our MQTT global message gateway feature. If not set, the default server will be used | +| mqtt_disabled | [bool](#bool) | | If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as is_uplink_enabled or is_downlink_enabled. But if this flag is set, all MQTT features will be disabled and no servers will be contacted. | | factory_reset | [bool](#bool) | | This setting is never saved to disk, but if set, all device settings will be returned to factory defaults. (Region, serial number etc... will be preserved) | | debug_log_enabled | [bool](#bool) | | By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). Set this to true to leave the debug log outputting even when API is active. | | ignore_incoming | [uint32](#uint32) | repeated | If true, radio should not try to be smart about what packets to queue to the phone bool keep_all_packets = 101; If true, we will try to capture all the packets sent on the mesh, not just the ones destined to our node. bool promiscuous_mode = 102; For testing it is useful sometimes to force a node to never listen to particular other nodes (simulating radio out of range). All nodenums listed in ignore_incoming will have packets they send droped on receive (by router.cpp) | diff --git a/radioconfig.options b/radioconfig.options index 43f8b22..289b157 100644 --- a/radioconfig.options +++ b/radioconfig.options @@ -3,4 +3,6 @@ *UserPreferences.region max_size:6 # Max of three ignored nodes for our testing -*UserPreferences.ignore_incoming max_count:3 \ No newline at end of file +*UserPreferences.ignore_incoming max_count:3 + +*UserPreferences.mqtt_server max_size:32 \ No newline at end of file diff --git a/radioconfig.proto b/radioconfig.proto index 9b5707d..1529d77 100644 --- a/radioconfig.proto +++ b/radioconfig.proto @@ -304,6 +304,18 @@ message RadioConfig { */ float frequency_offset = 41; + /** + * The server to use for our MQTT global message gateway feature. If not set, the default server will be used + */ + string mqtt_server = 42; + + /** + * If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as + * is_uplink_enabled or is_downlink_enabled. + * But if this flag is set, all MQTT features will be disabled and no servers will be contacted. + */ + bool mqtt_disabled = 43; + /* * This setting is never saved to disk, but if set, all device settings will be * returned to factory defaults. (Region, serial number etc... will be preserved)