Files
MeshCore/variants/station_g2/platformio.ini
T
mikecarper 3ed1c5a26e Migrate ESP32 native USB roles to bounded hardware CDC
Switch eight S3 board defaults and 78 remaining TinyUSB recipes to hardware Serial/JTAG while preserving UART and other platforms. Restore retained S3 PHY ownership after a TinyUSB OTA restart and prepare KISS queues before enabling the driver.

Add real recipe resolution, Companion/KISS transport sanitizer coverage, and RF lifecycle reset regressions to CI. Native tests pass 1765/1765; SDK, transport, recipe and USB watchdog checks pass. Board and role cross-compilation and physical OTA qualification continue.
2026-10-04 23:36:54 -07:00

407 lines
12 KiB
INI

[Station_G2]
extends = esp32_base
board = station-g2
; MeshCore and the Station G2's source-built dependencies do not throw C++
; exceptions. Removing the otherwise forced exception runtime saves about
; 67 KiB, keeping the complete ordinary repeater inside the deployed 1.25 MiB
; app slot without removing sensors, LoRa OTA, the browser updater, or CLI.
build_unflags =
-fexceptions
; Preserve the original 0x10000/0x150000 dual-OTA layout so app-only updates do
; not require replacing the partition table or erasing an installed G2.
board_build.partitions = default.csv
; The board manifest defaults to QIO, but the Station G2 bootloader
; watchdog-resets before starting the app in that mode. Deployed hardware and
; the working bootloader require DIO.
board_build.flash_mode = dio
build_flags =
${esp32_base.build_flags}
${sensor_base.build_flags}
-fno-exceptions
-I variants/station_g2
-I src/helpers/ui
-D STATION_G2
-D USE_SX1262
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D P_LORA_DIO_1=48
-D P_LORA_NSS=11
-D P_LORA_RESET=21
-D P_LORA_BUSY=47
-D P_LORA_SCLK=12
-D P_LORA_MISO=14
-D P_LORA_MOSI=13
-D LORA_TX_POWER=7 ; configured as 7dbm, because the final output will be ~27dbm (~0.5w) if the PA is enabled.
-D MAX_LORA_TX_POWER=19 ; max output without burning out the PA
; -D P_LORA_TX_LED=35
-D PIN_BOARD_SDA=5
-D PIN_BOARD_SCL=6
-D PIN_USER_BTN=38
-D PIN_GPS_RX=15
-D PIN_GPS_TX=7
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=0 ; Default value when 'radio.rxgain' has not been set. Must be OFF for the Station G2, see:
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
-D DISPLAY_CLASS=SH1106Display
; Keep the browser firmware uploader, but use CLI configuration so ordinary
; G2 roles remain below each legacy 0x140000 (1.25 MiB) application slot.
-D LIGHTWEIGHT_WIFI_OTA=1
-D WEBCONFIG_DISABLED=1
; The ESP32-S3 ROM formatter preserves the normal libc ABI while keeping
; the complete portable LoRa-OTA repeater inside its legacy app slot.
-D PORTABLE_ESP32_ROM_NANO_FORMAT=1
build_src_filter = ${esp32_base.build_src_filter}
+<../variants/station_g2>
+<helpers/sensors>
+<helpers/ui/SH1106Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
lib_deps =
${esp32_base.lib_deps}
${sensor_base.lib_deps}
adafruit/Adafruit SH110X @ ~2.1.13
adafruit/Adafruit GFX Library @ ^1.12.1
[env:Station_G2_repeater]
extends = Station_G2
board_build.partitions = default.csv
build_flags =
${Station_G2.build_flags}
-D ADVERT_NAME='"Station G2 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
build_src_filter = ${Station_G2.build_src_filter}
+<../examples/simple_repeater>
-<helpers/bridges/MQTTBridge.cpp>
-<helpers/MQTTMessageBuilder.cpp>
-<helpers/JWTHelper.cpp>
lib_deps =
${Station_G2.lib_deps}
${esp32_ota.lib_deps}
; [env:Station_G2_repeater_bridge_rs232]
; extends = Station_G2
; build_flags =
; ${Station_G2.build_flags}
; -D ADVERT_NAME='"RS232 Bridge"'
; -D ADVERT_LAT=0.0
; -D ADVERT_LON=0.0
; -D ADMIN_PASSWORD='"password"'
; -D MAX_NEIGHBOURS=50
; -D WITH_RS232_BRIDGE=Serial2
; -D WITH_RS232_BRIDGE_RX=5
; -D WITH_RS232_BRIDGE_TX=6
; -D BRIDGE_DEBUG=1
; ; -D MESH_PACKET_LOGGING=1
; ; -D MESH_DEBUG=1
; build_src_filter = ${Station_G2.build_src_filter}
; +<helpers/bridges/RS232Bridge.cpp>
; +<../examples/simple_repeater>
; lib_deps =
; ${Station_G2.lib_deps}
; ${esp32_ota.lib_deps}
[env:Station_G2_repeater_bridge_espnow]
extends = Station_G2
build_flags =
${Station_G2.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
build_src_filter = ${Station_G2.build_src_filter}
+<helpers/bridges/ESPNowBridge.cpp>
+<../examples/simple_repeater>
lib_deps =
${Station_G2.lib_deps}
${esp32_ota.lib_deps}
[env:Station_G2_logging_repeater]
extends = Station_G2
build_flags =
${Station_G2.build_flags}
-D ADVERT_NAME='"Station G2 Logging 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 SX126X_RX_BOOSTED_GAIN=1
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
; -D MESH_DEBUG=1
build_src_filter = ${Station_G2.build_src_filter}
+<../examples/simple_repeater>
-<helpers/bridges/MQTTBridge.cpp>
-<helpers/MQTTMessageBuilder.cpp>
-<helpers/JWTHelper.cpp>
lib_deps =
${Station_G2.lib_deps}
${esp32_ota.lib_deps}
; [env:Station_G2_logging_repeater_bridge_rs232]
; extends = Station_G2
; build_flags =
; ${Station_G2.build_flags}
; -D ADVERT_NAME='"RS232 Bridge"'
; -D ADVERT_LAT=0.0
; -D ADVERT_LON=0.0
; -D ADMIN_PASSWORD='"password"'
; -D MAX_NEIGHBOURS=50
; -D MESH_PACKET_LOGGING=1
; -D SX126X_RX_BOOSTED_GAIN=1
; -D WITH_RS232_BRIDGE=Serial2
; -D WITH_RS232_BRIDGE_RX=5
; -D WITH_RS232_BRIDGE_TX=6
; -D BRIDGE_DEBUG=1
; ; -D MESH_DEBUG=1
; build_src_filter = ${Station_G2.build_src_filter}
; +<helpers/bridges/RS232Bridge.cpp>
; +<../examples/simple_repeater>
; lib_deps =
; ${Station_G2.lib_deps}
; ${esp32_ota.lib_deps}
[env:Station_G2_logging_repeater_bridge_espnow]
extends = Station_G2
build_flags =
${Station_G2.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 MESH_PACKET_LOGGING=1
-D SX126X_RX_BOOSTED_GAIN=1
-D WITH_ESPNOW_BRIDGE=1
; -D BRIDGE_DEBUG=1
; -D MESH_DEBUG=1
build_src_filter = ${Station_G2.build_src_filter}
+<helpers/bridges/ESPNowBridge.cpp>
+<../examples/simple_repeater>
lib_deps =
${Station_G2.lib_deps}
${esp32_ota.lib_deps}
[env:Station_G2_room_server_observer_mqtt]
extends = Station_G2
board_build.partitions = default_16MB.csv ; standard 16MB partition table
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 =
${Station_G2.build_flags}
; The base observer disables LoRa OTA; build.sh promotes it to FULL and restores OTA.
-UENABLE_OTA
-D DISABLE_LORA_OTA=1
-UMESH_DEBUG
-UMESH_PACKET_LOGGING
-UMQTT_DEBUG
-UMQTT_MEMORY_DEBUG
-D ADVERT_NAME='"Station G2 Room Observer"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
-D WITH_MQTT_BRIDGE=1
-D MAX_NEIGHBOURS=50
-D MQTT_MAX_PACKET_SIZE=1024
; -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 = ${Station_G2.build_src_filter}
+<helpers/bridges/MQTTBridge.cpp>
+<helpers/MQTTMessageBuilder.cpp>
+<helpers/JWTHelper.cpp>
+<helpers/ui/SH1106Display.cpp>
+<helpers/SNMPAgent.cpp>
+<../examples/simple_room_server>
lib_deps =
${Station_G2.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:Station_G2_room_server]
extends = Station_G2
build_src_filter = ${Station_G2.build_src_filter}
+<../examples/simple_room_server>
build_flags =
${Station_G2.build_flags}
-UENABLE_OTA
-D DISABLE_LORA_OTA=1
-D ADVERT_NAME='"Station G2 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 =
${Station_G2.lib_deps}
${esp32_ota.lib_deps}
[env:Station_G2_companion_radio_usb]
extends = Station_G2
build_flags =
${Station_G2.build_flags}
-UENABLE_OTA
-D DISABLE_LORA_OTA=1
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D ENABLE_USB_INTERFACE
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
build_src_filter = ${Station_G2.build_src_filter}
+<helpers/esp32/*.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Station_G2.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:Station_G2_companion_radio_ble]
extends = Station_G2
build_flags =
${Station_G2.build_flags}
-UENABLE_OTA
-D DISABLE_LORA_OTA=1
; BLE plus the optional MLX90614/VL53L0X/BME680 drivers leaves no safe growth
; margin in a legacy slot. Common temperature, pressure, current, and GPS
; sensors remain.
-UENV_INCLUDE_MLX90614
-UENV_INCLUDE_VL53L0X
-UENV_INCLUDE_BME680
; Use the ESP32-S3 ROM formatter so this full BLE companion stays within
; the Station G2 legacy 0x140000 application partition without dropping UI,
; GPS, or any additional external-sensor support.
-D PORTABLE_ESP32_ROM_NANO_FORMAT=1
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D BLE_PIN_CODE=123456
-D OFFLINE_QUEUE_SIZE=512
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${Station_G2.build_src_filter}
+<helpers/esp32/*.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Station_G2.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:Station_G2_companion_radio_wifi]
extends = Station_G2
build_flags =
${Station_G2.build_flags}
-UENABLE_OTA
-D DISABLE_LORA_OTA=1
-I examples/companion_radio/ui-new
-D ENABLE_WIFI_INTERFACE
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D OFFLINE_QUEUE_SIZE=512
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${Station_G2.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/wifi/*.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${Station_G2.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:Station_G2_companion_radio_full]
extends = env:Station_G2_companion_radio_wifi
board_build.flash_mode = ${esp32_s3_full.board_build.flash_mode}
build_unflags =
${Station_G2.build_unflags}
build_flags =
${env:Station_G2_companion_radio_wifi.build_flags}
-D MESHCORE_REQUIRES_COMPANION_RADIO_FULL=1
[env:Station_G2_kiss_modem]
extends = Station_G2
build_flags =
${Station_G2.build_flags}
-UENABLE_OTA
-D DISABLE_LORA_OTA=1
build_src_filter = ${Station_G2.build_src_filter}
+<../examples/kiss_modem/>
[env:Station_G2_repeater_observer_mqtt]
extends = Station_G2
; All native USB roles inherit hardware CDC/JTAG from the board manifest.
board_build.partitions = default_16MB.csv ; standard 16MB partition table
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 =
${Station_G2.build_flags}
; The base observer disables LoRa OTA; build.sh promotes it to FULL and restores OTA.
-UENABLE_OTA
-D DISABLE_LORA_OTA=1
-UMESH_DEBUG
-UMESH_PACKET_LOGGING
-UMQTT_DEBUG
-UMQTT_MEMORY_DEBUG
-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 MESH_PACKET_LOGGING=1
# -D MESH_DEBUG=1
-D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-D ESP32_CPU_FREQ=160
-D WITH_SNMP=1
# -D WIFI_SSID='"ssid"'
# -D WIFI_PWD='"password"'
# -D MQTT_SERVER='"your-mqtt-broker.com"'
# -D MQTT_PORT=1883
# -D MQTT_USERNAME='"your-username"'
# -D MQTT_PASSWORD='"your-password"'
build_src_filter = ${Station_G2.build_src_filter}
+<helpers/bridges/MQTTBridge.cpp>
+<helpers/MQTTMessageBuilder.cpp>
+<helpers/JWTHelper.cpp>
+<helpers/SNMPAgent.cpp>
+<helpers/ui/SH1106Display.cpp>
+<../examples/simple_repeater>
lib_deps =
${Station_G2.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