Merge branch 'master' into master

This commit is contained in:
Jm Casler 2022-02-26 21:07:44 -08:00 committed by GitHub
commit 01a86133ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 549 additions and 577 deletions

View File

@ -4,5 +4,8 @@
"recommendations": [ "recommendations": [
"platformio.platformio-ide", "platformio.platformio-ide",
"xaver.clang-format" "xaver.clang-format"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
] ]
} }

View File

@ -34,7 +34,6 @@ NodeDB nodeDB;
// we have plenty of ram so statically alloc this tempbuf (for now) // we have plenty of ram so statically alloc this tempbuf (for now)
EXT_RAM_ATTR DeviceState devicestate; EXT_RAM_ATTR DeviceState devicestate;
MyNodeInfo &myNodeInfo = devicestate.my_node; MyNodeInfo &myNodeInfo = devicestate.my_node;
GroupInfo &ourGroupInfo = devicestate.group_info;
RadioConfig radioConfig; RadioConfig radioConfig;
ChannelFile channelFile; ChannelFile channelFile;

View File

@ -11,7 +11,6 @@
extern DeviceState devicestate; extern DeviceState devicestate;
extern ChannelFile channelFile; extern ChannelFile channelFile;
extern MyNodeInfo &myNodeInfo; extern MyNodeInfo &myNodeInfo;
extern GroupInfo &ourGroupInfo;
extern RadioConfig radioConfig; extern RadioConfig radioConfig;
extern User &owner; extern User &owner;

View File

