Skip to content

Commit 778d1ad

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents 75b7a7d + 1ae4a53 commit 778d1ad

14 files changed

Lines changed: 200 additions & 42 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@
88
"features": {
99
"ghcr.io/devcontainers/features/python:1": {
1010
"installTools": true,
11-
"version": "3.14"
11+
"version": "3.13"
1212
}
1313
},
1414
"customizations": {
1515
"vscode": {
1616
"extensions": [
1717
"ms-vscode.cpptools",
18-
"platformio.platformio-ide",
18+
"Jason2866.esp-decoder",
19+
"pioarduino.pioarduino-ide",
1920
"Trunk.io"
2021
],
21-
"unwantedRecommendations": ["ms-azuretools.vscode-docker"],
22+
"unwantedRecommendations": [
23+
"ms-azuretools.vscode-docker",
24+
"platformio.platformio-ide"
25+
],
2226
"settings": {
2327
"extensions.ignoreRecommendations": true
2428
}

.trunk/trunk.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ lint:
1111
- checkov@3.2.528
1212
- renovate@43.150.0
1313
- prettier@3.8.3
14-
- trufflehog@3.95.2
14+
- trufflehog@3.95.3
1515
- yamllint@1.38.0
1616
- bandit@1.9.4
1717
- trivy@0.70.0

.vscode/extensions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
// See http://go.microsoft.com/fwlink/?LinkId=827846
3-
// for the documentation about the extensions.json format
42
"recommendations": [
5-
"platformio.platformio-ide"
3+
"Jason2866.esp-decoder",
4+
"pioarduino.pioarduino-ide"
65
],
76
"unwantedRecommendations": [
8-
"ms-vscode.cpptools-extension-pack"
7+
"ms-vscode.cpptools-extension-pack",
8+
"platformio.platformio-ide"
99
]
1010
}

bin/config.d/lora-station-g3.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Station G3 motherboard with a Raspberry Pi Zero 2W as the MCU daughterboard.
2+
# Verify spidev / I2C device paths for your OS — they may differ.
3+
Meta:
4+
name: Station G3
5+
support: community
6+
compatible:
7+
- raspberry-pi
8+
9+
Lora:
10+
Module: sx1262
11+
IRQ: 22 # BCM pin — wiki spec
12+
Reset: 16 # BCM pin — wiki spec
13+
Busy: 24 # BCM pin — wiki spec
14+
# CS: 8 # BCM 8 = SPI0 CE0 (default); uncomment only to override
15+
DIO2_AS_RF_SWITCH: true
16+
DIO3_TCXO_VOLTAGE: true
17+
spidev: spidev0.0
18+
# SX126X_MAX_POWER: 19 # matches Station G2 firmware cap; raise carefully per PA jumper mode

boards/station-g3.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "esp32s3_out.ld",
5+
"memory_type": "qio_opi"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DBOARD_HAS_PSRAM",
10+
"-DARDUINO_USB_CDC_ON_BOOT=1",
11+
"-DARDUINO_USB_MODE=1",
12+
"-DARDUINO_RUNNING_CORE=1",
13+
"-DARDUINO_EVENT_RUNNING_CORE=0"
14+
],
15+
"f_cpu": "240000000L",
16+
"f_flash": "80000000L",
17+
"flash_mode": "qio",
18+
"hwids": [["0x303A", "0x1001"]],
19+
"mcu": "esp32s3",
20+
"variant": "station-g3"
21+
},
22+
"connectivity": ["wifi", "bluetooth", "lora"],
23+
"debug": {
24+
"default_tool": "esp-builtin",
25+
"onboard_tools": ["esp-builtin"],
26+
"openocd_target": "esp32s3.cfg"
27+
},
28+
"frameworks": ["arduino", "espidf"],
29+
"name": "BQ Station G3",
30+
"upload": {
31+
"flash_size": "16MB",
32+
"maximum_ram_size": 327680,
33+
"maximum_size": 16777216,
34+
"use_1200bps_touch": true,
35+
"wait_for_upload_port": true,
36+
"require_upload_port": true,
37+
"speed": 921600
38+
},
39+
"url": "",
40+
"vendor": "BQ Consulting"
41+
}

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ lib_deps =
138138
# renovate: datasource=github-tags depName=Adafruit GFX packageName=adafruit/Adafruit-GFX-Library
139139
https://github.com/adafruit/Adafruit-GFX-Library/archive/refs/tags/1.12.6.zip
140140
# renovate: datasource=github-tags depName=NeoPixel packageName=adafruit/Adafruit_NeoPixel
141-
https://github.com/adafruit/Adafruit_NeoPixel/archive/refs/tags/1.15.4.zip
141+
https://github.com/adafruit/Adafruit_NeoPixel/archive/1.15.5.zip
142142
# renovate: datasource=github-tags depName=Adafruit SSD1306 packageName=adafruit/Adafruit_SSD1306
143143
https://github.com/adafruit/Adafruit_SSD1306/archive/refs/tags/2.5.16.zip
144144
# renovate: datasource=github-tags depName=Adafruit BMP280 packageName=adafruit/Adafruit_BMP280_Library

