Files
MeshCore/variants/xiao_s3/platformio.ini
9d52b1fd68 Add saved LED controls across supported boards
Add get leds and set leds on|off for Companion, repeater, room server and
sensor builds. Preserve the setting across reboots and cover GPIO, RGB,
Bluetooth, notification and expander indicators without changing radio
amplifier controls or screen backlights.

RAK Companions blink while advertising and keep the Bluetooth LED off once
connected, including late timer callbacks.

Adapted from meshcore-dev/MeshCore#3605 and #2694.
Validated with host regressions and firmware builds for SenseCAP Solar,
RAK4631, T096, Heltec V4, T-Beam, Xiao S3, Pico W and Wio E5 Mini.

Co-authored-by: R0ck <develop@hectospark.co.uk>
Co-authored-by: Nick Dunklee <nick@dunklee.org>
2026-10-20 08:59:39 -07:00

244 lines
6.3 KiB
INI

[Xiao_S3]
extends = esp32_base
board = seeed_xiao_esp32s3
board_check = true
board_build.mcu = esp32s3
build_flags = ${esp32_base.build_flags}
${sensor_base.build_flags}
-I variants/xiao_s3
-UENV_INCLUDE_GPS
-D SEEED_XIAO_S3
-D PIN_VBAT_READ=1 ; D0
-D P_LORA_DIO_1=2 ; D1
-D P_LORA_NSS=5 ; D4
-D P_LORA_RESET=3 ; D2
-D P_LORA_BUSY=4 ; D3
-D P_LORA_SCLK=7 ; D8
-D P_LORA_MISO=8 ; D0
-D P_LORA_MOSI=9 ; D10
-D PIN_USER_BTN=-1 ; NC
-D PIN_STATUS_LED=21 ; Orange user led, LOW=On
-D LED_STATE_ON=LOW
-D PIN_BOARD_SDA=D6 ; D6=43
-D PIN_BOARD_SCL=D7 ; D7=44
-D SX126X_RXEN=6 ; D5
-D SX126X_TXEN=RADIOLIB_NC
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
-D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/xiao_s3>
+<helpers/sensors>
lib_deps =
${esp32_base.lib_deps}
${sensor_base.lib_deps}
[env:Xiao_S3_repeater]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
+<../examples/simple_repeater/*.cpp>
build_flags =
${Xiao_S3.build_flags}
-D ADVERT_NAME='"Xiao S3 Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_S3.lib_deps}
${esp32_ota.lib_deps}
[env:Xiao_S3_repeater_bridge_espnow]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
+<helpers/bridges/ESPNowBridge.cpp>
+<../examples/simple_repeater/*.cpp>
build_flags =
${Xiao_S3.build_flags}
-D ADVERT_NAME='"ESPNow Bridge"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
-D WITH_ESPNOW_BRIDGE=1
; -D BRIDGE_DEBUG=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_S3.lib_deps}
${esp32_ota.lib_deps}
[env:Xiao_S3_room_server]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
+<../examples/simple_room_server>
build_flags =
${Xiao_S3.build_flags}
-D ADVERT_NAME='"Xiao S3 Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_S3.lib_deps}
${esp32_ota.lib_deps}
[env:Xiao_S3_companion_radio_ble]
extends = Xiao_S3
build_flags =
${Xiao_S3.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D BLE_PIN_CODE=123456
-D DISPLAY_CLASS=SSD1306Display
-D OFFLINE_QUEUE_SIZE=256
-D ENABLE_WIFI_INTERFACE
; -D BLE_DEBUG_LOGGING=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<helpers/esp32/*.cpp>
+<helpers/wifi/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Xiao_S3.lib_deps}
densaugeo/base64 @ ~1.4.0
adafruit/Adafruit SSD1306 @ ^2.5.13
[env:Xiao_S3_companion_radio_ble_ps]
extends = env:Xiao_S3_companion_radio_ble
[env:Xiao_S3_companion_radio_usb]
extends = Xiao_S3
build_flags =
${Xiao_S3.build_flags}
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D DISPLAY_CLASS=SSD1306Display
-D OFFLINE_QUEUE_SIZE=256
-D ENABLE_USB_INTERFACE
; -D BLE_DEBUG_LOGGING=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Xiao_S3.lib_deps}
densaugeo/base64 @ ~1.4.0
adafruit/Adafruit SSD1306 @ ^2.5.13
[env:Xiao_S3_sensor]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
+<../examples/simple_sensor>
build_flags =
${Xiao_S3.build_flags}
-D ADVERT_NAME='"Xiao S3 Sensor"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_S3.lib_deps}
${esp32_ota.lib_deps}
[env:Xiao_S3_kiss_modem]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
+<../examples/kiss_modem/>
[env:Xiao_S3_repeater_observer_mqtt]
extends = Xiao_S3
extra_scripts =
${esp32_base.extra_scripts}
pre:scripts/generate_cert_bundle.py
board_ssl_cert_source = adafruit-full
board_build.embed_files = src/certs/x509_crt_bundle.bin
build_flags =
${Xiao_S3.build_flags}
-D ADVERT_NAME='"MQTT Observer"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
-D WITH_MQTT_BRIDGE=1
-D MQTT_MAX_PACKET_SIZE=1024
-D MQTT_DEBUG=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
-D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-D ESP32_CPU_FREQ=160
-D WITH_SNMP=1
build_src_filter = ${Xiao_S3.build_src_filter}
+<helpers/bridges/MQTTBridge.cpp>
+<helpers/MQTTMessageBuilder.cpp>
+<helpers/JWTHelper.cpp>
+<helpers/SNMPAgent.cpp>
+<../examples/simple_repeater>
lib_deps =
${Xiao_S3.lib_deps}
${esp32_ota.lib_deps}
elims/PsychicMqttClient@^0.2.4
bblanchon/ArduinoJson @ 7.4.3
arduino-libraries/NTPClient
JChristensen/Timezone
paulstoffregen/Time@1.6.1
0neblock/SNMP_Agent
[env:Xiao_S3_room_server_observer_mqtt]
extends = Xiao_S3
extra_scripts =
${esp32_base.extra_scripts}
pre:scripts/generate_cert_bundle.py
board_ssl_cert_source = adafruit-full
board_build.embed_files = src/certs/x509_crt_bundle.bin
build_flags =
${Xiao_S3.build_flags}
-D ADVERT_NAME='"Xiao S3 Room Observer"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
-D MAX_NEIGHBOURS=50
-D WITH_MQTT_BRIDGE=1
-D MQTT_MAX_PACKET_SIZE=1024
-D MQTT_DEBUG=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
-D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-D ESP32_CPU_FREQ=160
-D WITH_SNMP=1
build_src_filter = ${Xiao_S3.build_src_filter}
+<helpers/bridges/MQTTBridge.cpp>
+<helpers/MQTTMessageBuilder.cpp>
+<helpers/JWTHelper.cpp>
+<helpers/SNMPAgent.cpp>
+<../examples/simple_room_server>
lib_deps =
${Xiao_S3.lib_deps}
${esp32_ota.lib_deps}
elims/PsychicMqttClient@^0.2.4
bblanchon/ArduinoJson @ 7.4.3
arduino-libraries/NTPClient
JChristensen/Timezone
paulstoffregen/Time@1.6.1
0neblock/SNMP_Agent