@ -125,7 +125,7 @@ extern const pb_msgdesc_t AdminMessage_msg;
#define AdminMessage_fields &AdminMessage_msg #define AdminMessage_fields &AdminMessage_msg
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define AdminMessage_size 601 #define AdminMessage_size 608
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@ -6,7 +6,6 @@
#include <pb.h> #include <pb.h>
#include "channel.pb.h" #include "channel.pb.h"
#include "mesh.pb.h" #include "mesh.pb.h"
#include "radioconfig.pb.h"
#if PB_PROTO_HEADER_VERSION != 40 #if PB_PROTO_HEADER_VERSION != 40
#error Regenerate this file with the current version of nanopb generator. #error Regenerate this file with the current version of nanopb generator.
@ -27,8 +26,6 @@ typedef struct _DeviceState {
NodeInfo node_db[32]; NodeInfo node_db[32];
pb_size_t receive_queue_count; pb_size_t receive_queue_count;
MeshPacket receive_queue[1]; MeshPacket receive_queue[1];
bool has_group_info;
GroupInfo group_info;
bool has_rx_text_message; bool has_rx_text_message;
MeshPacket rx_text_message; MeshPacket rx_text_message;
uint32_t version; uint32_t version;
@ -42,9 +39,9 @@ extern "C" {
#endif #endif
/* Initializer values for message structs */ /* Initializer values for message structs */
#define DeviceState_init_default {false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, GroupInfo_init_default, false, MeshPacket_init_default, 0, 0, 0} #define DeviceState_init_default {false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, MeshPacket_init_default, 0, 0, 0}
#define ChannelFile_init_default {0, {Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default}} #define ChannelFile_init_default {0, {Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default}}
#define DeviceState_init_zero {false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, GroupInfo_init_zero, false, MeshPacket_init_zero, 0, 0, 0} #define DeviceState_init_zero {false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, MeshPacket_init_zero, 0, 0, 0}
#define ChannelFile_init_zero {0, {Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero}} #define ChannelFile_init_zero {0, {Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero}}
/* Field tags (for use in manual encoding/decoding) */ /* Field tags (for use in manual encoding/decoding) */
@ -53,7 +50,6 @@ extern "C" {
#define DeviceState_owner_tag 3 #define DeviceState_owner_tag 3
#define DeviceState_node_db_tag 4 #define DeviceState_node_db_tag 4
#define DeviceState_receive_queue_tag 5 #define DeviceState_receive_queue_tag 5
#define DeviceState_group_info_tag 6
#define DeviceState_rx_text_message_tag 7 #define DeviceState_rx_text_message_tag 7
#define DeviceState_version_tag 8 #define DeviceState_version_tag 8
#define DeviceState_no_save_tag 9 #define DeviceState_no_save_tag 9
@ -65,7 +61,6 @@ X(a, STATIC, OPTIONAL, MESSAGE, my_node, 2) \
X(a, STATIC, OPTIONAL, MESSAGE, owner, 3) \ X(a, STATIC, OPTIONAL, MESSAGE, owner, 3) \
X(a, STATIC, REPEATED, MESSAGE, node_db, 4) \ X(a, STATIC, REPEATED, MESSAGE, node_db, 4) \
X(a, STATIC, REPEATED, MESSAGE, receive_queue, 5) \ X(a, STATIC, REPEATED, MESSAGE, receive_queue, 5) \
X(a, STATIC, OPTIONAL, MESSAGE, group_info, 6) \
X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \ X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \
X(a, STATIC, SINGULAR, UINT32, version, 8) \ X(a, STATIC, SINGULAR, UINT32, version, 8) \
X(a, STATIC, SINGULAR, BOOL, no_save, 9) \ X(a, STATIC, SINGULAR, BOOL, no_save, 9) \
@ -76,7 +71,6 @@ X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11)
#define DeviceState_owner_MSGTYPE User #define DeviceState_owner_MSGTYPE User
#define DeviceState_node_db_MSGTYPE NodeInfo #define DeviceState_node_db_MSGTYPE NodeInfo
#define DeviceState_receive_queue_MSGTYPE MeshPacket #define DeviceState_receive_queue_MSGTYPE MeshPacket
#define DeviceState_group_info_MSGTYPE GroupInfo
#define DeviceState_rx_text_message_MSGTYPE MeshPacket #define DeviceState_rx_text_message_MSGTYPE MeshPacket
#define ChannelFile_FIELDLIST(X, a) \ #define ChannelFile_FIELDLIST(X, a) \
@ -93,7 +87,7 @@ extern const pb_msgdesc_t ChannelFile_msg;
#define ChannelFile_fields &ChannelFile_msg #define ChannelFile_fields &ChannelFile_msg
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define DeviceState_size 10162 #define DeviceState_size 9973
#define ChannelFile_size 832 #define ChannelFile_size 832
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -27,9 +27,6 @@ PB_BIND(MeshPacket, MeshPacket, 2)
PB_BIND(NodeInfo, NodeInfo, AUTO) PB_BIND(NodeInfo, NodeInfo, AUTO)
PB_BIND(GroupInfo, GroupInfo, AUTO)
PB_BIND(MyNodeInfo, MyNodeInfo, 2) PB_BIND(MyNodeInfo, MyNodeInfo, 2)

View File

@ -140,14 +140,8 @@ typedef struct _Data {
uint32_t request_id; uint32_t request_id;
uint32_t reply_id; uint32_t reply_id;
bool is_tapback; bool is_tapback;
uint8_t group_id;
} Data; } Data;
typedef struct _GroupInfo {
pb_size_t group_count;
char group[10][17];
} GroupInfo;
typedef struct _LogRecord { typedef struct _LogRecord {
char message[64]; char message[64];
uint32_t time; uint32_t time;
@ -275,7 +269,6 @@ typedef struct _FromRadio {
uint32_t config_complete_id; uint32_t config_complete_id;
bool rebooted; bool rebooted;
MeshPacket packet; MeshPacket packet;
GroupInfo groups;
}; };
} FromRadio; } FromRadio;
@ -341,10 +334,9 @@ extern "C" {
#define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0, _Team_MIN, 0, 0, 0} #define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0, _Team_MIN, 0, 0, 0}
#define RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}} #define RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}}
#define Routing_init_default {0, {RouteDiscovery_init_default}} #define Routing_init_default {0, {RouteDiscovery_init_default}}
#define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, 0} #define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0}
#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} #define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0} #define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0}
#define GroupInfo_init_default {0, {"", "", "", "", "", "", "", "", "", ""}}
#define MyNodeInfo_init_default {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} #define MyNodeInfo_init_default {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0}
#define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} #define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN}
#define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}} #define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}}
@ -354,10 +346,9 @@ extern "C" {
#define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0, _Team_MIN, 0, 0, 0} #define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0, _Team_MIN, 0, 0, 0}
#define RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}} #define RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}}
#define Routing_init_zero {0, {RouteDiscovery_init_zero}} #define Routing_init_zero {0, {RouteDiscovery_init_zero}}
#define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, 0} #define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0}
#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} #define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0} #define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0}
#define GroupInfo_init_zero {0, {"", "", "", "", "", "", "", "", "", ""}}
#define MyNodeInfo_init_zero {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} #define MyNodeInfo_init_zero {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0}
#define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} #define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN}
#define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}} #define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}}
@ -373,8 +364,6 @@ extern "C" {
#define Data_request_id_tag 6 #define Data_request_id_tag 6
#define Data_reply_id_tag 7 #define Data_reply_id_tag 7
#define Data_is_tapback_tag 8 #define Data_is_tapback_tag 8
#define Data_group_id_tag 9
#define GroupInfo_group_tag 1
#define LogRecord_message_tag 1 #define LogRecord_message_tag 1
#define LogRecord_time_tag 2 #define LogRecord_time_tag 2
#define LogRecord_source_tag 3 #define LogRecord_source_tag 3
@ -460,7 +449,6 @@ extern "C" {
#define FromRadio_config_complete_id_tag 8 #define FromRadio_config_complete_id_tag 8
#define FromRadio_rebooted_tag 9 #define FromRadio_rebooted_tag 9
#define FromRadio_packet_tag 11 #define FromRadio_packet_tag 11
#define FromRadio_groups_tag 12
#define ToRadio_packet_tag 2 #define ToRadio_packet_tag 2
#define ToRadio_peer_info_tag 3 #define ToRadio_peer_info_tag 3
#define ToRadio_want_config_id_tag 100 #define ToRadio_want_config_id_tag 100
@ -530,8 +518,7 @@ X(a, STATIC, SINGULAR, FIXED32, dest, 4) \
X(a, STATIC, SINGULAR, FIXED32, source, 5) \ X(a, STATIC, SINGULAR, FIXED32, source, 5) \
X(a, STATIC, SINGULAR, FIXED32, request_id, 6) \ X(a, STATIC, SINGULAR, FIXED32, request_id, 6) \
X(a, STATIC, SINGULAR, FIXED32, reply_id, 7) \ X(a, STATIC, SINGULAR, FIXED32, reply_id, 7) \
X(a, STATIC, SINGULAR, BOOL, is_tapback, 8) \ X(a, STATIC, SINGULAR, BOOL, is_tapback, 8)
X(a, STATIC, SINGULAR, UINT32, group_id, 9)
#define Data_CALLBACK NULL #define Data_CALLBACK NULL
#define Data_DEFAULT NULL #define Data_DEFAULT NULL
@ -564,11 +551,6 @@ X(a, STATIC, SINGULAR, FLOAT, snr, 7)
#define NodeInfo_user_MSGTYPE User #define NodeInfo_user_MSGTYPE User
#define NodeInfo_position_MSGTYPE Position #define NodeInfo_position_MSGTYPE Position
#define GroupInfo_FIELDLIST(X, a) \
X(a, STATIC, REPEATED, STRING, group, 1)
#define GroupInfo_CALLBACK NULL
#define GroupInfo_DEFAULT NULL
#define MyNodeInfo_FIELDLIST(X, a) \ #define MyNodeInfo_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \ X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \
X(a, STATIC, SINGULAR, BOOL, has_gps, 2) \ X(a, STATIC, SINGULAR, BOOL, has_gps, 2) \
@ -605,15 +587,13 @@ X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,node_info,node_info), 4) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,log_record,log_record), 7) \ X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,log_record,log_record), 7) \
X(a, STATIC, ONEOF, UINT32, (payloadVariant,config_complete_id,config_complete_id), 8) \ X(a, STATIC, ONEOF, UINT32, (payloadVariant,config_complete_id,config_complete_id), 8) \
X(a, STATIC, ONEOF, BOOL, (payloadVariant,rebooted,rebooted), 9) \ X(a, STATIC, ONEOF, BOOL, (payloadVariant,rebooted,rebooted), 9) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 11) \ X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 11)
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,groups,groups), 12)
#define FromRadio_CALLBACK NULL #define FromRadio_CALLBACK NULL
#define FromRadio_DEFAULT NULL #define FromRadio_DEFAULT NULL
#define FromRadio_payloadVariant_my_info_MSGTYPE MyNodeInfo #define FromRadio_payloadVariant_my_info_MSGTYPE MyNodeInfo
#define FromRadio_payloadVariant_node_info_MSGTYPE NodeInfo #define FromRadio_payloadVariant_node_info_MSGTYPE NodeInfo
#define FromRadio_payloadVariant_log_record_MSGTYPE LogRecord #define FromRadio_payloadVariant_log_record_MSGTYPE LogRecord
#define FromRadio_payloadVariant_packet_MSGTYPE MeshPacket #define FromRadio_payloadVariant_packet_MSGTYPE MeshPacket
#define FromRadio_payloadVariant_groups_MSGTYPE GroupInfo
#define ToRadio_FIELDLIST(X, a) \ #define ToRadio_FIELDLIST(X, a) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 2) \ X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 2) \
@ -638,7 +618,6 @@ extern const pb_msgdesc_t Routing_msg;
extern const pb_msgdesc_t Data_msg; extern const pb_msgdesc_t Data_msg;
extern const pb_msgdesc_t MeshPacket_msg; extern const pb_msgdesc_t MeshPacket_msg;
extern const pb_msgdesc_t NodeInfo_msg; extern const pb_msgdesc_t NodeInfo_msg;
extern const pb_msgdesc_t GroupInfo_msg;
extern const pb_msgdesc_t MyNodeInfo_msg; extern const pb_msgdesc_t MyNodeInfo_msg;
extern const pb_msgdesc_t LogRecord_msg; extern const pb_msgdesc_t LogRecord_msg;
extern const pb_msgdesc_t FromRadio_msg; extern const pb_msgdesc_t FromRadio_msg;
@ -653,7 +632,6 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg;
#define Data_fields &Data_msg #define Data_fields &Data_msg
#define MeshPacket_fields &MeshPacket_msg #define MeshPacket_fields &MeshPacket_msg
#define NodeInfo_fields &NodeInfo_msg #define NodeInfo_fields &NodeInfo_msg
#define GroupInfo_fields &GroupInfo_msg
#define MyNodeInfo_fields &MyNodeInfo_msg #define MyNodeInfo_fields &MyNodeInfo_msg
#define LogRecord_fields &LogRecord_msg #define LogRecord_fields &LogRecord_msg
#define FromRadio_fields &FromRadio_msg #define FromRadio_fields &FromRadio_msg
@ -665,14 +643,13 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg;
#define User_size 97 #define User_size 97
#define RouteDiscovery_size 40 #define RouteDiscovery_size 40
#define Routing_size 42 #define Routing_size 42
#define Data_size 270 #define Data_size 267
#define MeshPacket_size 321 #define MeshPacket_size 318
#define NodeInfo_size 271 #define NodeInfo_size 271
#define GroupInfo_size 180
#define MyNodeInfo_size 434 #define MyNodeInfo_size 434
#define LogRecord_size 81 #define LogRecord_size 81
#define FromRadio_size 443 #define FromRadio_size 443
#define ToRadio_size 324 #define ToRadio_size 321
#define ToRadio_PeerInfo_size 8 #define ToRadio_PeerInfo_size 8
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -20,11 +20,11 @@ typedef enum _PortNum {
PortNum_ADMIN_APP = 6, PortNum_ADMIN_APP = 6,
PortNum_REPLY_APP = 32, PortNum_REPLY_APP = 32,
PortNum_IP_TUNNEL_APP = 33, PortNum_IP_TUNNEL_APP = 33,
PortNum_GROUP_APP = 34, PortNum_ROUTER_APP = 34,
PortNum_SERIAL_APP = 64, PortNum_SERIAL_APP = 64,
PortNum_STORE_FORWARD_APP = 65, PortNum_STORE_FORWARD_APP = 65,
PortNum_RANGE_TEST_APP = 66, PortNum_RANGE_TEST_APP = 66,
PortNum_ENVIRONMENTAL_MEASUREMENT_APP = 67, PortNum_TELEMETRY_APP = 67,
PortNum_ZPS_APP = 68, PortNum_ZPS_APP = 68,
PortNum_PRIVATE_APP = 256, PortNum_PRIVATE_APP = 256,
PortNum_ATAK_FORWARDER = 257, PortNum_ATAK_FORWARDER = 257,

View File

@ -92,17 +92,17 @@ typedef enum _InputEventChar {
InputEventChar_KEY_CANCEL = 24 InputEventChar_KEY_CANCEL = 24
} InputEventChar; } InputEventChar;
typedef enum _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType { typedef enum _RadioConfig_UserPreferences_TelemetrySensorType {
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11 = 0, RadioConfig_UserPreferences_TelemetrySensorType_DHT11 = 0,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DS18B20 = 1, RadioConfig_UserPreferences_TelemetrySensorType_DS18B20 = 1,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT12 = 2, RadioConfig_UserPreferences_TelemetrySensorType_DHT12 = 2,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT21 = 3, RadioConfig_UserPreferences_TelemetrySensorType_DHT21 = 3,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT22 = 4, RadioConfig_UserPreferences_TelemetrySensorType_DHT22 = 4,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME280 = 5, RadioConfig_UserPreferences_TelemetrySensorType_BME280 = 5,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME680 = 6, RadioConfig_UserPreferences_TelemetrySensorType_BME680 = 6,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MCP9808 = 7, RadioConfig_UserPreferences_TelemetrySensorType_MCP9808 = 7,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_SHTC3 = 8 RadioConfig_UserPreferences_TelemetrySensorType_SHTC3 = 8
} RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType; } RadioConfig_UserPreferences_TelemetrySensorType;
/* Struct definitions */ /* Struct definitions */
typedef struct _RadioConfig_UserPreferences { typedef struct _RadioConfig_UserPreferences {
@ -158,14 +158,14 @@ typedef struct _RadioConfig_UserPreferences {
uint32_t store_forward_plugin_records; uint32_t store_forward_plugin_records;
uint32_t store_forward_plugin_history_return_max; uint32_t store_forward_plugin_history_return_max;
uint32_t store_forward_plugin_history_return_window; uint32_t store_forward_plugin_history_return_window;
bool environmental_measurement_plugin_measurement_enabled; bool telemetry_module_measurement_enabled;
bool environmental_measurement_plugin_screen_enabled; bool telemetry_module_screen_enabled;
uint32_t environmental_measurement_plugin_read_error_count_threshold; uint32_t telemetry_module_read_error_count_threshold;
uint32_t environmental_measurement_plugin_update_interval; uint32_t telemetry_module_update_interval;
uint32_t environmental_measurement_plugin_recovery_interval; uint32_t telemetry_module_recovery_interval;
bool environmental_measurement_plugin_display_farenheit; bool telemetry_module_display_farenheit;
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType environmental_measurement_plugin_sensor_type; RadioConfig_UserPreferences_TelemetrySensorType telemetry_module_sensor_type;
uint32_t environmental_measurement_plugin_sensor_pin; uint32_t telemetry_module_sensor_pin;
bool store_forward_plugin_enabled; bool store_forward_plugin_enabled;
bool store_forward_plugin_heartbeat; bool store_forward_plugin_heartbeat;
uint32_t position_flags; uint32_t position_flags;
@ -189,6 +189,7 @@ typedef struct _RadioConfig_UserPreferences {
bool canned_message_plugin_send_bell; bool canned_message_plugin_send_bell;
bool mqtt_encryption_enabled; bool mqtt_encryption_enabled;
float adc_multiplier_override; float adc_multiplier_override;
uint32_t serialplugin_baud;
} RadioConfig_UserPreferences; } RadioConfig_UserPreferences;
typedef struct _RadioConfig { typedef struct _RadioConfig {
@ -226,9 +227,9 @@ typedef struct _RadioConfig {
#define _InputEventChar_MAX InputEventChar_KEY_BACK #define _InputEventChar_MAX InputEventChar_KEY_BACK
#define _InputEventChar_ARRAYSIZE ((InputEventChar)(InputEventChar_KEY_BACK+1)) #define _InputEventChar_ARRAYSIZE ((InputEventChar)(InputEventChar_KEY_BACK+1))
#define _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11 #define _RadioConfig_UserPreferences_TelemetrySensorType_MIN RadioConfig_UserPreferences_TelemetrySensorType_DHT11
#define _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MAX RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_SHTC3 #define _RadioConfig_UserPreferences_TelemetrySensorType_MAX RadioConfig_UserPreferences_TelemetrySensorType_SHTC3
#define _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_ARRAYSIZE ((RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType)(RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_SHTC3+1)) #define _RadioConfig_UserPreferences_TelemetrySensorType_ARRAYSIZE ((RadioConfig_UserPreferences_TelemetrySensorType)(RadioConfig_UserPreferences_TelemetrySensorType_SHTC3+1))
#ifdef __cplusplus #ifdef __cplusplus
@ -237,9 +238,9 @@ extern "C" {
/* Initializer values for message structs */ /* Initializer values for message structs */
#define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default} #define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default}
#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", 0, 0, 0} #define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_TelemetrySensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", 0, 0, 0, 0}
#define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero} #define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero}
#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", 0, 0, 0} #define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_TelemetrySensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", 0, 0, 0, 0}
/* Field tags (for use in manual encoding/decoding) */ /* Field tags (for use in manual encoding/decoding) */
#define RadioConfig_UserPreferences_position_broadcast_secs_tag 1 #define RadioConfig_UserPreferences_position_broadcast_secs_tag 1
@ -293,14 +294,14 @@ extern "C" {
#define RadioConfig_UserPreferences_store_forward_plugin_records_tag 137 #define RadioConfig_UserPreferences_store_forward_plugin_records_tag 137
#define RadioConfig_UserPreferences_store_forward_plugin_history_return_max_tag 138 #define RadioConfig_UserPreferences_store_forward_plugin_history_return_max_tag 138
#define RadioConfig_UserPreferences_store_forward_plugin_history_return_window_tag 139 #define RadioConfig_UserPreferences_store_forward_plugin_history_return_window_tag 139
#define RadioConfig_UserPreferences_environmental_measurement_plugin_measurement_enabled_tag 140 #define RadioConfig_UserPreferences_telemetry_module_measurement_enabled_tag 140
#define RadioConfig_UserPreferences_environmental_measurement_plugin_screen_enabled_tag 141 #define RadioConfig_UserPreferences_telemetry_module_screen_enabled_tag 141
#define RadioConfig_UserPreferences_environmental_measurement_plugin_read_error_count_threshold_tag 142 #define RadioConfig_UserPreferences_telemetry_module_read_error_count_threshold_tag 142
#define RadioConfig_UserPreferences_environmental_measurement_plugin_update_interval_tag 143 #define RadioConfig_UserPreferences_telemetry_module_update_interval_tag 143
#define RadioConfig_UserPreferences_environmental_measurement_plugin_recovery_interval_tag 144 #define RadioConfig_UserPreferences_telemetry_module_recovery_interval_tag 144
#define RadioConfig_UserPreferences_environmental_measurement_plugin_display_farenheit_tag 145 #define RadioConfig_UserPreferences_telemetry_module_display_farenheit_tag 145
#define RadioConfig_UserPreferences_environmental_measurement_plugin_sensor_type_tag 146 #define RadioConfig_UserPreferences_telemetry_module_sensor_type_tag 146
#define RadioConfig_UserPreferences_environmental_measurement_plugin_sensor_pin_tag 147 #define RadioConfig_UserPreferences_telemetry_module_sensor_pin_tag 147
#define RadioConfig_UserPreferences_store_forward_plugin_enabled_tag 148 #define RadioConfig_UserPreferences_store_forward_plugin_enabled_tag 148
#define RadioConfig_UserPreferences_store_forward_plugin_heartbeat_tag 149 #define RadioConfig_UserPreferences_store_forward_plugin_heartbeat_tag 149
#define RadioConfig_UserPreferences_position_flags_tag 150 #define RadioConfig_UserPreferences_position_flags_tag 150
@ -324,6 +325,7 @@ extern "C" {
#define RadioConfig_UserPreferences_canned_message_plugin_send_bell_tag 173 #define RadioConfig_UserPreferences_canned_message_plugin_send_bell_tag 173
#define RadioConfig_UserPreferences_mqtt_encryption_enabled_tag 174 #define RadioConfig_UserPreferences_mqtt_encryption_enabled_tag 174
#define RadioConfig_UserPreferences_adc_multiplier_override_tag 175 #define RadioConfig_UserPreferences_adc_multiplier_override_tag 175
#define RadioConfig_UserPreferences_serialplugin_baud_tag 176
#define RadioConfig_preferences_tag 1 #define RadioConfig_preferences_tag 1
/* Struct field encoding specification for nanopb */ /* Struct field encoding specification for nanopb */
@ -385,14 +387,14 @@ X(a, STATIC, SINGULAR, BOOL, range_test_plugin_save, 134) \
X(a, STATIC, SINGULAR, UINT32, store_forward_plugin_records, 137) \ X(a, STATIC, SINGULAR, UINT32, store_forward_plugin_records, 137) \
X(a, STATIC, SINGULAR, UINT32, store_forward_plugin_history_return_max, 138) \ X(a, STATIC, SINGULAR, UINT32, store_forward_plugin_history_return_max, 138) \
X(a, STATIC, SINGULAR, UINT32, store_forward_plugin_history_return_window, 139) \ X(a, STATIC, SINGULAR, UINT32, store_forward_plugin_history_return_window, 139) \
X(a, STATIC, SINGULAR, BOOL, environmental_measurement_plugin_measurement_enabled, 140) \ X(a, STATIC, SINGULAR, BOOL, telemetry_module_measurement_enabled, 140) \
X(a, STATIC, SINGULAR, BOOL, environmental_measurement_plugin_screen_enabled, 141) \ X(a, STATIC, SINGULAR, BOOL, telemetry_module_screen_enabled, 141) \
X(a, STATIC, SINGULAR, UINT32, environmental_measurement_plugin_read_error_count_threshold, 142) \ X(a, STATIC, SINGULAR, UINT32, telemetry_module_read_error_count_threshold, 142) \
X(a, STATIC, SINGULAR, UINT32, environmental_measurement_plugin_update_interval, 143) \ X(a, STATIC, SINGULAR, UINT32, telemetry_module_update_interval, 143) \
X(a, STATIC, SINGULAR, UINT32, environmental_measurement_plugin_recovery_interval, 144) \ X(a, STATIC, SINGULAR, UINT32, telemetry_module_recovery_interval, 144) \
X(a, STATIC, SINGULAR, BOOL, environmental_measurement_plugin_display_farenheit, 145) \ X(a, STATIC, SINGULAR, BOOL, telemetry_module_display_farenheit, 145) \
X(a, STATIC, SINGULAR, UENUM, environmental_measurement_plugin_sensor_type, 146) \ X(a, STATIC, SINGULAR, UENUM, telemetry_module_sensor_type, 146) \
X(a, STATIC, SINGULAR, UINT32, environmental_measurement_plugin_sensor_pin, 147) \ X(a, STATIC, SINGULAR, UINT32, telemetry_module_sensor_pin, 147) \
X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_enabled, 148) \ X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_enabled, 148) \
X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_heartbeat, 149) \ X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_heartbeat, 149) \
X(a, STATIC, SINGULAR, UINT32, position_flags, 150) \ X(a, STATIC, SINGULAR, UINT32, position_flags, 150) \
@ -415,7 +417,8 @@ X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_enabled, 170) \
X(a, STATIC, SINGULAR, STRING, canned_message_plugin_allow_input_source, 171) \ X(a, STATIC, SINGULAR, STRING, canned_message_plugin_allow_input_source, 171) \
X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_send_bell, 173) \ X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_send_bell, 173) \
X(a, STATIC, SINGULAR, BOOL, mqtt_encryption_enabled, 174) \ X(a, STATIC, SINGULAR, BOOL, mqtt_encryption_enabled, 174) \
X(a, STATIC, SINGULAR, FLOAT, adc_multiplier_override, 175) X(a, STATIC, SINGULAR, FLOAT, adc_multiplier_override, 175) \
X(a, STATIC, SINGULAR, UINT32, serialplugin_baud, 176)
#define RadioConfig_UserPreferences_CALLBACK NULL #define RadioConfig_UserPreferences_CALLBACK NULL
#define RadioConfig_UserPreferences_DEFAULT NULL #define RadioConfig_UserPreferences_DEFAULT NULL
@ -427,8 +430,8 @@ extern const pb_msgdesc_t RadioConfig_UserPreferences_msg;
#define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg #define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define RadioConfig_size 598 #define RadioConfig_size 605
#define RadioConfig_UserPreferences_size 595 #define RadioConfig_UserPreferences_size 602
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@ -1,12 +1,12 @@
/* Automatically generated nanopb constant definitions */ /* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.4 */ /* Generated by nanopb-0.4.4 */
#include "environmental_measurement.pb.h" #include "telemetry.pb.h"
#if PB_PROTO_HEADER_VERSION != 40 #if PB_PROTO_HEADER_VERSION != 40
#error Regenerate this file with the current version of nanopb generator. #error Regenerate this file with the current version of nanopb generator.
#endif #endif
PB_BIND(EnvironmentalMeasurement, EnvironmentalMeasurement, AUTO) PB_BIND(Telemetry, Telemetry, AUTO)

View File

@ -1,8 +1,8 @@
/* Automatically generated nanopb header */ /* Automatically generated nanopb header */
/* Generated by nanopb-0.4.4 */ /* Generated by nanopb-0.4.4 */
#ifndef PB_ENVIRONMENTAL_MEASUREMENT_PB_H_INCLUDED #ifndef PB_TELEMETRY_PB_H_INCLUDED
#define PB_ENVIRONMENTAL_MEASUREMENT_PB_H_INCLUDED #define PB_TELEMETRY_PB_H_INCLUDED
#include <pb.h> #include <pb.h>
#if PB_PROTO_HEADER_VERSION != 40 #if PB_PROTO_HEADER_VERSION != 40
@ -10,14 +10,14 @@
#endif #endif
/* Struct definitions */ /* Struct definitions */
typedef struct _EnvironmentalMeasurement { typedef struct _Telemetry {
float temperature; float temperature;
float relative_humidity; float relative_humidity;
float barometric_pressure; float barometric_pressure;
float gas_resistance; float gas_resistance;
float voltage; float voltage;
float current; float current;
} EnvironmentalMeasurement; } Telemetry;
#ifdef __cplusplus #ifdef __cplusplus
@ -25,35 +25,35 @@ extern "C" {
#endif #endif
/* Initializer values for message structs */ /* Initializer values for message structs */
#define EnvironmentalMeasurement_init_default {0, 0, 0, 0, 0, 0} #define Telemetry_init_default {0, 0, 0, 0, 0, 0}
#define EnvironmentalMeasurement_init_zero {0, 0, 0, 0, 0, 0} #define Telemetry_init_zero {0, 0, 0, 0, 0, 0}
/* Field tags (for use in manual encoding/decoding) */ /* Field tags (for use in manual encoding/decoding) */
#define EnvironmentalMeasurement_temperature_tag 1 #define Telemetry_temperature_tag 1
#define EnvironmentalMeasurement_relative_humidity_tag 2 #define Telemetry_relative_humidity_tag 2
#define EnvironmentalMeasurement_barometric_pressure_tag 3 #define Telemetry_barometric_pressure_tag 3
#define EnvironmentalMeasurement_gas_resistance_tag 4 #define Telemetry_gas_resistance_tag 4
#define EnvironmentalMeasurement_voltage_tag 5 #define Telemetry_voltage_tag 5
#define EnvironmentalMeasurement_current_tag 6 #define Telemetry_current_tag 6
/* Struct field encoding specification for nanopb */ /* Struct field encoding specification for nanopb */
#define EnvironmentalMeasurement_FIELDLIST(X, a) \ #define Telemetry_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, FLOAT, temperature, 1) \ X(a, STATIC, SINGULAR, FLOAT, temperature, 1) \
X(a, STATIC, SINGULAR, FLOAT, relative_humidity, 2) \ X(a, STATIC, SINGULAR, FLOAT, relative_humidity, 2) \
X(a, STATIC, SINGULAR, FLOAT, barometric_pressure, 3) \ X(a, STATIC, SINGULAR, FLOAT, barometric_pressure, 3) \
X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \ X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \
X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \ X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \
X(a, STATIC, SINGULAR, FLOAT, current, 6) X(a, STATIC, SINGULAR, FLOAT, current, 6)
#define EnvironmentalMeasurement_CALLBACK NULL #define Telemetry_CALLBACK NULL
#define EnvironmentalMeasurement_DEFAULT NULL #define Telemetry_DEFAULT NULL
extern const pb_msgdesc_t EnvironmentalMeasurement_msg; extern const pb_msgdesc_t Telemetry_msg;
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ /* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define EnvironmentalMeasurement_fields &EnvironmentalMeasurement_msg #define Telemetry_fields &Telemetry_msg
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define EnvironmentalMeasurement_size 30 #define Telemetry_size 30
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@ -1,299 +0,0 @@
#include "EnvironmentalMeasurementPlugin.h"
#include "../mesh/generated/environmental_measurement.pb.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "main.h"
#include <OLEDDisplay.h>
#include <OLEDDisplayUi.h>
// Sensors
#include "Sensor/BME280Sensor.h"
#include "Sensor/BME680Sensor.h"
#include "Sensor/DHTSensor.h"
#include "Sensor/DallasSensor.h"
#include "Sensor/MCP9808Sensor.h"
BME280Sensor bme280Sensor;
BME680Sensor bme680Sensor;
DHTSensor dhtSensor;
DallasSensor dallasSensor;
MCP9808Sensor mcp9808Sensor;
#define FAILED_STATE_SENSOR_READ_MULTIPLIER 10
#define DISPLAY_RECEIVEID_MEASUREMENTS_ON_SCREEN true
#ifdef HAS_EINK
// The screen is bigger so use bigger fonts
#define FONT_SMALL ArialMT_Plain_16
#define FONT_MEDIUM ArialMT_Plain_24
#define FONT_LARGE ArialMT_Plain_24
#else
#define FONT_SMALL ArialMT_Plain_10
#define FONT_MEDIUM ArialMT_Plain_16
#define FONT_LARGE ArialMT_Plain_24
#endif
#define fontHeight(font) ((font)[1] + 1) // height is position 1
#define FONT_HEIGHT_SMALL fontHeight(FONT_SMALL)
#define FONT_HEIGHT_MEDIUM fontHeight(FONT_MEDIUM)
int32_t EnvironmentalMeasurementPlugin::runOnce()
{
#ifndef PORTDUINO
/*
Uncomment the preferences below if you want to use the plugin
without having to configure it from the PythonAPI or WebUI.
*/
/*
radioConfig.preferences.environmental_measurement_plugin_measurement_enabled = 1;
radioConfig.preferences.environmental_measurement_plugin_screen_enabled = 1;
radioConfig.preferences.environmental_measurement_plugin_read_error_count_threshold = 5;
radioConfig.preferences.environmental_measurement_plugin_update_interval = 600;
radioConfig.preferences.environmental_measurement_plugin_recovery_interval = 60;
radioConfig.preferences.environmental_measurement_plugin_display_farenheit = false;
radioConfig.preferences.environmental_measurement_plugin_sensor_pin = 13;
radioConfig.preferences.environmental_measurement_plugin_sensor_type =
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType::
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME280;
*/
if (!(radioConfig.preferences.environmental_measurement_plugin_measurement_enabled ||
radioConfig.preferences.environmental_measurement_plugin_screen_enabled)) {
// If this plugin is not enabled, and the user doesn't want the display screen don't waste any OSThread time on it
return (INT32_MAX);
}
if (firstTime) {
// This is the first time the OSThread library has called this function, so do some setup
firstTime = 0;
if (radioConfig.preferences.environmental_measurement_plugin_measurement_enabled) {
DEBUG_MSG("EnvironmentalMeasurement: Initializing\n");
// it's possible to have this plugin enabled, only for displaying values on the screen.
// therefore, we should only enable the sensor loop if measurement is also enabled
switch (radioConfig.preferences.environmental_measurement_plugin_sensor_type) {
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT12:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT21:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT22:
return dhtSensor.runOnce();
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DS18B20:
return dallasSensor.runOnce();
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME280:
return bme280Sensor.runOnce();
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME680:
return bme680Sensor.runOnce();
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MCP9808:
return mcp9808Sensor.runOnce();
default:
DEBUG_MSG("EnvironmentalMeasurement: Invalid sensor type selected; Disabling plugin");
return (INT32_MAX);
break;
}
}
return (INT32_MAX);
} else {
// if we somehow got to a second run of this plugin with measurement disabled, then just wait forever
if (!radioConfig.preferences.environmental_measurement_plugin_measurement_enabled)
return (INT32_MAX);
// this is not the first time OSThread library has called this function
// so just do what we intend to do on the interval
if (sensor_read_error_count > radioConfig.preferences.environmental_measurement_plugin_read_error_count_threshold) {
if (radioConfig.preferences.environmental_measurement_plugin_recovery_interval > 0) {
DEBUG_MSG("EnvironmentalMeasurement: TEMPORARILY DISABLED; The "
"environmental_measurement_plugin_read_error_count_threshold has been exceed: %d. Will retry reads in "
"%d seconds\n",
radioConfig.preferences.environmental_measurement_plugin_read_error_count_threshold,
radioConfig.preferences.environmental_measurement_plugin_recovery_interval);
sensor_read_error_count = 0;
return (radioConfig.preferences.environmental_measurement_plugin_recovery_interval * 1000);
}
DEBUG_MSG("EnvironmentalMeasurement: DISABLED; The environmental_measurement_plugin_read_error_count_threshold has "
"been exceed: %d. Reads will not be retried until after device reset\n",
radioConfig.preferences.environmental_measurement_plugin_read_error_count_threshold);
return (INT32_MAX);
} else if (sensor_read_error_count > 0) {
DEBUG_MSG("EnvironmentalMeasurement: There have been %d sensor read failures. Will retry %d more times\n",
sensor_read_error_count, sensor_read_error_count, sensor_read_error_count,
radioConfig.preferences.environmental_measurement_plugin_read_error_count_threshold -
sensor_read_error_count);
}
if (!sendOurEnvironmentalMeasurement()) {
// if we failed to read the sensor, then try again
// as soon as we can according to the maximum polling frequency
switch (radioConfig.preferences.environmental_measurement_plugin_sensor_type) {
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT12:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT21:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT22:
return (DHT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DS18B20:
return (DS18B20_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME280:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME680:
return (BME_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MCP9808:
return (MCP_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
default:
return (DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
}
}
}
// The return of runOnce is an int32 representing the desired number of
// miliseconds until the function should be called again by the
// OSThread library. Multiply the preference value by 1000 to convert seconds to miliseconds
return (radioConfig.preferences.environmental_measurement_plugin_update_interval * 1000);
#endif
}
bool EnvironmentalMeasurementPlugin::wantUIFrame()
{
return radioConfig.preferences.environmental_measurement_plugin_screen_enabled;
}
String GetSenderName(const MeshPacket &mp)
{
String sender;
auto node = nodeDB.getNode(getFrom(&mp));
if (node) {
sender = node->user.short_name;
} else {
sender = "UNK";
}
return sender;
}
uint32_t GetTimeSinceMeshPacket(const MeshPacket *mp)
{
uint32_t now = getTime();
uint32_t last_seen = mp->rx_time;
int delta = (int)(now - last_seen);
if (delta < 0) // our clock must be slightly off still - not set from GPS yet
delta = 0;
return delta;
}
float EnvironmentalMeasurementPlugin::CelsiusToFarenheit(float c)
{
return (c * 9) / 5 + 32;
}
void EnvironmentalMeasurementPlugin::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->setFont(FONT_MEDIUM);
display->drawString(x, y, "Environment");
if (lastMeasurementPacket == nullptr) {
display->setFont(FONT_SMALL);
display->drawString(x, y += fontHeight(FONT_MEDIUM), "No measurement");
return;
}
EnvironmentalMeasurement lastMeasurement;
uint32_t agoSecs = GetTimeSinceMeshPacket(lastMeasurementPacket);
String lastSender = GetSenderName(*lastMeasurementPacket);
auto &p = lastMeasurementPacket->decoded;
if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, EnvironmentalMeasurement_fields, &lastMeasurement)) {
display->setFont(FONT_SMALL);
display->drawString(x, y += fontHeight(FONT_MEDIUM), "Measurement Error");
DEBUG_MSG("EnvironmentalMeasurement: unable to decode last packet");
return;
}
display->setFont(FONT_SMALL);
String last_temp = String(lastMeasurement.temperature, 0) + "°C";
if (radioConfig.preferences.environmental_measurement_plugin_display_farenheit) {
last_temp = String(CelsiusToFarenheit(lastMeasurement.temperature), 0) + "°F";
}
display->drawString(x, y += fontHeight(FONT_MEDIUM) - 2, "From: " + lastSender + "(" + String(agoSecs) + "s)");
display->drawString(x, y += fontHeight(FONT_SMALL) - 2,"Temp/Hum: " + last_temp + " / " + String(lastMeasurement.relative_humidity, 0) + "%");
if (lastMeasurement.barometric_pressure != 0)
display->drawString(x, y += fontHeight(FONT_SMALL),"Press: " + String(lastMeasurement.barometric_pressure, 0) + "hPA");
}
bool EnvironmentalMeasurementPlugin::handleReceivedProtobuf(const MeshPacket &mp, EnvironmentalMeasurement *p)
{
if (!(radioConfig.preferences.environmental_measurement_plugin_measurement_enabled ||
radioConfig.preferences.environmental_measurement_plugin_screen_enabled)) {
// If this plugin is not enabled in any capacity, don't handle the packet, and allow other plugins to consume
return false;
}
String sender = GetSenderName(mp);
DEBUG_MSG("EnvironmentalMeasurement: Received data from %s\n", sender);
DEBUG_MSG("EnvironmentalMeasurement->relative_humidity: %f\n", p->relative_humidity);
DEBUG_MSG("EnvironmentalMeasurement->temperature: %f\n", p->temperature);
DEBUG_MSG("EnvironmentalMeasurement->barometric_pressure: %f\n", p->barometric_pressure);
DEBUG_MSG("EnvironmentalMeasurement->gas_resistance: %f\n", p->gas_resistance);
lastMeasurementPacket = packetPool.allocCopy(mp);
return false; // Let others look at this message also if they want
}
bool EnvironmentalMeasurementPlugin::sendOurEnvironmentalMeasurement(NodeNum dest, bool wantReplies)
{
EnvironmentalMeasurement m;
m.barometric_pressure = 0;
m.gas_resistance = 0;
DEBUG_MSG("-----------------------------------------\n");
DEBUG_MSG("EnvironmentalMeasurement: Read data\n");
switch (radioConfig.preferences.environmental_measurement_plugin_sensor_type) {
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DS18B20:
if (!dallasSensor.getMeasurement(&m))
sensor_read_error_count++;
break;
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT12:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT21:
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT22:
if (!dhtSensor.getMeasurement(&m))
sensor_read_error_count++;
break;
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME280:
bme280Sensor.getMeasurement(&m);
break;
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_BME680:
bme680Sensor.getMeasurement(&m);
break;
case RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MCP9808:
mcp9808Sensor.getMeasurement(&m);
break;
default:
DEBUG_MSG("EnvironmentalMeasurement: Invalid sensor type selected; Disabling plugin");
return false;
}
DEBUG_MSG("EnvironmentalMeasurement->relative_humidity: %f\n", m.relative_humidity);
DEBUG_MSG("EnvironmentalMeasurement->temperature: %f\n", m.temperature);
DEBUG_MSG("EnvironmentalMeasurement->barometric_pressure: %f\n", m.barometric_pressure);
DEBUG_MSG("EnvironmentalMeasurement->gas_resistance: %f\n", m.gas_resistance);
sensor_read_error_count = 0;
MeshPacket *p = allocDataProtobuf(m);
p->to = dest;
p->decoded.want_response = wantReplies;
lastMeasurementPacket = packetPool.allocCopy(*p);
DEBUG_MSG("EnvironmentalMeasurement: Sending packet to mesh");
service.sendToMesh(p);
return true;
}

View File

@ -1,15 +0,0 @@
#include "../mesh/generated/environmental_measurement.pb.h"
#include "EnvironmentalMeasurementSensor.h"
#include <Adafruit_BME280.h>
#define BME_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class BME280Sensor : virtual public EnvironmentalMeasurementSensor {
private:
Adafruit_BME280 bme280;
public:
BME280Sensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(EnvironmentalMeasurement *measurement) override;
};

View File

@ -1,15 +0,0 @@
#include "../mesh/generated/environmental_measurement.pb.h"
#include "EnvironmentalMeasurementSensor.h"
#include <Adafruit_BME680.h>
#define BME_680_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class BME680Sensor : virtual public EnvironmentalMeasurementSensor {
private:
Adafruit_BME680 bme680;
public:
BME680Sensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(EnvironmentalMeasurement *measurement) override;
};

View File

@ -1,36 +0,0 @@
#include "../mesh/generated/environmental_measurement.pb.h"
#include "configuration.h"
#include "MeshService.h"
#include "EnvironmentalMeasurementSensor.h"
#include "DHTSensor.h"
#include <DHT.h>
DHTSensor::DHTSensor() : EnvironmentalMeasurementSensor {} {
}
int32_t DHTSensor::runOnce() {
if (RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11 ||
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT12) {
dht = new DHT(radioConfig.preferences.environmental_measurement_plugin_sensor_pin, DHT11);
}
else {
dht = new DHT(radioConfig.preferences.environmental_measurement_plugin_sensor_pin, DHT22);
}
dht->begin();
dht->read();
DEBUG_MSG("EnvironmentalMeasurement: Opened DHT11/DHT12 on pin: %d\n",
radioConfig.preferences.environmental_measurement_plugin_sensor_pin);
return (DHT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
}
bool DHTSensor::getMeasurement(EnvironmentalMeasurement *measurement) {
if (!dht->read(true)) {
DEBUG_MSG("EnvironmentalMeasurement: FAILED TO READ DATA\n");
return false;
}
measurement->relative_humidity = dht->readHumidity();
measurement->temperature = dht->readTemperature();
return true;
}

View File

@ -1,15 +0,0 @@
#include "../mesh/generated/environmental_measurement.pb.h"
#include "EnvironmentalMeasurementSensor.h"
#include <DHT.h>
#define DHT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class DHTSensor : virtual public EnvironmentalMeasurementSensor {
private:
DHT *dht = NULL;
public:
DHTSensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(EnvironmentalMeasurement *measurement) override;
};

View File

@ -1,17 +0,0 @@
#include "../mesh/generated/environmental_measurement.pb.h"
#include "EnvironmentalMeasurementSensor.h"
#include <DS18B20.h>
#include <OneWire.h>
#define DS18B20_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class DallasSensor : virtual public EnvironmentalMeasurementSensor {
private:
OneWire *oneWire = NULL;
DS18B20 *ds18b20 = NULL;
public:
DallasSensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(EnvironmentalMeasurement *measurement) override;
};

