mirror of
https://github.com/meshtastic/firmware.git
synced 2026-11-08 15:24:57 -05:00
feat(variants): add seeed-m2100 for the SenseCAP S2100 data logger
This commit is contained in:
1 parent
e45b76355f
commit
eec87f8a6d
4 files changed
+69
No files matched your search
@@ -1497,6 +1497,15 @@ void NodeDB::installDefaultModuleConfig()
|
||||
|
||||
moduleConfig.has_canned_message = true;
|
||||
|
||||
#ifdef SEEED_M2100
|
||||
// Single-purpose data logger: poll the RS485 sensor without any client setup.
|
||||
moduleConfig.serial.enabled = true;
|
||||
moduleConfig.serial.mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MODBUS;
|
||||
moduleConfig.serial.baud = meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_9600;
|
||||
moduleConfig.serial.rxd = PIN_SERIAL2_RX;
|
||||
moduleConfig.serial.txd = PIN_SERIAL2_TX;
|
||||
#endif
|
||||
|
||||
#if USERPREFS_MQTT_ENABLED && !MESHTASTIC_EXCLUDE_MQTT
|
||||
moduleConfig.mqtt.enabled = true;
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
; Seeed SenseCAP S2100 data logger, Meshtastic edition: RS485 Modbus sensor -> telemetry
|
||||
[env:seeed-m2100]
|
||||
extends = stm32_base
|
||||
board = lora_e5_dev_board
|
||||
board_level = extra
|
||||
board_upload.maximum_size = 247808 ; reserve the last 14KB for filesystem (reduced from 20KB in LittleFS.cpp)
|
||||
build_flags =
|
||||
${stm32_base.build_flags}
|
||||
-Ivariants/stm32/seeed_m2100
|
||||
-DPRIVATE_HW
|
||||
-DSERIAL_UART_INSTANCE=1
|
||||
-DPIN_SERIAL_RX=PB7
|
||||
-DPIN_SERIAL_TX=PB6
|
||||
; TODO(S2100 schematic): RS485 UART pins are Wio-E5 dev board placeholders
|
||||
-DENABLE_HWSERIAL2
|
||||
-DPIN_SERIAL2_TX=PA2
|
||||
-DPIN_SERIAL2_RX=PA3
|
||||
-DMESHTASTIC_EXCLUDE_GPS=1
|
||||
-DMESHTASTIC_EXCLUDE_I2C=1
|
||||
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
||||
-DMESHTASTIC_EXCLUDE_AIR_QUALITY_SENSOR=1
|
||||
|
||||
upload_port = stlink
|
||||
@@ -0,0 +1,8 @@
|
||||
/* https://wiki.seeedstudio.com/LoRa-E5_STM32WLE5JC_Module/
|
||||
* Wio-E5 module ONLY transmits through RFO_HP
|
||||
* Receive: PA4=1, PA5=0
|
||||
* Transmit(high output power, SMPS mode): PA4=0, PA5=1 */
|
||||
static const RADIOLIB_PIN_TYPE rfswitch_pins[5] = {PA4, PA5, 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};
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
Seeed SenseCAP S2100 data logger (Wio-E5 module, STM32WLE5JC) running Meshtastic.
|
||||
Polls an RS485 Modbus sensor and sends its readings as telemetry.
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_SEEED_M2100_
|
||||
#define _VARIANT_SEEED_M2100_
|
||||
|
||||
#define USE_STM32WLx
|
||||
|
||||
#define SEEED_M2100
|
||||
|
||||
// TODO(S2100 schematic): placeholders taken from the Wio-E5 dev board, not verified for the S2100.
|
||||
// The RS485 UART (Serial2, PIN_SERIAL2_TX PA2 -> transceiver DI, PIN_SERIAL2_RX PA3 <- RO) is set in
|
||||
// platformio.ini: the STM32 core instantiates Serial2 from build flags and never sees this file.
|
||||
// #define MODBUS_DE_PIN <pin> // driver enable, if the transceiver is not auto-direction
|
||||
// #define MODBUS_PWR_EN_PIN <pin> // switch for the 12 V sensor supply
|
||||
// #define MODBUS_PWR_WARMUP_MS 2000
|
||||
// #define BUTTON_PIN <pin>
|
||||
// #define LED_POWER <pin>
|
||||
|
||||
// Client API tunnel on the RS485 bus, for provisioning without Bluetooth
|
||||
#define MODBUS_API_ADDR 240
|
||||
|
||||
// LoRa
|
||||
// https://github.com/Seeed-Studio/LoRaWan-E5-Node/blob/163c05379b1805dd8f2c061d4557a69985acc953/Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.c#L94
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.7
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user