firmware: migrate cargo controller to LilyGO T-Relay S3

This commit is contained in:
2026-06-29 22:57:02 -06:00
parent 406033bec8
commit 4cbd2165b2
10 changed files with 127 additions and 95 deletions
+27
View File
@@ -239,3 +239,30 @@ Important guardrails:
## M9N GPS Module
The dashboard enclosure will include an M9N GPS module connected to the ESP32-S3 dashboard over UART. It will provide GPS fix status, satellite count, position, speed, and UTC time. Future work will use GPS time/location for automatic timezone and DST handling.
### LilyGO T-Relay-S3 6-relay cargo controller
The cargo ESP now targets the LilyGO T-Relay-S3 6-relay board.
Relay control is handled through the onboard 74HC595 shift register, not direct ESP32 GPIO relay outputs.
| Function | GPIO |
| --- | --- |
| 74HC595 DATA | GPIO7 |
| 74HC595 CLOCK | GPIO5 |
| 74HC595 LATCH | GPIO6 |
| 74HC595 nOE | GPIO4 |
| Firmware ID | LilyGO relay channel | Shift-register output |
| --- | --- | --- |
| relay_1 | CH1 | SR1 |
| relay_2 | CH2 | SR2 |
| relay_3 | CH3 | SR3 |
| relay_4 | CH4 | SR4 |
| relay_5 | CH5 | SR5 |
| relay_6 | CH6 | SR6 |
GPIO4 is reserved for relay output-enable on this board, so the DS18B20 OneWire bus is moved to GPIO14.
Avoid GPIO35-GPIO37 on the LilyGO T-Relay-S3 because they are used by Octal SPI flash.
+2 -2
View File
@@ -157,7 +157,7 @@ Expected output object fields:
Example 2-channel profile:
{
"hardware_profile": "generic_esp32_2ch_relay",
"hardware_profile": "lilygo_t_relay_s3_6ch",
"outputs": [
{"id": 1, "name": "Fridge", "role": "fridge", "hardware_channel": 1},
{"id": 2, "name": "Starlink", "role": "starlink", "hardware_channel": 2}
@@ -190,7 +190,7 @@ The Cargo ESP firmware now exposes relay/output state as an output-count-agnosti
The current active hardware profile remains:
generic_esp32_2ch_relay
lilygo_t_relay_s3_6ch
The API includes:
+1 -1
View File
@@ -270,7 +270,7 @@ The Cargo ESP API now represents relays/outputs as a hardware-profile-aware list
Current active hardware profile:
generic_esp32_2ch_relay
lilygo_t_relay_s3_6ch
Future planned profile:
+10
View File
@@ -213,3 +213,13 @@ Rationale:
- Improves perceived responsiveness without a major communication rewrite.
- Supports future live gauges better than fixed-interval polling.
## LilyGO T-Relay-S3 6-relay migration
- [x] Expand cargo relay model from 2 outputs to 6 outputs.
- [x] Replace direct GPIO relay writes with LilyGO 74HC595 shift-register writes.
- [x] Map relay_1 through relay_6 to CH1 through CH6.
- [x] Move DS18B20 OneWire default from GPIO4 to GPIO14 because GPIO4 is relay nOE.
- [ ] Bench test relay boot behavior with no vehicle loads connected.
- [ ] Confirm CH1-CH6 order with a meter or test lamp before wiring vehicle loads.