View File

@ -1,12 +0,0 @@
#pragma once
#include "../mesh/generated/environmental_measurement.pb.h"
#define DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class EnvironmentalMeasurementSensor {
protected:
EnvironmentalMeasurementSensor() { }
public:
virtual int32_t runOnce() = 0;
virtual bool getMeasurement(EnvironmentalMeasurement *measurement) = 0;
};

View File

@ -1,15 +0,0 @@
#include "../mesh/generated/environmental_measurement.pb.h"
#include "EnvironmentalMeasurementSensor.h"
#include <Adafruit_MCP9808.h>
#define MCP_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class MCP9808Sensor : virtual public EnvironmentalMeasurementSensor {
private:
Adafruit_MCP9808 mcp9808;
public:
MCP9808Sensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(EnvironmentalMeasurement *measurement) override;
};

View File

@ -11,7 +11,7 @@
#include "plugins/RoutingPlugin.h" #include "plugins/RoutingPlugin.h"
#include "plugins/TextMessagePlugin.h" #include "plugins/TextMessagePlugin.h"
#ifndef PORTDUINO #ifndef PORTDUINO
#include "plugins/EnvironmentalMeasurement/EnvironmentalMeasurementPlugin.h" #include "plugins/Telemetry/Telemetry.h"
#endif #endif
#ifndef NO_ESP32 #ifndef NO_ESP32
#include "plugins/esp32/RangeTestPlugin.h" #include "plugins/esp32/RangeTestPlugin.h"
@ -39,7 +39,7 @@ void setupPlugins()
rotaryEncoderInterruptImpl1->init(); rotaryEncoderInterruptImpl1->init();
cannedMessagePlugin = new CannedMessagePlugin(); cannedMessagePlugin = new CannedMessagePlugin();
#ifndef PORTDUINO #ifndef PORTDUINO
new EnvironmentalMeasurementPlugin(); new TelemetryPlugin();
#endif #endif
#ifndef NO_ESP32 #ifndef NO_ESP32
// Only run on an esp32 based device. // Only run on an esp32 based device.

