Monitor the XIAO's battery and make the XIAO the production board
The production OBU is now a Seeed XIAO ESP32-C5 (8 MB flash, one native USB-C port) on a LiPo with no protection board. The firmware reads the cell on GPIO6 (divider switched by GPIO26) every 5 s, sends it in STATUS (battery_mv and battery_flags, octets 103-105; decoders accept 103 or >= 106 octets), warns below 3.50 V and deep-sleeps below 3.30 V when no phone is on USB, waking every 5 min to check the cell again. Thresholds are in Kconfig; host test `make battery`. The app shows voltage, a rough percentage and the low/critical state on the ESP32-C5 card and in the top bar. With several bonded micrOBUs (a replaced board stays bonded), the BLE link tries the one that last connected first and moves on to the next after each failure. tools/station_status_watch.py reads STATUS from the native port.
This commit is contained in:
+28
-3
@@ -1142,13 +1142,13 @@ CONFIG_ESPTOOLPY_FLASHFREQ="80m"
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
|
||||
# default:
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
|
||||
# default:
|
||||
@@ -1199,6 +1199,20 @@ CONFIG_MICROBU_TX_LED_GPIO=-1
|
||||
CONFIG_MICROBU_TX_LED_BLINK_MS=100
|
||||
# default:
|
||||
# CONFIG_MICROBU_LED_INVERTED_RX is not set
|
||||
# default:
|
||||
CONFIG_MICROBU_BATTERY_ADC_GPIO=6
|
||||
# default:
|
||||
CONFIG_MICROBU_BATTERY_EN_GPIO=26
|
||||
# default:
|
||||
CONFIG_MICROBU_BATTERY_SCALE_PERMILLE=1000
|
||||
# default:
|
||||
CONFIG_MICROBU_BATTERY_WARN_MV=3500
|
||||
# default:
|
||||
CONFIG_MICROBU_BATTERY_SHUTDOWN_MV=3300
|
||||
# default:
|
||||
CONFIG_MICROBU_BATTERY_RESUME_MV=3600
|
||||
# default:
|
||||
CONFIG_MICROBU_BATTERY_SLEEP_S=300
|
||||
# end of micrOBU firmware
|
||||
|
||||
#
|
||||
@@ -1927,6 +1941,17 @@ CONFIG_BT_LE_DFT_CH39_TX_POWER_LEVEL_DBM_EFF=0
|
||||
CONFIG_EFUSE_MAX_BLK_LEN=256
|
||||
# end of eFuse Bit Manager
|
||||
|
||||
#
|
||||
# ADC and ADC Calibration
|
||||
#
|
||||
# default:
|
||||
# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set
|
||||
# default:
|
||||
# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set
|
||||
# default:
|
||||
# CONFIG_ADC_ENABLE_DEBUG_LOG is not set
|
||||
# end of ADC and ADC Calibration
|
||||
|
||||
#
|
||||
# Wireless Coexistence
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user