mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-30 05:32:08 +00:00
feat(stm32): Add Milesight GS301 Bathroom Odor Detector (#9359)
- STM32WLE5CCU6 - NFC (unsupported): NXP NT3H2211W0FTTJ (NTAG I2C plus: NFC Forum T2T with I2C interface, password protection and energy harvesting) - Sensor (unsupported): Analog ADuCM355 (SHTC3 is connected to ADuCM355 and not directly accessible) - Bicolor LED - User button (presently not functional in STM32 variants) The definitions for sensor voltage control are present but commented out to save power, due to lack of sensor support. Powered by 4x 4000mAh RAMWAY ER18505 Li-SOCl2 batteries. Flashing: 1. Power down device (remove batteries) 2. Connect USB-UART to J1 (USART2), pinout is below, do not connect +3V3 pin yet 3. Short BOOT pins next to J1 4. Connect +3V3 pin or insert batteries while BOOT pins are shorted 5. Use STM32CubeProgrammer, connect by UART mode 6. Load firmware .hex and download J1 (USART2); Molex Picoblade (P=1.25mm * 4) 1. +3V3 2. PA3_USART2_RX_J1 3. PA2_USART2_TX_J1 4. GND Signed-off-by: Andrew Yong <me@ndoo.sg> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
21
variants/stm32/milesight_gs301/platformio.ini
Normal file
21
variants/stm32/milesight_gs301/platformio.ini
Normal file
@@ -0,0 +1,21 @@
|
||||
; Milesight GS301 Bathroom Odor Detector
|
||||
; https://www.milesight.com/iot/product/lorawan-sensor/gs301
|
||||
[env:milesight_gs301]
|
||||
extends = stm32_base
|
||||
board = wiscore_rak3172 ; Convenient choice as the same USART is used for programming/debug
|
||||
board_level = extra
|
||||
board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem
|
||||
build_flags =
|
||||
${stm32_base.build_flags}
|
||||
-Ivariants/stm32/milesight_gs301
|
||||
-DPRIVATE_HW
|
||||
-DMESHTASTIC_EXCLUDE_GPS=1
|
||||
-DMESHTASTIC_EXCLUDE_I2C=1 # Analog ADuCM355 (unsupported) so no point building support for I2C in
|
||||
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
||||
-DMESHTASTIC_EXCLUDE_AIR_QUALITY_SENSOR=1
|
||||
build_unflags =
|
||||
-DDEBUG_MUTE # We have space for debug output until sensor support is added
|
||||
lib_deps =
|
||||
${stm32_base.lib_deps}
|
||||
|
||||
upload_port = stlink
|
||||
7
variants/stm32/milesight_gs301/rfswitch.h
Normal file
7
variants/stm32/milesight_gs301/rfswitch.h
Normal file
@@ -0,0 +1,7 @@
|
||||
// Seems to use the same RF switch pins as RAK3172… getting Tx/Rx SNR +11dB with a nearby node
|
||||
// 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/milesight_gs301/variant.h
Normal file
41
variants/stm32/milesight_gs301/variant.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef _VARIANT_MILESIGHT_GS301_
|
||||
#define _VARIANT_MILESIGHT_GS301_
|
||||
|
||||
#define USE_STM32WLx
|
||||
|
||||
// I/O
|
||||
#define LED_STATE_ON 1
|
||||
#define PIN_LED1 PA0 // Green LED
|
||||
#define LED_PIN PIN_LED1
|
||||
#define PIN_LED2 PA0 // Red LED
|
||||
#define USER_LED PIN_LED2
|
||||
#define BUTTON_PIN PC13
|
||||
#define BUTTON_ACTIVE_LOW true
|
||||
#define BUTTON_ACTIVE_PULLUP false
|
||||
#define PIN_BUZZER PA6
|
||||
|
||||
// EC Sense DGM10 Double Gas Module
|
||||
// Analog ADuCM355 (unsupported); SHTC3 is connected to ADuCM355 and not directly accessible
|
||||
#define PIN_WIRE_SDA PB7
|
||||
#define PIN_WIRE_SCL PB8
|
||||
// Commented out to keep sensor powered down due to lack of support
|
||||
/*
|
||||
#define VEXT_ENABLE PB12 // TI TPS61291DRV VSEL - set LOW before ENable for Vout = 3.3V
|
||||
#define VEXT_ON_VALUE LOW
|
||||
#define SENSOR_POWER_CTRL_PIN PB2 // TI TPS61291DRV EN pin
|
||||
#define SENSOR_POWER_ON HIGH
|
||||
#define HAS_SENSOR 1
|
||||
*/
|
||||
|
||||
#define ENABLE_HWSERIAL1
|
||||
#define PIN_SERIAL1_RX NC
|
||||
#define PIN_SERIAL1_TX PB6
|
||||
|
||||
// LoRa
|
||||
#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