View File

@ -1,10 +1,10 @@
#include "../mesh/generated/environmental_measurement.pb.h" #include "../mesh/generated/telemetry.pb.h"
#include "configuration.h" #include "configuration.h"
#include "EnvironmentalMeasurementSensor.h" #include "TelemetrySensor.h"
#include "BME280Sensor.h" #include "BME280Sensor.h"
#include <Adafruit_BME280.h> #include <Adafruit_BME280.h>
BME280Sensor::BME280Sensor() : EnvironmentalMeasurementSensor {} { BME280Sensor::BME280Sensor() : TelemetrySensor {} {
} }
int32_t BME280Sensor::runOnce() { int32_t BME280Sensor::runOnce() {
@ -15,12 +15,12 @@ int32_t BME280Sensor::runOnce() {
DEBUG_MSG("Could not find a valid BME280 sensor, check wiring, address, sensor ID!"); DEBUG_MSG("Could not find a valid BME280 sensor, check wiring, address, sensor ID!");
// TODO more verbose diagnostics // TODO more verbose diagnostics
} else { } else {
DEBUG_MSG("EnvironmentalMeasurement: Opened BME280 on default i2c bus"); DEBUG_MSG("Telemetry: Opened BME280 on default i2c bus");
} }
return BME_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; return BME_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
} }
bool BME280Sensor::getMeasurement(EnvironmentalMeasurement *measurement) { bool BME280Sensor::getMeasurement(Telemetry *measurement) {
measurement->temperature = bme280.readTemperature(); measurement->temperature = bme280.readTemperature();
measurement->relative_humidity = bme280.readHumidity(); measurement->relative_humidity = bme280.readHumidity();
measurement->barometric_pressure = bme280.readPressure() / 100.0F; measurement->barometric_pressure = bme280.readPressure() / 100.0F;

View File

@ -0,0 +1,15 @@
#include "../mesh/generated/telemetry.pb.h"
#include "TelemetrySensor.h"
#include <Adafruit_BME280.h>
#define BME_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class BME280Sensor : virtual public TelemetrySensor {
private:
Adafruit_BME280 bme280;
public:
BME280Sensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(Telemetry *measurement) override;
};

View File

@ -1,10 +1,10 @@
#include "../mesh/generated/environmental_measurement.pb.h" #include "../mesh/generated/telemetry.pb.h"
#include "configuration.h" #include "configuration.h"
#include "EnvironmentalMeasurementSensor.h" #include "TelemetrySensor.h"
#include "BME680Sensor.h" #include "BME680Sensor.h"
#include <Adafruit_BME680.h> #include <Adafruit_BME680.h>
BME680Sensor::BME680Sensor() : EnvironmentalMeasurementSensor {} { BME680Sensor::BME680Sensor() : TelemetrySensor {} {
} }
int32_t BME680Sensor::runOnce() { int32_t BME680Sensor::runOnce() {
@ -13,9 +13,9 @@ int32_t BME680Sensor::runOnce() {
bme680Status = bme680.begin(0x76); bme680Status = bme680.begin(0x76);
if (!bme680Status) { if (!bme680Status) {
DEBUG_MSG("Could not find a valid BME680 sensor, check wiring, address, sensor ID!"); DEBUG_MSG("Could not find a valid BME680 sensor, check wiring, address, sensor ID!");
// TODO more verbose diagnosticsEnvironmentalMeasurementSensor // TODO more verbose TelemetrySensor
} else { } else {
DEBUG_MSG("EnvironmentalMeasurement: Opened BME680 on default i2c bus"); DEBUG_MSG("Telemetry: Opened BME680 on default i2c bus");
// Set up oversampling and filter initialization // Set up oversampling and filter initialization
bme680.setTemperatureOversampling(BME680_OS_8X); bme680.setTemperatureOversampling(BME680_OS_8X);
bme680.setHumidityOversampling(BME680_OS_2X); bme680.setHumidityOversampling(BME680_OS_2X);
@ -26,7 +26,7 @@ int32_t BME680Sensor::runOnce() {
return (BME_680_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS); return (BME_680_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
} }
bool BME680Sensor::getMeasurement(EnvironmentalMeasurement *measurement) { bool BME680Sensor::getMeasurement(Telemetry *measurement) {
measurement->temperature = bme680.readTemperature(); measurement->temperature = bme680.readTemperature();
measurement->relative_humidity = bme680.readHumidity(); measurement->relative_humidity = bme680.readHumidity();
measurement->barometric_pressure = bme680.readPressure() / 100.0F; measurement->barometric_pressure = bme680.readPressure() / 100.0F;

View File

@ -0,0 +1,15 @@
#include "../mesh/generated/telemetry.pb.h"
#include "TelemetrySensor.h"
#include <Adafruit_BME680.h>
#define BME_680_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class BME680Sensor : virtual public TelemetrySensor {
private:
Adafruit_BME680 bme680;
public:
BME680Sensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(Telemetry *measurement) override;
};

View File

@ -0,0 +1,36 @@
#include "../mesh/generated/telemetry.pb.h"
#include "configuration.h"
#include "MeshService.h"
#include "TelemetrySensor.h"
#include "DHTSensor.h"
#include <DHT.h>
DHTSensor::DHTSensor() : TelemetrySensor {} {
}
int32_t DHTSensor::runOnce() {
if (RadioConfig_UserPreferences_TelemetrySensorType_DHT11 ||
RadioConfig_UserPreferences_TelemetrySensorType_DHT12) {
dht = new DHT(radioConfig.preferences.telemetry_module_sensor_pin, DHT11);
}
else {
dht = new DHT(radioConfig.preferences.telemetry_module_sensor_pin, DHT22);
}
dht->begin();
dht->read();
DEBUG_MSG("Telemetry: Opened DHT11/DHT12 on pin: %d\n",
radioConfig.preferences.telemetry_module_sensor_pin);
return (DHT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
}
bool DHTSensor::getMeasurement(Telemetry *measurement) {
if (!dht->read(true)) {
DEBUG_MSG("Telemetry: FAILED TO READ DATA\n");
return false;
}
measurement->relative_humidity = dht->readHumidity();
measurement->temperature = dht->readTemperature();
return true;
}

View File

@ -0,0 +1,15 @@
#include "../mesh/generated/telemetry.pb.h"
#include "TelemetrySensor.h"
#include <DHT.h>
#define DHT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class DHTSensor : virtual public TelemetrySensor {
private:
DHT *dht = NULL;
public:
DHTSensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(Telemetry *measurement) override;
};

View File

@ -1,26 +1,26 @@
#include "../mesh/generated/environmental_measurement.pb.h" #include "../mesh/generated/telemetry.pb.h"
#include "configuration.h" #include "configuration.h"
#include "MeshService.h" #include "MeshService.h"
#include "EnvironmentalMeasurementSensor.h" #include "TelemetrySensor.h"
#include "DallasSensor.h" #include "DallasSensor.h"
#include <DS18B20.h> #include <DS18B20.h>
#include <OneWire.h> #include <OneWire.h>
DallasSensor::DallasSensor() : EnvironmentalMeasurementSensor {} { DallasSensor::DallasSensor() : TelemetrySensor {} {
} }
int32_t DallasSensor::runOnce() { int32_t DallasSensor::runOnce() {
oneWire = new OneWire(radioConfig.preferences.environmental_measurement_plugin_sensor_pin); oneWire = new OneWire(radioConfig.preferences.telemetry_module_sensor_pin);
ds18b20 = new DS18B20(oneWire); ds18b20 = new DS18B20(oneWire);
ds18b20->begin(); ds18b20->begin();
ds18b20->setResolution(12); ds18b20->setResolution(12);
ds18b20->requestTemperatures(); ds18b20->requestTemperatures();
DEBUG_MSG("EnvironmentalMeasurement: Opened DS18B20 on pin: %d\n", DEBUG_MSG("Telemetry: Opened DS18B20 on pin: %d\n",
radioConfig.preferences.environmental_measurement_plugin_sensor_pin); radioConfig.preferences.telemetry_module_sensor_pin);
return (DS18B20_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS); return (DS18B20_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
} }
bool DallasSensor::getMeasurement(EnvironmentalMeasurement *measurement) { bool DallasSensor::getMeasurement(Telemetry *measurement) {
if (ds18b20->isConversionComplete()) { if (ds18b20->isConversionComplete()) {
measurement->temperature = ds18b20->getTempC(); measurement->temperature = ds18b20->getTempC();
measurement->relative_humidity = 0; measurement->relative_humidity = 0;

View File

@ -0,0 +1,17 @@
#include "../mesh/generated/telemetry.pb.h"
#include "TelemetrySensor.h"
#include <DS18B20.h>
#include <OneWire.h>
#define DS18B20_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class DallasSensor : virtual public TelemetrySensor {
private:
OneWire *oneWire = NULL;
DS18B20 *ds18b20 = NULL;
public:
DallasSensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(Telemetry *measurement) override;
};

View File

@ -1,10 +1,10 @@
#include "../mesh/generated/environmental_measurement.pb.h" #include "../mesh/generated/telemetry.pb.h"
#include "configuration.h" #include "configuration.h"
#include "EnvironmentalMeasurementSensor.h" #include "TelemetrySensor.h"
#include "MCP9808Sensor.h" #include "MCP9808Sensor.h"
#include <Adafruit_MCP9808.h> #include <Adafruit_MCP9808.h>
MCP9808Sensor::MCP9808Sensor() : EnvironmentalMeasurementSensor {} { MCP9808Sensor::MCP9808Sensor() : TelemetrySensor {} {
} }
int32_t MCP9808Sensor::runOnce() { int32_t MCP9808Sensor::runOnce() {
@ -14,14 +14,14 @@ int32_t MCP9808Sensor::runOnce() {
if (!mcp9808Status) { if (!mcp9808Status) {
DEBUG_MSG("Could not find a valid MCP9808 sensor, check wiring, address, sensor ID!"); DEBUG_MSG("Could not find a valid MCP9808 sensor, check wiring, address, sensor ID!");
} else { } else {
DEBUG_MSG("EnvironmentalMeasurement: Opened MCP9808 on default i2c bus"); DEBUG_MSG("TelemetrySensor: Opened MCP9808 on default i2c bus");
// Reduce resolution from 0.0625 degrees (precision) to 0.125 degrees (high). // Reduce resolution from 0.0625 degrees (precision) to 0.125 degrees (high).
mcp9808.setResolution(2); mcp9808.setResolution(2);
} }
return (MCP_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS); return (MCP_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
} }
bool MCP9808Sensor::getMeasurement(EnvironmentalMeasurement *measurement) { bool MCP9808Sensor::getMeasurement(Telemetry *measurement) {
measurement->temperature = mcp9808.readTempC(); measurement->temperature = mcp9808.readTempC();
return true; return true;

View File

@ -0,0 +1,15 @@
#include "../mesh/generated/telemetry.pb.h"
#include "TelemetrySensor.h"
#include <Adafruit_MCP9808.h>
#define MCP_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class MCP9808Sensor : virtual public TelemetrySensor {
private:
Adafruit_MCP9808 mcp9808;
public:
MCP9808Sensor();
virtual int32_t runOnce() override;
virtual bool getMeasurement(Telemetry *measurement) override;
};

View File

@ -0,0 +1,12 @@
#pragma once
#include "../mesh/generated/telemetry.pb.h"
#define DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
class TelemetrySensor {
protected:
TelemetrySensor() { }
public:
virtual int32_t runOnce() = 0;
virtual bool getMeasurement(Telemetry *measurement) = 0;
};

View File

@ -0,0 +1,299 @@
#include "Telemetry.h"
#include "../mesh/generated/telemetry.pb.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "main.h"
#include <OLEDDisplay.h>
#include <OLEDDisplayUi.h>
// Sensors
#include "Sensor/BME280Sensor.h"
#include "Sensor/BME680Sensor.h"
#include "Sensor/DHTSensor.h"
#include "Sensor/DallasSensor.h"
#include "Sensor/MCP9808Sensor.h"
BME280Sensor bme280Sensor;
BME680Sensor bme680Sensor;
DHTSensor dhtSensor;
DallasSensor dallasSensor;
MCP9808Sensor mcp9808Sensor;
#define FAILED_STATE_SENSOR_READ_MULTIPLIER 10
#define DISPLAY_RECEIVEID_MEASUREMENTS_ON_SCREEN true
#ifdef HAS_EINK
// The screen is bigger so use bigger fonts
#define FONT_SMALL ArialMT_Plain_16
#define FONT_MEDIUM ArialMT_Plain_24
#define FONT_LARGE ArialMT_Plain_24
#else
#define FONT_SMALL ArialMT_Plain_10
#define FONT_MEDIUM ArialMT_Plain_16
#define FONT_LARGE ArialMT_Plain_24
#endif
#define fontHeight(font) ((font)[1] + 1) // height is position 1
#define FONT_HEIGHT_SMALL fontHeight(FONT_SMALL)
#define FONT_HEIGHT_MEDIUM fontHeight(FONT_MEDIUM)
int32_t TelemetryPlugin::runOnce()
{
#ifndef PORTDUINO
/*
Uncomment the preferences below if you want to use the plugin
without having to configure it from the PythonAPI or WebUI.
*/
/*
radioConfig.preferences.telemetry_module_measurement_enabled = 1;
radioConfig.preferences.telemetry_module_screen_enabled = 1;
radioConfig.preferences.telemetry_module_read_error_count_threshold = 5;
radioConfig.preferences.telemetry_module_update_interval = 600;
radioConfig.preferences.telemetry_module_recovery_interval = 60;
radioConfig.preferences.telemetry_module_display_farenheit = false;
radioConfig.preferences.telemetry_module_sensor_pin = 13;
radioConfig.preferences.telemetry_module_sensor_type =
RadioConfig_UserPreferences_TelemetrySensorType::
RadioConfig_UserPreferences_TelemetrySensorType_BME280;
*/
if (!(radioConfig.preferences.telemetry_module_measurement_enabled ||
radioConfig.preferences.telemetry_module_screen_enabled)) {
// If this plugin is not enabled, and the user doesn't want the display screen don't waste any OSThread time on it
return (INT32_MAX);
}
if (firstTime) {
// This is the first time the OSThread library has called this function, so do some setup
firstTime = 0;
if (radioConfig.preferences.telemetry_module_measurement_enabled) {
DEBUG_MSG("Telemetry: Initializing\n");
// it's possible to have this plugin enabled, only for displaying values on the screen.
// therefore, we should only enable the sensor loop if measurement is also enabled
switch (radioConfig.preferences.telemetry_module_sensor_type) {
case RadioConfig_UserPreferences_TelemetrySensorType_DHT11:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT12:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT21:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT22:
return dhtSensor.runOnce();
case RadioConfig_UserPreferences_TelemetrySensorType_DS18B20:
return dallasSensor.runOnce();
case RadioConfig_UserPreferences_TelemetrySensorType_BME280:
return bme280Sensor.runOnce();
case RadioConfig_UserPreferences_TelemetrySensorType_BME680:
return bme680Sensor.runOnce();
case RadioConfig_UserPreferences_TelemetrySensorType_MCP9808:
return mcp9808Sensor.runOnce();
default:
DEBUG_MSG("Telemetry: Invalid sensor type selected; Disabling plugin");
return (INT32_MAX);
break;
}
}
return (INT32_MAX);
} else {
// if we somehow got to a second run of this plugin with measurement disabled, then just wait forever
if (!radioConfig.preferences.telemetry_module_measurement_enabled)
return (INT32_MAX);
// this is not the first time OSThread library has called this function
// so just do what we intend to do on the interval
if (sensor_read_error_count > radioConfig.preferences.telemetry_module_read_error_count_threshold) {
if (radioConfig.preferences.telemetry_module_recovery_interval > 0) {
DEBUG_MSG("Telemetry: TEMPORARILY DISABLED; The "
"telemetry_module_read_error_count_threshold has been exceed: %d. Will retry reads in "
"%d seconds\n",
radioConfig.preferences.telemetry_module_read_error_count_threshold,
radioConfig.preferences.telemetry_module_recovery_interval);
sensor_read_error_count = 0;
return (radioConfig.preferences.telemetry_module_recovery_interval * 1000);
}
DEBUG_MSG("Telemetry: DISABLED; The telemetry_module_read_error_count_threshold has "
"been exceed: %d. Reads will not be retried until after device reset\n",
radioConfig.preferences.telemetry_module_read_error_count_threshold);
return (INT32_MAX);
} else if (sensor_read_error_count > 0) {
DEBUG_MSG("Telemetry: There have been %d sensor read failures. Will retry %d more times\n",
sensor_read_error_count, sensor_read_error_count, sensor_read_error_count,
radioConfig.preferences.telemetry_module_read_error_count_threshold -
sensor_read_error_count);
}
if (!sendOurTelemetry()) {
// if we failed to read the sensor, then try again
// as soon as we can according to the maximum polling frequency
switch (radioConfig.preferences.telemetry_module_sensor_type) {
case RadioConfig_UserPreferences_TelemetrySensorType_DHT11:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT12:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT21:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT22:
return (DHT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
case RadioConfig_UserPreferences_TelemetrySensorType_DS18B20:
return (DS18B20_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
case RadioConfig_UserPreferences_TelemetrySensorType_BME280:
case RadioConfig_UserPreferences_TelemetrySensorType_BME680:
return (BME_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
case RadioConfig_UserPreferences_TelemetrySensorType_MCP9808:
return (MCP_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
default:
return (DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS);
}
}
}
// The return of runOnce is an int32 representing the desired number of
// miliseconds until the function should be called again by the
// OSThread library. Multiply the preference value by 1000 to convert seconds to miliseconds
return (radioConfig.preferences.telemetry_module_update_interval * 1000);
#endif
}
bool TelemetryPlugin::wantUIFrame()
{
return radioConfig.preferences.telemetry_module_screen_enabled;
}
String GetSenderName(const MeshPacket &mp)
{
String sender;
auto node = nodeDB.getNode(getFrom(&mp));
if (node) {
sender = node->user.short_name;
} else {
sender = "UNK";
}
return sender;
}
uint32_t GetTimeSinceMeshPacket(const MeshPacket *mp)
{
uint32_t now = getTime();
uint32_t last_seen = mp->rx_time;
int delta = (int)(now - last_seen);
if (delta < 0) // our clock must be slightly off still - not set from GPS yet
delta = 0;
return delta;
}
float TelemetryPlugin::CelsiusToFarenheit(float c)
{
return (c * 9) / 5 + 32;
}
void TelemetryPlugin::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->setFont(FONT_MEDIUM);
display->drawString(x, y, "Environment");
if (lastMeasurementPacket == nullptr) {
display->setFont(FONT_SMALL);
display->drawString(x, y += fontHeight(FONT_MEDIUM), "No measurement");
return;
}
Telemetry lastMeasurement;
uint32_t agoSecs = GetTimeSinceMeshPacket(lastMeasurementPacket);
String lastSender = GetSenderName(*lastMeasurementPacket);
auto &p = lastMeasurementPacket->decoded;
if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, Telemetry_fields, &lastMeasurement)) {
display->setFont(FONT_SMALL);
display->drawString(x, y += fontHeight(FONT_MEDIUM), "Measurement Error");
DEBUG_MSG("Telemetry: unable to decode last packet");
return;
}
display->setFont(FONT_SMALL);
String last_temp = String(lastMeasurement.temperature, 0) + "°C";
if (radioConfig.preferences.telemetry_module_display_farenheit) {
last_temp = String(CelsiusToFarenheit(lastMeasurement.temperature), 0) + "°F";
}
display->drawString(x, y += fontHeight(FONT_MEDIUM) - 2, "From: " + lastSender + "(" + String(agoSecs) + "s)");
display->drawString(x, y += fontHeight(FONT_SMALL) - 2,"Temp/Hum: " + last_temp + " / " + String(lastMeasurement.relative_humidity, 0) + "%");
if (lastMeasurement.barometric_pressure != 0)
display->drawString(x, y += fontHeight(FONT_SMALL),"Press: " + String(lastMeasurement.barometric_pressure, 0) + "hPA");
}
bool TelemetryPlugin::handleReceivedProtobuf(const MeshPacket &mp, Telemetry *p)
{
if (!(radioConfig.preferences.telemetry_module_measurement_enabled ||
radioConfig.preferences.telemetry_module_screen_enabled)) {
// If this plugin is not enabled in any capacity, don't handle the packet, and allow other plugins to consume
return false;
}
String sender = GetSenderName(mp);
DEBUG_MSG("Telemetry: Received data from %s\n", sender);
DEBUG_MSG("Telemetry->relative_humidity: %f\n", p->relative_humidity);
DEBUG_MSG("Telemetry->temperature: %f\n", p->temperature);
DEBUG_MSG("Telemetry->barometric_pressure: %f\n", p->barometric_pressure);
DEBUG_MSG("Telemetry->gas_resistance: %f\n", p->gas_resistance);
lastMeasurementPacket = packetPool.allocCopy(mp);
return false; // Let others look at this message also if they want
}
bool TelemetryPlugin::sendOurTelemetry(NodeNum dest, bool wantReplies)
{
Telemetry m;
m.barometric_pressure = 0;
m.gas_resistance = 0;
DEBUG_MSG("-----------------------------------------\n");
DEBUG_MSG("Telemetry: Read data\n");
switch (radioConfig.preferences.telemetry_module_sensor_type) {
case RadioConfig_UserPreferences_TelemetrySensorType_DS18B20:
if (!dallasSensor.getMeasurement(&m))
sensor_read_error_count++;
break;
case RadioConfig_UserPreferences_TelemetrySensorType_DHT11:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT12:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT21:
case RadioConfig_UserPreferences_TelemetrySensorType_DHT22:
if (!dhtSensor.getMeasurement(&m))
sensor_read_error_count++;
break;
case RadioConfig_UserPreferences_TelemetrySensorType_BME280:
bme280Sensor.getMeasurement(&m);
break;
case RadioConfig_UserPreferences_TelemetrySensorType_BME680:
bme680Sensor.getMeasurement(&m);
break;
case RadioConfig_UserPreferences_TelemetrySensorType_MCP9808:
mcp9808Sensor.getMeasurement(&m);
break;
default:
DEBUG_MSG("Telemetry: Invalid sensor type selected; Disabling plugin");
return false;
}
DEBUG_MSG("Telemetry->relative_humidity: %f\n", m.relative_humidity);
DEBUG_MSG("Telemetry->temperature: %f\n", m.temperature);
DEBUG_MSG("Telemetry->barometric_pressure: %f\n", m.barometric_pressure);
DEBUG_MSG("Telemetry->gas_resistance: %f\n", m.gas_resistance);
sensor_read_error_count = 0;
MeshPacket *p = allocDataProtobuf(m);
p->to = dest;
p->decoded.want_response = wantReplies;
lastMeasurementPacket = packetPool.allocCopy(*p);
DEBUG_MSG("Telemetry: Sending packet to mesh");
service.sendToMesh(p);
return true;
}

View File

@ -1,15 +1,15 @@
#pragma once #pragma once
#include "../mesh/generated/environmental_measurement.pb.h" #include "../mesh/generated/telemetry.pb.h"
#include "ProtobufPlugin.h" #include "ProtobufPlugin.h"
#include <OLEDDisplay.h> #include <OLEDDisplay.h>
#include <OLEDDisplayUi.h> #include <OLEDDisplayUi.h>
class EnvironmentalMeasurementPlugin : private concurrency::OSThread, public ProtobufPlugin<EnvironmentalMeasurement> class TelemetryPlugin : private concurrency::OSThread, public ProtobufPlugin<Telemetry>
{ {
public: public:
EnvironmentalMeasurementPlugin() TelemetryPlugin()
: concurrency::OSThread("EnvironmentalMeasurementPlugin"), : concurrency::OSThread("TelemetryPlugin"),
ProtobufPlugin("EnvironmentalMeasurement", PortNum_ENVIRONMENTAL_MEASUREMENT_APP, &EnvironmentalMeasurement_msg) ProtobufPlugin("Telemetry", PortNum_TELEMETRY_APP, &Telemetry_msg)
{ {
lastMeasurementPacket = nullptr; lastMeasurementPacket = nullptr;
} }
@ -20,12 +20,12 @@ class EnvironmentalMeasurementPlugin : private concurrency::OSThread, public Pro
/** Called to handle a particular incoming message /** Called to handle a particular incoming message
@return true if you've guaranteed you've handled this message and no other handlers should be considered for it @return true if you've guaranteed you've handled this message and no other handlers should be considered for it
*/ */
virtual bool handleReceivedProtobuf(const MeshPacket &mp, EnvironmentalMeasurement *p) override; virtual bool handleReceivedProtobuf(const MeshPacket &mp, Telemetry *p) override;
virtual int32_t runOnce() override; virtual int32_t runOnce() override;
/** /**
* Send our EnvironmentalMeasurement into the mesh * Send our Telemetry into the mesh
*/ */
bool sendOurEnvironmentalMeasurement(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false); bool sendOurTelemetry(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false);
private: private:
float CelsiusToFarenheit(float c); float CelsiusToFarenheit(float c);

View File

@ -8,7 +8,7 @@ src_filter =
-<nrf52/> -<nrf52/>
-<mesh/http/> -<mesh/http/>
-<plugins/esp32> -<plugins/esp32>
-<plugins/EnvironmentalMeasurement> -<plugins/Telemetry>
+<../variants/portduino> +<../variants/portduino>
build_flags = ${arduino_base.build_flags} -O0 -I variants/portduino build_flags = ${arduino_base.build_flags} -O0 -I variants/portduino
framework = arduino framework = arduino
@ -27,7 +27,7 @@ src_filter =
-<nrf52/> -<nrf52/>
-<mesh/http/> -<mesh/http/>
-<plugins/esp32> -<plugins/esp32>
-<plugins/EnvironmentalMeasurement> -<plugins/Telemetry>
+<../variants/portduino> +<../variants/portduino>
build_flags = ${arduino_base.build_flags} -O0 -lgpiod -I variants/portduino build_flags = ${arduino_base.build_flags} -O0 -lgpiod -I variants/portduino
framework = arduino framework = arduino