src/Power.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,16 @@ void Power::readPowerStatus()
904904

905905
// Notify any status instances that are observing us
906906
const PowerStatus powerStatus2 = PowerStatus(hasBattery, usbPowered, isChargingNow, batteryVoltageMv, batteryChargePercent);
907-
if (millis() > lastLogTime + 50 * 1000) {
907+
908+
// Log battery-presence transitions once; skip OptUnknown so we don't lie before the first probe.
909+
static OptionalBool prevHasBattery = OptUnknown;
910+
if (hasBattery != OptUnknown && hasBattery != prevHasBattery) {
911+
LOG_INFO("Power: battery hardware %s", hasBattery == OptTrue ? "detected" : "absent (USB-only)");
912+
prevHasBattery = hasBattery;
913+
}
914+
915+
// Periodic telemetry only emits when a battery is actually present (otherwise values are constant -1/0).
916+
if (hasBattery == OptTrue && !Throttle::isWithinTimespanMs(lastLogTime, 50 * 1000)) {
908917
LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d", powerStatus2.getHasUSB(),
909918
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
910919
lastLogTime = millis();

src/platform/esp32/architecture.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
#define HW_VENDOR meshtastic_HardwareModel_CHATTER_2
159159
#elif defined(STATION_G2)
160160
#define HW_VENDOR meshtastic_HardwareModel_STATION_G2
161+
#elif defined(STATION_G3)
162+
#define HW_VENDOR meshtastic_HardwareModel_STATION_G3
161163
#elif defined(UNPHONE)
162164
#define HW_VENDOR meshtastic_HardwareModel_UNPHONE
163165
#elif defined(WIPHONE)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Shared pin/feature defines for BQ Station G2 and G3.
2+
// Boards differ only in PA output power (SX126X_MAX_POWER) and the wiki URL.
3+
#pragma once
4+
5+
// Station G2/G3 may not have GPS installed, but have a GROVE GPS Socket for an optional GPS module
6+
#define GPS_RX_PIN 7
7+
#define GPS_TX_PIN 15
8+
9+
// 1.3 inch OLED Screen
10+
#define USE_SH1107_128_64
11+
12+
#define I2C_SDA 5
13+
#define I2C_SCL 6
14+
15+
#define BUTTON_PIN 38 // Program button
16+
#define BUTTON_NEED_PULLUP
17+
18+
#define USE_SX1262
19+
20+
#define LORA_MISO 14
21+
#define LORA_SCK 12
22+
#define LORA_MOSI 13
23+
#define LORA_CS 11
24+
25+
#define LORA_RESET 21
26+
#define LORA_DIO1 48
27+
28+
#ifdef USE_SX1262
29+
#define SX126X_CS LORA_CS // Compatibility alias; prefer LORA_CS in board definitions.
30+
#define SX126X_DIO1 LORA_DIO1
31+
#define SX126X_BUSY 47
32+
#define SX126X_RESET LORA_RESET
33+
34+
// DIO2 controls an antenna switch and the TCXO voltage is controlled by DIO3
35+
#define SX126X_DIO2_AS_RF_SWITCH
36+
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
37+
// NOTE: SX126X_MAX_POWER is intentionally NOT defined here — each board sets it.
38+
#endif

variants/esp32s3/station-g2/platformio.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ upload_speed = 921600
2222
build_unflags =
2323
${esp32s3_base.build_unflags}
2424
-DARDUINO_USB_MODE=0
25-
build_flags =
25+
build_flags =
2626
${esp32s3_base.build_flags}
2727
-D STATION_G2
2828
-I variants/esp32s3/station-g2
29+
-I variants/esp32s3/station-common
2930
-DBOARD_HAS_PSRAM
3031
-DSTATION_G2
3132
-DARDUINO_USB_MODE=1

0 commit comments

Comments
 (0)