mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-22 01:37:52 +00:00
Compare commits
11 Commits
mini-epape
...
status-mes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0ef2498a | ||
|
|
84cd870323 | ||
|
|
2eda145a56 | ||
|
|
eefc08087d | ||
|
|
fb6d199d36 | ||
|
|
7d4600f8c2 | ||
|
|
ff50ba4002 | ||
|
|
5c401b8e34 | ||
|
|
c96ebf15fd | ||
|
|
2f821ca267 | ||
|
|
be8506857c |
@@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "esp32s3_out.ld",
|
|
||||||
"partitions": "default.csv"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": [
|
|
||||||
"-DBOARD_HAS_PSRAM",
|
|
||||||
"-DARDUINO_ESP32S3_DEV",
|
|
||||||
"-DARDUINO_USB_MODE=1",
|
|
||||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
|
||||||
"-DARDUINO_RUNNING_CORE=1",
|
|
||||||
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
|
||||||
],
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"hwids": [["0x303A", "0x1001"]],
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3"
|
|
||||||
},
|
|
||||||
"connectivity": ["wifi"],
|
|
||||||
"debug": {
|
|
||||||
"default_tool": "esp-builtin",
|
|
||||||
"onboard_tools": ["esp-builtin"],
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": ["arduino", "espidf"],
|
|
||||||
"name": "LilyGo Mini-Epapaer-S3 (4 MB Flash, 2MB PSRAM)",
|
|
||||||
"upload": {
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"url": "https://www.lilygo.cc",
|
|
||||||
"vendor": "LilyGo"
|
|
||||||
}
|
|
||||||
@@ -212,3 +212,30 @@ lib_deps =
|
|||||||
sensirion/Sensirion Core@0.7.2
|
sensirion/Sensirion Core@0.7.2
|
||||||
# renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x
|
# renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x
|
||||||
sensirion/Sensirion I2C SCD4x@1.1.0
|
sensirion/Sensirion I2C SCD4x@1.1.0
|
||||||
|
; Same as environmental_extra but without BSEC (saves ~3.5KB DRAM for original ESP32 targets)
|
||||||
|
[environmental_extra_no_bsec]
|
||||||
|
lib_deps =
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library
|
||||||
|
adafruit/Adafruit BMP3XX Library@2.1.6
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit MAX1704X packageName=adafruit/library/Adafruit MAX1704X
|
||||||
|
adafruit/Adafruit MAX1704X@1.0.3
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit SHTC3 packageName=adafruit/library/Adafruit SHTC3 Library
|
||||||
|
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit LPS2X packageName=adafruit/library/Adafruit LPS2X
|
||||||
|
adafruit/Adafruit LPS2X@2.0.6
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit SHT31 packageName=adafruit/library/Adafruit SHT31 Library
|
||||||
|
adafruit/Adafruit SHT31 Library@2.2.2
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit VEML7700 packageName=adafruit/library/Adafruit VEML7700 Library
|
||||||
|
adafruit/Adafruit VEML7700 Library@2.1.6
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit SHT4x packageName=adafruit/library/Adafruit SHT4x Library
|
||||||
|
adafruit/Adafruit SHT4x Library@1.0.5
|
||||||
|
# renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library
|
||||||
|
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
||||||
|
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
||||||
|
closedcube/ClosedCube OPT3001@1.1.2
|
||||||
|
# renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master
|
||||||
|
https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip
|
||||||
|
# renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core
|
||||||
|
sensirion/Sensirion Core@0.7.2
|
||||||
|
# renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x
|
||||||
|
sensirion/Sensirion I2C SCD4x@1.1.0
|
||||||
Submodule protobufs updated: bbde30a0b9...77c8329a59
@@ -259,18 +259,6 @@ bool EInkDisplay::connect()
|
|||||||
adafruitDisplay->setRotation(3);
|
adafruitDisplay->setRotation(3);
|
||||||
adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT);
|
adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT);
|
||||||
}
|
}
|
||||||
#elif defined(MINI_EPAPER_S3)
|
|
||||||
spi1 = new SPIClass(HSPI);
|
|
||||||
spi1->begin(PIN_SPI1_SCK, PIN_SPI1_MISO, PIN_SPI1_MOSI, PIN_EINK_CS);
|
|
||||||
|
|
||||||
// Create GxEPD2 objects
|
|
||||||
auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY);
|
|
||||||
adafruitDisplay = new GxEPD2_BW<EINK_DISPLAY_MODEL, EINK_DISPLAY_MODEL::HEIGHT>(*lowLevel);
|
|
||||||
|
|
||||||
// Init GxEPD2
|
|
||||||
adafruitDisplay->init();
|
|
||||||
adafruitDisplay->setRotation(0);
|
|
||||||
adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT);
|
|
||||||
#elif defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_VISION_MASTER_E213)
|
#elif defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_VISION_MASTER_E213)
|
||||||
|
|
||||||
// Detect display model, before starting SPI
|
// Detect display model, before starting SPI
|
||||||
|
|||||||
@@ -93,8 +93,7 @@ class EInkDisplay : public OLEDDisplay
|
|||||||
SPIClass *hspi = NULL;
|
SPIClass *hspi = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) || defined(HELTEC_MESH_SOLAR_EINK) || \
|
#if defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) || defined(HELTEC_MESH_SOLAR_EINK)
|
||||||
defined(MINI_EPAPER_S3)
|
|
||||||
SPIClass *spi1 = NULL;
|
SPIClass *spi1 = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1410,6 +1410,15 @@ void NodeDB::loadFromDisk()
|
|||||||
if (portduino_config.has_configDisplayMode) {
|
if (portduino_config.has_configDisplayMode) {
|
||||||
config.display.displaymode = (_meshtastic_Config_DisplayConfig_DisplayMode)portduino_config.configDisplayMode;
|
config.display.displaymode = (_meshtastic_Config_DisplayConfig_DisplayMode)portduino_config.configDisplayMode;
|
||||||
}
|
}
|
||||||
|
if (portduino_config.has_statusMessage) {
|
||||||
|
moduleConfig.has_statusmessage = true;
|
||||||
|
strncpy(moduleConfig.statusmessage.node_status, portduino_config.statusMessage.c_str(),
|
||||||
|
sizeof(moduleConfig.statusmessage.node_status));
|
||||||
|
moduleConfig.statusmessage.node_status[sizeof(moduleConfig.statusmessage.node_status) - 1] = '\0';
|
||||||
|
}
|
||||||
|
if (portduino_config.enable_UDP) {
|
||||||
|
config.network.enabled_protocols = true;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1510,6 +1519,7 @@ bool NodeDB::saveToDiskNoRetry(int saveWhat)
|
|||||||
moduleConfig.has_ambient_lighting = true;
|
moduleConfig.has_ambient_lighting = true;
|
||||||
moduleConfig.has_audio = true;
|
moduleConfig.has_audio = true;
|
||||||
moduleConfig.has_paxcounter = true;
|
moduleConfig.has_paxcounter = true;
|
||||||
|
moduleConfig.has_statusmessage = true;
|
||||||
|
|
||||||
success &=
|
success &=
|
||||||
saveProto(moduleConfigFileName, meshtastic_LocalModuleConfig_size, &meshtastic_LocalModuleConfig_msg, &moduleConfig);
|
saveProto(moduleConfigFileName, meshtastic_LocalModuleConfig_size, &meshtastic_LocalModuleConfig_msg, &moduleConfig);
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ typedef enum _meshtastic_AdminMessage_ModuleConfigType {
|
|||||||
/* TODO: REPLACE */
|
/* TODO: REPLACE */
|
||||||
meshtastic_AdminMessage_ModuleConfigType_DETECTIONSENSOR_CONFIG = 11,
|
meshtastic_AdminMessage_ModuleConfigType_DETECTIONSENSOR_CONFIG = 11,
|
||||||
/* TODO: REPLACE */
|
/* TODO: REPLACE */
|
||||||
meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG = 12
|
meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG = 12,
|
||||||
|
/* TODO: REPLACE */
|
||||||
|
meshtastic_AdminMessage_ModuleConfigType_STATUSMESSAGE_CONFIG = 13
|
||||||
} meshtastic_AdminMessage_ModuleConfigType;
|
} meshtastic_AdminMessage_ModuleConfigType;
|
||||||
|
|
||||||
typedef enum _meshtastic_AdminMessage_BackupLocation {
|
typedef enum _meshtastic_AdminMessage_BackupLocation {
|
||||||
@@ -323,8 +325,8 @@ extern "C" {
|
|||||||
#define _meshtastic_AdminMessage_ConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ConfigType)(meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG+1))
|
#define _meshtastic_AdminMessage_ConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ConfigType)(meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG+1))
|
||||||
|
|
||||||
#define _meshtastic_AdminMessage_ModuleConfigType_MIN meshtastic_AdminMessage_ModuleConfigType_MQTT_CONFIG
|
#define _meshtastic_AdminMessage_ModuleConfigType_MIN meshtastic_AdminMessage_ModuleConfigType_MQTT_CONFIG
|
||||||
#define _meshtastic_AdminMessage_ModuleConfigType_MAX meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG
|
#define _meshtastic_AdminMessage_ModuleConfigType_MAX meshtastic_AdminMessage_ModuleConfigType_STATUSMESSAGE_CONFIG
|
||||||
#define _meshtastic_AdminMessage_ModuleConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ModuleConfigType)(meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG+1))
|
#define _meshtastic_AdminMessage_ModuleConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ModuleConfigType)(meshtastic_AdminMessage_ModuleConfigType_STATUSMESSAGE_CONFIG+1))
|
||||||
|
|
||||||
#define _meshtastic_AdminMessage_BackupLocation_MIN meshtastic_AdminMessage_BackupLocation_FLASH
|
#define _meshtastic_AdminMessage_BackupLocation_MIN meshtastic_AdminMessage_BackupLocation_FLASH
|
||||||
#define _meshtastic_AdminMessage_BackupLocation_MAX meshtastic_AdminMessage_BackupLocation_SD
|
#define _meshtastic_AdminMessage_BackupLocation_MAX meshtastic_AdminMessage_BackupLocation_SD
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
/* meshtastic_NodeDatabase_size depends on runtime parameters */
|
/* meshtastic_NodeDatabase_size depends on runtime parameters */
|
||||||
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size
|
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size
|
||||||
#define meshtastic_BackupPreferences_size 2279
|
#define meshtastic_BackupPreferences_size 2362
|
||||||
#define meshtastic_ChannelFile_size 718
|
#define meshtastic_ChannelFile_size 718
|
||||||
#define meshtastic_DeviceState_size 1737
|
#define meshtastic_DeviceState_size 1737
|
||||||
#define meshtastic_NodeInfoLite_size 196
|
#define meshtastic_NodeInfoLite_size 196
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ typedef struct _meshtastic_LocalModuleConfig {
|
|||||||
/* Paxcounter Config */
|
/* Paxcounter Config */
|
||||||
bool has_paxcounter;
|
bool has_paxcounter;
|
||||||
meshtastic_ModuleConfig_PaxcounterConfig paxcounter;
|
meshtastic_ModuleConfig_PaxcounterConfig paxcounter;
|
||||||
|
/* StatusMessage Config */
|
||||||
|
bool has_statusmessage;
|
||||||
|
meshtastic_ModuleConfig_StatusMessageConfig statusmessage;
|
||||||
} meshtastic_LocalModuleConfig;
|
} meshtastic_LocalModuleConfig;
|
||||||
|
|
||||||
|
|
||||||
@@ -96,9 +99,9 @@ extern "C" {
|
|||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_LocalConfig_init_default {false, meshtastic_Config_DeviceConfig_init_default, false, meshtastic_Config_PositionConfig_init_default, false, meshtastic_Config_PowerConfig_init_default, false, meshtastic_Config_NetworkConfig_init_default, false, meshtastic_Config_DisplayConfig_init_default, false, meshtastic_Config_LoRaConfig_init_default, false, meshtastic_Config_BluetoothConfig_init_default, 0, false, meshtastic_Config_SecurityConfig_init_default}
|
#define meshtastic_LocalConfig_init_default {false, meshtastic_Config_DeviceConfig_init_default, false, meshtastic_Config_PositionConfig_init_default, false, meshtastic_Config_PowerConfig_init_default, false, meshtastic_Config_NetworkConfig_init_default, false, meshtastic_Config_DisplayConfig_init_default, false, meshtastic_Config_LoRaConfig_init_default, false, meshtastic_Config_BluetoothConfig_init_default, 0, false, meshtastic_Config_SecurityConfig_init_default}
|
||||||
#define meshtastic_LocalModuleConfig_init_default {false, meshtastic_ModuleConfig_MQTTConfig_init_default, false, meshtastic_ModuleConfig_SerialConfig_init_default, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_default, false, meshtastic_ModuleConfig_StoreForwardConfig_init_default, false, meshtastic_ModuleConfig_RangeTestConfig_init_default, false, meshtastic_ModuleConfig_TelemetryConfig_init_default, false, meshtastic_ModuleConfig_CannedMessageConfig_init_default, 0, false, meshtastic_ModuleConfig_AudioConfig_init_default, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_default, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_default, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_default, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_default, false, meshtastic_ModuleConfig_PaxcounterConfig_init_default}
|
#define meshtastic_LocalModuleConfig_init_default {false, meshtastic_ModuleConfig_MQTTConfig_init_default, false, meshtastic_ModuleConfig_SerialConfig_init_default, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_default, false, meshtastic_ModuleConfig_StoreForwardConfig_init_default, false, meshtastic_ModuleConfig_RangeTestConfig_init_default, false, meshtastic_ModuleConfig_TelemetryConfig_init_default, false, meshtastic_ModuleConfig_CannedMessageConfig_init_default, 0, false, meshtastic_ModuleConfig_AudioConfig_init_default, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_default, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_default, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_default, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_default, false, meshtastic_ModuleConfig_PaxcounterConfig_init_default, false, meshtastic_ModuleConfig_StatusMessageConfig_init_default}
|
||||||
#define meshtastic_LocalConfig_init_zero {false, meshtastic_Config_DeviceConfig_init_zero, false, meshtastic_Config_PositionConfig_init_zero, false, meshtastic_Config_PowerConfig_init_zero, false, meshtastic_Config_NetworkConfig_init_zero, false, meshtastic_Config_DisplayConfig_init_zero, false, meshtastic_Config_LoRaConfig_init_zero, false, meshtastic_Config_BluetoothConfig_init_zero, 0, false, meshtastic_Config_SecurityConfig_init_zero}
|
#define meshtastic_LocalConfig_init_zero {false, meshtastic_Config_DeviceConfig_init_zero, false, meshtastic_Config_PositionConfig_init_zero, false, meshtastic_Config_PowerConfig_init_zero, false, meshtastic_Config_NetworkConfig_init_zero, false, meshtastic_Config_DisplayConfig_init_zero, false, meshtastic_Config_LoRaConfig_init_zero, false, meshtastic_Config_BluetoothConfig_init_zero, 0, false, meshtastic_Config_SecurityConfig_init_zero}
|
||||||
#define meshtastic_LocalModuleConfig_init_zero {false, meshtastic_ModuleConfig_MQTTConfig_init_zero, false, meshtastic_ModuleConfig_SerialConfig_init_zero, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero, false, meshtastic_ModuleConfig_StoreForwardConfig_init_zero, false, meshtastic_ModuleConfig_RangeTestConfig_init_zero, false, meshtastic_ModuleConfig_TelemetryConfig_init_zero, false, meshtastic_ModuleConfig_CannedMessageConfig_init_zero, 0, false, meshtastic_ModuleConfig_AudioConfig_init_zero, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_zero, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_zero, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_zero, false, meshtastic_ModuleConfig_PaxcounterConfig_init_zero}
|
#define meshtastic_LocalModuleConfig_init_zero {false, meshtastic_ModuleConfig_MQTTConfig_init_zero, false, meshtastic_ModuleConfig_SerialConfig_init_zero, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero, false, meshtastic_ModuleConfig_StoreForwardConfig_init_zero, false, meshtastic_ModuleConfig_RangeTestConfig_init_zero, false, meshtastic_ModuleConfig_TelemetryConfig_init_zero, false, meshtastic_ModuleConfig_CannedMessageConfig_init_zero, 0, false, meshtastic_ModuleConfig_AudioConfig_init_zero, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_zero, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_zero, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_zero, false, meshtastic_ModuleConfig_PaxcounterConfig_init_zero, false, meshtastic_ModuleConfig_StatusMessageConfig_init_zero}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_LocalConfig_device_tag 1
|
#define meshtastic_LocalConfig_device_tag 1
|
||||||
@@ -124,6 +127,7 @@ extern "C" {
|
|||||||
#define meshtastic_LocalModuleConfig_ambient_lighting_tag 12
|
#define meshtastic_LocalModuleConfig_ambient_lighting_tag 12
|
||||||
#define meshtastic_LocalModuleConfig_detection_sensor_tag 13
|
#define meshtastic_LocalModuleConfig_detection_sensor_tag 13
|
||||||
#define meshtastic_LocalModuleConfig_paxcounter_tag 14
|
#define meshtastic_LocalModuleConfig_paxcounter_tag 14
|
||||||
|
#define meshtastic_LocalModuleConfig_statusmessage_tag 15
|
||||||
|
|
||||||
/* Struct field encoding specification for nanopb */
|
/* Struct field encoding specification for nanopb */
|
||||||
#define meshtastic_LocalConfig_FIELDLIST(X, a) \
|
#define meshtastic_LocalConfig_FIELDLIST(X, a) \
|
||||||
@@ -161,7 +165,8 @@ X(a, STATIC, OPTIONAL, MESSAGE, remote_hardware, 10) \
|
|||||||
X(a, STATIC, OPTIONAL, MESSAGE, neighbor_info, 11) \
|
X(a, STATIC, OPTIONAL, MESSAGE, neighbor_info, 11) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, ambient_lighting, 12) \
|
X(a, STATIC, OPTIONAL, MESSAGE, ambient_lighting, 12) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, detection_sensor, 13) \
|
X(a, STATIC, OPTIONAL, MESSAGE, detection_sensor, 13) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, paxcounter, 14)
|
X(a, STATIC, OPTIONAL, MESSAGE, paxcounter, 14) \
|
||||||
|
X(a, STATIC, OPTIONAL, MESSAGE, statusmessage, 15)
|
||||||
#define meshtastic_LocalModuleConfig_CALLBACK NULL
|
#define meshtastic_LocalModuleConfig_CALLBACK NULL
|
||||||
#define meshtastic_LocalModuleConfig_DEFAULT NULL
|
#define meshtastic_LocalModuleConfig_DEFAULT NULL
|
||||||
#define meshtastic_LocalModuleConfig_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig
|
#define meshtastic_LocalModuleConfig_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig
|
||||||
@@ -177,6 +182,7 @@ X(a, STATIC, OPTIONAL, MESSAGE, paxcounter, 14)
|
|||||||
#define meshtastic_LocalModuleConfig_ambient_lighting_MSGTYPE meshtastic_ModuleConfig_AmbientLightingConfig
|
#define meshtastic_LocalModuleConfig_ambient_lighting_MSGTYPE meshtastic_ModuleConfig_AmbientLightingConfig
|
||||||
#define meshtastic_LocalModuleConfig_detection_sensor_MSGTYPE meshtastic_ModuleConfig_DetectionSensorConfig
|
#define meshtastic_LocalModuleConfig_detection_sensor_MSGTYPE meshtastic_ModuleConfig_DetectionSensorConfig
|
||||||
#define meshtastic_LocalModuleConfig_paxcounter_MSGTYPE meshtastic_ModuleConfig_PaxcounterConfig
|
#define meshtastic_LocalModuleConfig_paxcounter_MSGTYPE meshtastic_ModuleConfig_PaxcounterConfig
|
||||||
|
#define meshtastic_LocalModuleConfig_statusmessage_MSGTYPE meshtastic_ModuleConfig_StatusMessageConfig
|
||||||
|
|
||||||
extern const pb_msgdesc_t meshtastic_LocalConfig_msg;
|
extern const pb_msgdesc_t meshtastic_LocalConfig_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
||||||
@@ -186,9 +192,9 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
|||||||
#define meshtastic_LocalModuleConfig_fields &meshtastic_LocalModuleConfig_msg
|
#define meshtastic_LocalModuleConfig_fields &meshtastic_LocalModuleConfig_msg
|
||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
|
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalModuleConfig_size
|
||||||
#define meshtastic_LocalConfig_size 749
|
#define meshtastic_LocalConfig_size 749
|
||||||
#define meshtastic_LocalModuleConfig_size 675
|
#define meshtastic_LocalModuleConfig_size 758
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
|||||||
@@ -361,6 +361,8 @@ typedef struct _meshtastic_LocalStats {
|
|||||||
uint32_t heap_free_bytes;
|
uint32_t heap_free_bytes;
|
||||||
/* Number of packets that were dropped because the transmit queue was full. */
|
/* Number of packets that were dropped because the transmit queue was full. */
|
||||||
uint16_t num_tx_dropped;
|
uint16_t num_tx_dropped;
|
||||||
|
/* Noise floor value measured in dBm */
|
||||||
|
int32_t noise_floor;
|
||||||
} meshtastic_LocalStats;
|
} meshtastic_LocalStats;
|
||||||
|
|
||||||
/* Health telemetry metrics */
|
/* Health telemetry metrics */
|
||||||
@@ -458,7 +460,7 @@ extern "C" {
|
|||||||
#define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0}
|
#define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""}
|
#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""}
|
||||||
#define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}}
|
#define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}}
|
||||||
@@ -467,7 +469,7 @@ extern "C" {
|
|||||||
#define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0}
|
#define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""}
|
#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""}
|
||||||
#define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}}
|
#define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}}
|
||||||
@@ -556,6 +558,7 @@ extern "C" {
|
|||||||
#define meshtastic_LocalStats_heap_total_bytes_tag 12
|
#define meshtastic_LocalStats_heap_total_bytes_tag 12
|
||||||
#define meshtastic_LocalStats_heap_free_bytes_tag 13
|
#define meshtastic_LocalStats_heap_free_bytes_tag 13
|
||||||
#define meshtastic_LocalStats_num_tx_dropped_tag 14
|
#define meshtastic_LocalStats_num_tx_dropped_tag 14
|
||||||
|
#define meshtastic_LocalStats_noise_floor_tag 15
|
||||||
#define meshtastic_HealthMetrics_heart_bpm_tag 1
|
#define meshtastic_HealthMetrics_heart_bpm_tag 1
|
||||||
#define meshtastic_HealthMetrics_spO2_tag 2
|
#define meshtastic_HealthMetrics_spO2_tag 2
|
||||||
#define meshtastic_HealthMetrics_temperature_tag 3
|
#define meshtastic_HealthMetrics_temperature_tag 3
|
||||||
@@ -678,7 +681,8 @@ X(a, STATIC, SINGULAR, UINT32, num_tx_relay, 10) \
|
|||||||
X(a, STATIC, SINGULAR, UINT32, num_tx_relay_canceled, 11) \
|
X(a, STATIC, SINGULAR, UINT32, num_tx_relay_canceled, 11) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, heap_total_bytes, 12) \
|
X(a, STATIC, SINGULAR, UINT32, heap_total_bytes, 12) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, heap_free_bytes, 13) \
|
X(a, STATIC, SINGULAR, UINT32, heap_free_bytes, 13) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, num_tx_dropped, 14)
|
X(a, STATIC, SINGULAR, UINT32, num_tx_dropped, 14) \
|
||||||
|
X(a, STATIC, SINGULAR, INT32, noise_floor, 15)
|
||||||
#define meshtastic_LocalStats_CALLBACK NULL
|
#define meshtastic_LocalStats_CALLBACK NULL
|
||||||
#define meshtastic_LocalStats_DEFAULT NULL
|
#define meshtastic_LocalStats_DEFAULT NULL
|
||||||
|
|
||||||
@@ -755,7 +759,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg;
|
|||||||
#define meshtastic_EnvironmentMetrics_size 113
|
#define meshtastic_EnvironmentMetrics_size 113
|
||||||
#define meshtastic_HealthMetrics_size 11
|
#define meshtastic_HealthMetrics_size 11
|
||||||
#define meshtastic_HostMetrics_size 264
|
#define meshtastic_HostMetrics_size 264
|
||||||
#define meshtastic_LocalStats_size 76
|
#define meshtastic_LocalStats_size 87
|
||||||
#define meshtastic_Nau7802Config_size 16
|
#define meshtastic_Nau7802Config_size 16
|
||||||
#define meshtastic_PowerMetrics_size 81
|
#define meshtastic_PowerMetrics_size 81
|
||||||
#define meshtastic_Telemetry_size 272
|
#define meshtastic_Telemetry_size 272
|
||||||
|
|||||||
@@ -905,10 +905,11 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
|||||||
|
|
||||||
bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
||||||
{
|
{
|
||||||
|
bool shouldReboot = true;
|
||||||
// If we are in an open transaction or configuring MQTT or Serial (which have validation), defer disabling Bluetooth
|
// If we are in an open transaction or configuring MQTT or Serial (which have validation), defer disabling Bluetooth
|
||||||
// Otherwise, disable Bluetooth to prevent the phone from interfering with the config
|
// Otherwise, disable Bluetooth to prevent the phone from interfering with the config
|
||||||
if (!hasOpenEditTransaction &&
|
if (!hasOpenEditTransaction && !IS_ONE_OF(c.which_payload_variant, meshtastic_ModuleConfig_mqtt_tag,
|
||||||
!IS_ONE_OF(c.which_payload_variant, meshtastic_ModuleConfig_mqtt_tag, meshtastic_ModuleConfig_serial_tag)) {
|
meshtastic_ModuleConfig_serial_tag, meshtastic_ModuleConfig_statusmessage_tag)) {
|
||||||
disableBluetooth();
|
disableBluetooth();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1000,8 +1001,14 @@ bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
|||||||
moduleConfig.has_paxcounter = true;
|
moduleConfig.has_paxcounter = true;
|
||||||
moduleConfig.paxcounter = c.payload_variant.paxcounter;
|
moduleConfig.paxcounter = c.payload_variant.paxcounter;
|
||||||
break;
|
break;
|
||||||
|
case meshtastic_ModuleConfig_statusmessage_tag:
|
||||||
|
LOG_INFO("Set module config: StatusMessage");
|
||||||
|
moduleConfig.has_statusmessage = true;
|
||||||
|
moduleConfig.statusmessage = c.payload_variant.statusmessage;
|
||||||
|
shouldReboot = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
saveChanges(SEGMENT_MODULECONFIG);
|
saveChanges(SEGMENT_MODULECONFIG, shouldReboot);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1180,6 +1187,11 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const
|
|||||||
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_paxcounter_tag;
|
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_paxcounter_tag;
|
||||||
res.get_module_config_response.payload_variant.paxcounter = moduleConfig.paxcounter;
|
res.get_module_config_response.payload_variant.paxcounter = moduleConfig.paxcounter;
|
||||||
break;
|
break;
|
||||||
|
case meshtastic_AdminMessage_ModuleConfigType_STATUSMESSAGE_CONFIG:
|
||||||
|
LOG_INFO("Get module config: StatusMessage");
|
||||||
|
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_statusmessage_tag;
|
||||||
|
res.get_module_config_response.payload_variant.statusmessage = moduleConfig.statusmessage;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: The phone app needs to know the ls_secsvalue so it can properly expect sleep behavior.
|
// NOTE: The phone app needs to know the ls_secsvalue so it can properly expect sleep behavior.
|
||||||
|
|||||||
@@ -108,6 +108,9 @@
|
|||||||
#if !MESHTASTIC_EXCLUDE_DROPZONE
|
#if !MESHTASTIC_EXCLUDE_DROPZONE
|
||||||
#include "modules/DropzoneModule.h"
|
#include "modules/DropzoneModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||||
|
#include "modules/StatusMessageModule.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create module instances here. If you are adding a new module, you must 'new' it here (or somewhere else)
|
* Create module instances here. If you are adding a new module, you must 'new' it here (or somewhere else)
|
||||||
@@ -165,6 +168,9 @@ void setupModules()
|
|||||||
#if !MESHTASTIC_EXCLUDE_DROPZONE
|
#if !MESHTASTIC_EXCLUDE_DROPZONE
|
||||||
dropzoneModule = new DropzoneModule();
|
dropzoneModule = new DropzoneModule();
|
||||||
#endif
|
#endif
|
||||||
|
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||||
|
statusMessageModule = new StatusMessageModule();
|
||||||
|
#endif
|
||||||
#if !MESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE
|
#if !MESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE
|
||||||
new GenericThreadModule();
|
new GenericThreadModule();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
41
src/modules/StatusMessageModule.cpp
Normal file
41
src/modules/StatusMessageModule.cpp
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||||
|
|
||||||
|
#include "StatusMessageModule.h"
|
||||||
|
#include "MeshService.h"
|
||||||
|
#include "ProtobufModule.h"
|
||||||
|
|
||||||
|
StatusMessageModule *statusMessageModule;
|
||||||
|
|
||||||
|
int32_t StatusMessageModule::runOnce()
|
||||||
|
{
|
||||||
|
if (moduleConfig.has_statusmessage && moduleConfig.statusmessage.node_status[0] != '\0') {
|
||||||
|
// create and send message with the status message set
|
||||||
|
meshtastic_StatusMessage ourStatus = meshtastic_StatusMessage_init_zero;
|
||||||
|
strncpy(ourStatus.status, moduleConfig.statusmessage.node_status, sizeof(ourStatus.status));
|
||||||
|
ourStatus.status[sizeof(ourStatus.status) - 1] = '\0'; // ensure null termination
|
||||||
|
meshtastic_MeshPacket *p = allocDataPacket();
|
||||||
|
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes),
|
||||||
|
meshtastic_StatusMessage_fields, &ourStatus);
|
||||||
|
p->to = NODENUM_BROADCAST;
|
||||||
|
p->decoded.want_response = false;
|
||||||
|
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
|
||||||
|
p->channel = 0;
|
||||||
|
service->sendToMesh(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1000 * 12 * 60 * 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessMessage StatusMessageModule::handleReceived(const meshtastic_MeshPacket &mp)
|
||||||
|
{
|
||||||
|
if (mp.which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
||||||
|
meshtastic_StatusMessage incomingMessage;
|
||||||
|
if (pb_decode_from_bytes(mp.decoded.payload.bytes, mp.decoded.payload.size, meshtastic_StatusMessage_fields,
|
||||||
|
&incomingMessage)) {
|
||||||
|
LOG_INFO("Received a NodeStatus message %s", incomingMessage.status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ProcessMessage::CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
35
src/modules/StatusMessageModule.h
Normal file
35
src/modules/StatusMessageModule.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#pragma once
|
||||||
|
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||||
|
#include "SinglePortModule.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
|
class StatusMessageModule : public SinglePortModule, private concurrency::OSThread
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** Constructor
|
||||||
|
* name is for debugging output
|
||||||
|
*/
|
||||||
|
StatusMessageModule()
|
||||||
|
: SinglePortModule("statusMessage", meshtastic_PortNum_NODE_STATUS_APP), concurrency::OSThread("StatusMessage")
|
||||||
|
{
|
||||||
|
if (moduleConfig.has_statusmessage && moduleConfig.statusmessage.node_status[0] != '\0') {
|
||||||
|
this->setInterval(2 * 60 * 1000);
|
||||||
|
} else {
|
||||||
|
this->setInterval(1000 * 12 * 60 * 60);
|
||||||
|
}
|
||||||
|
// TODO: If we have a string, set the initial delay (15 minutes maybe)
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int32_t runOnce() override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** Called to handle a particular incoming message
|
||||||
|
*/
|
||||||
|
virtual ProcessMessage handleReceived(const meshtastic_MeshPacket &mp) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
extern StatusMessageModule *statusMessageModule;
|
||||||
|
#endif
|
||||||
@@ -65,7 +65,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
|
|||||||
return ARGP_ERR_UNKNOWN;
|
return ARGP_ERR_UNKNOWN;
|
||||||
else
|
else
|
||||||
checkConfigPort = false;
|
checkConfigPort = false;
|
||||||
printf("Using config file %d\n", TCPPort);
|
printf("Using config file %d\n", TCPPort);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
configPath = arg;
|
configPath = arg;
|
||||||
@@ -847,6 +847,7 @@ bool loadConfig(const char *configPath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (yamlConfig["Config"]) {
|
if (yamlConfig["Config"]) {
|
||||||
|
portduino_config.has_config_overrides = true;
|
||||||
if (yamlConfig["Config"]["DisplayMode"]) {
|
if (yamlConfig["Config"]["DisplayMode"]) {
|
||||||
portduino_config.has_configDisplayMode = true;
|
portduino_config.has_configDisplayMode = true;
|
||||||
if ((yamlConfig["Config"]["DisplayMode"]).as<std::string>("") == "TWOCOLOR") {
|
if ((yamlConfig["Config"]["DisplayMode"]).as<std::string>("") == "TWOCOLOR") {
|
||||||
@@ -859,6 +860,13 @@ bool loadConfig(const char *configPath)
|
|||||||
portduino_config.configDisplayMode = meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT;
|
portduino_config.configDisplayMode = meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (yamlConfig["Config"]["StatusMessage"]) {
|
||||||
|
portduino_config.has_statusMessage = true;
|
||||||
|
portduino_config.statusMessage = (yamlConfig["Config"]["StatusMessage"]).as<std::string>("");
|
||||||
|
}
|
||||||
|
if ((yamlConfig["Config"]["EnableUDP"]).as<bool>(false)) {
|
||||||
|
portduino_config.enable_UDP = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yamlConfig["General"]) {
|
if (yamlConfig["General"]) {
|
||||||
@@ -874,10 +882,8 @@ bool loadConfig(const char *configPath)
|
|||||||
}
|
}
|
||||||
if (checkConfigPort) {
|
if (checkConfigPort) {
|
||||||
portduino_config.api_port = (yamlConfig["General"]["APIPort"]).as<int>(-1);
|
portduino_config.api_port = (yamlConfig["General"]["APIPort"]).as<int>(-1);
|
||||||
if (portduino_config.api_port != -1 &&
|
if (portduino_config.api_port != -1 && portduino_config.api_port > 1023 && portduino_config.api_port < 65536) {
|
||||||
portduino_config.api_port > 1023 &&
|
TCPPort = (portduino_config.api_port);
|
||||||
portduino_config.api_port < 65536) {
|
|
||||||
TCPPort = (portduino_config.api_port);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
portduino_config.mac_address = (yamlConfig["General"]["MACAddress"]).as<std::string>("");
|
portduino_config.mac_address = (yamlConfig["General"]["MACAddress"]).as<std::string>("");
|
||||||
|
|||||||
@@ -168,8 +168,12 @@ extern struct portduino_config_struct {
|
|||||||
int hostMetrics_channel = 0;
|
int hostMetrics_channel = 0;
|
||||||
|
|
||||||
// config
|
// config
|
||||||
|
bool has_config_overrides = false;
|
||||||
int configDisplayMode = 0;
|
int configDisplayMode = 0;
|
||||||
bool has_configDisplayMode = false;
|
bool has_configDisplayMode = false;
|
||||||
|
std::string statusMessage = "";
|
||||||
|
bool has_statusMessage = false;
|
||||||
|
bool enable_UDP = false;
|
||||||
|
|
||||||
// General
|
// General
|
||||||
std::string mac_address = "";
|
std::string mac_address = "";
|
||||||
@@ -485,21 +489,30 @@ extern struct portduino_config_struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// config
|
// config
|
||||||
if (has_configDisplayMode) {
|
if (has_config_overrides) {
|
||||||
out << YAML::Key << "Config" << YAML::Value << YAML::BeginMap;
|
out << YAML::Key << "Config" << YAML::Value << YAML::BeginMap;
|
||||||
switch (configDisplayMode) {
|
if (has_configDisplayMode) {
|
||||||
case meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR:
|
|
||||||
out << YAML::Key << "DisplayMode" << YAML::Value << "TWOCOLOR";
|
switch (configDisplayMode) {
|
||||||
break;
|
case meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR:
|
||||||
case meshtastic_Config_DisplayConfig_DisplayMode_INVERTED:
|
out << YAML::Key << "DisplayMode" << YAML::Value << "TWOCOLOR";
|
||||||
out << YAML::Key << "DisplayMode" << YAML::Value << "INVERTED";
|
break;
|
||||||
break;
|
case meshtastic_Config_DisplayConfig_DisplayMode_INVERTED:
|
||||||
case meshtastic_Config_DisplayConfig_DisplayMode_COLOR:
|
out << YAML::Key << "DisplayMode" << YAML::Value << "INVERTED";
|
||||||
out << YAML::Key << "DisplayMode" << YAML::Value << "COLOR";
|
break;
|
||||||
break;
|
case meshtastic_Config_DisplayConfig_DisplayMode_COLOR:
|
||||||
case meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT:
|
out << YAML::Key << "DisplayMode" << YAML::Value << "COLOR";
|
||||||
out << YAML::Key << "DisplayMode" << YAML::Value << "DEFAULT";
|
break;
|
||||||
break;
|
case meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT:
|
||||||
|
out << YAML::Key << "DisplayMode" << YAML::Value << "DEFAULT";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (has_statusMessage) {
|
||||||
|
out << YAML::Key << "StatusMessage" << YAML::Value << statusMessage;
|
||||||
|
}
|
||||||
|
if (enable_UDP) {
|
||||||
|
out << YAML::Key << "EnableUDP" << YAML::Value << true;
|
||||||
}
|
}
|
||||||
|
|
||||||
out << YAML::EndMap; // Config
|
out << YAML::EndMap; // Config
|
||||||
|
|||||||
@@ -7,3 +7,22 @@ custom_esp32_kind = esp32
|
|||||||
build_flags =
|
build_flags =
|
||||||
${esp32_common.build_flags}
|
${esp32_common.build_flags}
|
||||||
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
||||||
|
; Override lib_deps to use environmental_extra_no_bsec instead of environmental_extra
|
||||||
|
; BSEC library uses ~3.5KB DRAM which causes overflow on original ESP32 targets
|
||||||
|
lib_deps =
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
${networking_base.lib_deps}
|
||||||
|
${networking_extra.lib_deps}
|
||||||
|
${environmental_base.lib_deps}
|
||||||
|
${environmental_extra_no_bsec.lib_deps}
|
||||||
|
${radiolib_base.lib_deps}
|
||||||
|
# renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master
|
||||||
|
https://github.com/meshtastic/esp32_https_server/archive/3223704846752e6d545139204837bdb2a55459ca.zip
|
||||||
|
# renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino
|
||||||
|
h2zero/NimBLE-Arduino@^1.4.3
|
||||||
|
# renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master
|
||||||
|
https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip
|
||||||
|
# renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib
|
||||||
|
https://github.com/lewisxhe/XPowersLib/archive/v0.3.2.zip
|
||||||
|
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
||||||
|
rweather/Crypto@0.4.0
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#ifndef Pins_Arduino_h
|
|
||||||
#define Pins_Arduino_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#define USB_VID 0x303a
|
|
||||||
#define USB_PID 0x1001
|
|
||||||
|
|
||||||
// The default Wire will be mapped to PMU and RTC
|
|
||||||
static const uint8_t SDA = 18;
|
|
||||||
static const uint8_t SCL = 9;
|
|
||||||
|
|
||||||
// Default SPI will be mapped to Radio
|
|
||||||
static const uint8_t SS = -1;
|
|
||||||
static const uint8_t MOSI = 17;
|
|
||||||
static const uint8_t MISO = 6;
|
|
||||||
static const uint8_t SCK = 8;
|
|
||||||
|
|
||||||
#define SPI_MOSI (39)
|
|
||||||
#define SPI_SCK (41)
|
|
||||||
#define SPI_MISO (38)
|
|
||||||
#define SPI_CS (40)
|
|
||||||
|
|
||||||
#define SDCARD_CS SPI_CS
|
|
||||||
|
|
||||||
#endif /* Pins_Arduino_h */
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
[env:mini-epaper-s3]
|
|
||||||
;custom_meshtastic_hw_model =
|
|
||||||
custom_meshtastic_hw_model_slug = MINI_EPAPER_S3
|
|
||||||
custom_meshtastic_architecture = esp32-s3
|
|
||||||
custom_meshtastic_actively_supported = true
|
|
||||||
custom_meshtastic_support_level = 1
|
|
||||||
custom_meshtastic_display_name = LILYGO Mini ePaper S3 E-Ink
|
|
||||||
custom_meshtastic_images = mini-epaper-s3.svg
|
|
||||||
custom_meshtastic_tags = LilyGo
|
|
||||||
custom_meshtastic_requires_dfu = no
|
|
||||||
|
|
||||||
extends = esp32s3_base
|
|
||||||
board = mini-epaper-s3
|
|
||||||
board_check = true
|
|
||||||
upload_protocol = esptool
|
|
||||||
|
|
||||||
build_flags =
|
|
||||||
${esp32s3_base.build_flags}
|
|
||||||
-I variants/esp32s3/mini-epaper-s3
|
|
||||||
-DMINI_EPAPER_S3
|
|
||||||
-DPRIVATE_HW ; TODO
|
|
||||||
-DUSE_EINK
|
|
||||||
-DEINK_DISPLAY_MODEL=GxEPD2_102
|
|
||||||
-DEINK_WIDTH=80
|
|
||||||
-DEINK_HEIGHT=128
|
|
||||||
; -DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
|
||||||
; -DEINK_LIMIT_FASTREFRESH=0 ; How many consecutive fast-refreshes are permitted //20
|
|
||||||
; -DEINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates //30
|
|
||||||
; -DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates
|
|
||||||
; -DEINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear
|
|
||||||
; -DEINK_LIMIT_GHOSTING_PX=1500 ; (Optional) How much image ghosting is tolerated
|
|
||||||
; -DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${esp32s3_base.lib_deps}
|
|
||||||
# renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2
|
|
||||||
zinggjm/GxEPD2@1.6.5
|
|
||||||
;# renovate: datasource=git-refs depName=meshtastic-GxEPD2 packageName=https://github.com/meshtastic/GxEPD2 gitBranch=master
|
|
||||||
;https://github.com/meshtastic/GxEPD2/archive/a05c11c02862624266b61599b0d6ba93e33c6f24.zip
|
|
||||||
# renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib
|
|
||||||
lewisxhe/SensorLib@0.3.3
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
// Display (E-Ink)
|
|
||||||
|
|
||||||
#define PIN_EINK_CS 13
|
|
||||||
#define PIN_EINK_BUSY 10
|
|
||||||
#define PIN_EINK_RES 11
|
|
||||||
#define PIN_EINK_SCLK 14
|
|
||||||
#define PIN_EINK_MOSI 15
|
|
||||||
#define PIN_EINK_DC 12
|
|
||||||
#define PIN_EINK_EN 42
|
|
||||||
|
|
||||||
#define SPI_INTERFACES_COUNT 2
|
|
||||||
#define PIN_SPI1_MISO -1
|
|
||||||
#define PIN_SPI1_MOSI PIN_EINK_MOSI
|
|
||||||
#define PIN_SPI1_SCK PIN_EINK_SCLK
|
|
||||||
|
|
||||||
#define I2C_SDA SDA
|
|
||||||
#define I2C_SCL SCL
|
|
||||||
|
|
||||||
#define BATTERY_PIN 2 // A battery voltage measurement pin, voltage divider connected here to
|
|
||||||
// measure battery voltage ratio of voltage divider = 2.0 (assumption)
|
|
||||||
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
|
|
||||||
#define ADC_CHANNEL ADC1_GPIO2_CHANNEL
|
|
||||||
|
|
||||||
#define HAS_GPS 0
|
|
||||||
#undef GPS_RX_PIN
|
|
||||||
#undef GPS_TX_PIN
|
|
||||||
|
|
||||||
#define BUTTON_PIN 3
|
|
||||||
#define BUTTON_NEED_PULLUP
|
|
||||||
#define ALT_BUTTON_PIN 4
|
|
||||||
#define ALT_BUTTON_ACTIVE_LOW true
|
|
||||||
#define ALT_BUTTON_ACTIVE_PULLUP true
|
|
||||||
#define PIN_BUTTON3 0
|
|
||||||
|
|
||||||
// #define HAS_SDCARD 1
|
|
||||||
// #define SDCARD_USE_SOFT_SPI
|
|
||||||
|
|
||||||
// PCF85063 RTC Module
|
|
||||||
#define PCF85063_RTC 0x51
|
|
||||||
#define HAS_RTC 1
|
|
||||||
|
|
||||||
#define USE_SX1262
|
|
||||||
#define LORA_DIO1 5
|
|
||||||
#define LORA_SCK 8
|
|
||||||
#define LORA_MISO 6
|
|
||||||
#define LORA_MOSI 17
|
|
||||||
#define LORA_CS 7 // CS not connected; IO7 is free
|
|
||||||
#define LORA_RESET 21
|
|
||||||
|
|
||||||
#ifdef USE_SX1262
|
|
||||||
#define SX126X_CS LORA_CS
|
|
||||||
#define SX126X_DIO1 5
|
|
||||||
#define SX126X_BUSY 16
|
|
||||||
#define SX126X_RESET LORA_RESET
|
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
|
||||||
#endif
|
|
||||||
21
variants/stm32/russell/platformio.ini
Normal file
21
variants/stm32/russell/platformio.ini
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
; Russell is a board designed to mount on an ER34615/IFR32700 cell and go Up! on a balloon
|
||||||
|
; Hardware repository: https://github.com/Meshtastic-Malaysia/russell
|
||||||
|
; - RAK3172 STM32WLE5CCU6 MCU + integrated SX1262 LoRa
|
||||||
|
; - CDtop CD-PA1010D GPS
|
||||||
|
; - Bosch Sensortec BME280 sensor
|
||||||
|
; - Consonance CN3158 LiFePO4 solar charger
|
||||||
|
[env:russell]
|
||||||
|
extends = stm32_base
|
||||||
|
board = wiscore_rak3172
|
||||||
|
board_level = extra
|
||||||
|
board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem
|
||||||
|
build_flags =
|
||||||
|
${stm32_base.build_flags}
|
||||||
|
-Ivariants/stm32/russell
|
||||||
|
-DPRIVATE_HW
|
||||||
|
lib_deps =
|
||||||
|
${stm32_base.lib_deps}
|
||||||
|
# renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library
|
||||||
|
adafruit/Adafruit BME280 Library@2.3.0
|
||||||
|
|
||||||
|
upload_port = stlink
|
||||||
7
variants/stm32/russell/rfswitch.h
Normal file
7
variants/stm32/russell/rfswitch.h
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
// Pins from https://forum.rakwireless.com/t/rak3172-internal-schematic/4557/2
|
||||||
|
// PB8, PC13
|
||||||
|
|
||||||
|
static const RADIOLIB_PIN_TYPE rfswitch_pins[5] = {PB8, PC13, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
||||||
|
|
||||||
|
static const Module::RfSwitchMode_t rfswitch_table[4] = {
|
||||||
|
{STM32WLx::MODE_IDLE, {LOW, LOW}}, {STM32WLx::MODE_RX, {HIGH, LOW}}, {STM32WLx::MODE_TX_HP, {LOW, HIGH}}, END_OF_MODE_TABLE};
|
||||||
41
variants/stm32/russell/variant.h
Normal file
41
variants/stm32/russell/variant.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef _VARIANT_RUSSELL_
|
||||||
|
#define _VARIANT_RUSSELL_
|
||||||
|
|
||||||
|
#define USE_STM32WLx
|
||||||
|
|
||||||
|
// I/O
|
||||||
|
#define LED_PIN PA0 // Red LED
|
||||||
|
#define LED_STATE_ON 1
|
||||||
|
#define BUTTON_PIN PH3 // Shared with BOOT0
|
||||||
|
#define BUTTON_NEED_PULLUP
|
||||||
|
// Charger IC charge/standby pins are open-drain with no hardware pull-up:
|
||||||
|
// Internal pull-up is needed on STM32 (TODO)
|
||||||
|
// #define EXT_CHRG_DETECT PA5
|
||||||
|
// #define EXT_PWR_DETECT PA4
|
||||||
|
|
||||||
|
// Bosch Sensortec BME280
|
||||||
|
#define HAS_SENSOR 1
|
||||||
|
|
||||||
|
// CDtop CD-PA1010D
|
||||||
|
#define ENABLE_HWSERIAL1
|
||||||
|
#define PIN_SERIAL1_RX PB7
|
||||||
|
#define PIN_SERIAL1_TX PB6
|
||||||
|
#define HAS_GPS 1
|
||||||
|
#define PIN_GPS_STANDBY PA15
|
||||||
|
#define GPS_RX_PIN PB7
|
||||||
|
#define GPS_TX_PIN PB6
|
||||||
|
|
||||||
|
// LoRa
|
||||||
|
/*
|
||||||
|
* RAK3172 (-20–85°C) -> No TCXO
|
||||||
|
* RAK3172-T (-40–85°C) -> 3.0V TCXO
|
||||||
|
* https://github.com/RAKWireless/RAK-STM32-RUI/blob/e5a28be8fab1a492bd9223dd425ca33a8a297d90/variants/WisDuo_RAK3172-T_Board/radio_conf.h#L91
|
||||||
|
*/
|
||||||
|
#define TCXO_OPTIONAL
|
||||||
|
#define SX126X_DIO3_TCXO_VOLTAGE 3.0
|
||||||
|
|
||||||
|
// Required to avoid Serial1 conflicts due to board definition here:
|
||||||
|
// https://github.com/stm32duino/Arduino_Core_STM32/blob/main/variants/STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U/variant_RAK3172_MODULE.h
|
||||||
|
#define RAK3172
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user