Document UART as primary communication method

This commit is contained in:
root
2026-06-03 01:35:00 -06:00
parent ca36431eed
commit ef3a639a19
5 changed files with 72 additions and 52 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
Pico Dashboard
RS-485
UART over CAT5
ESP32 Controller
@@ -28,7 +28,7 @@ Message Types:
## Failure Handling
If RS-485 is lost:
If UART over CAT5 is lost:
- Dashboard displays warning
- Last known values remain visible
- Relay commands fail safely
+25 -40
View File
@@ -2,18 +2,18 @@
## Overview
The first hardware version will use plain UART over CAT5 between the Pico dashboard and the ESP32 cargo controller.
The first hardware version will use UART over CAT5 between the Pico dashboard and the ESP32 controller.
UART is simpler than RS-485 and should be reliable enough for the short cable run inside the Xterra.
UART is simpler than RS-485 and should be reliable for the short cable run inside the Xterra.
RS-485 remains a fallback if UART proves unreliable.
RS-485 remains a future fallback if testing reveals communication issues.
## Architecture
Pico Dashboard
UART over CAT5
|
| UART over CAT5
|
ESP32 Controller
Backup:
@@ -26,60 +26,45 @@ RS-485 over CAT5
Pico TX -> ESP32 RX
Pico RX <- ESP32 TX
Ground <-> Ground
Ground <-> Ground
## Planned Baud Rate
Initial:
115200 baud
115200
Future testing:
- 57600 baud if noise becomes an issue
- 230400 baud if higher update rates are needed
Future Options:
- 57600
- 230400
## Message Format
Messages will use newline-delimited JSON.
Example request:
Newline-delimited JSON
Request:
{"type":"status_request"}
Example response:
{"type":"status_response","data":{"battery":{"soc":82}}}
Each message ends with a newline character.
Response:
{"type":"status_response"}
## Failure Handling
If no valid response is received within the timeout:
If communication is lost:
- Dashboard shows communication warning
- Dashboard shows warning
- Last known values remain visible
- Relay commands fail safely
- WiFi backup may be attempted if enabled
- WiFi backup may be attempted
## Why UART First
Advantages:
## Advantages
- Fewer parts
- Easier wiring
- Easier debugging
- No direction-control pin
- No transceiver modules required
- Works well over short distances
- Easier wiring
- No transceivers
- No direction control
- Works well for short runs
## Why RS-485 Is Still Available
## Future RS-485 Option
RS-485 may be used later if UART has issues caused by:
- Alternator noise
- Relay switching noise
- Fridge compressor noise
- Inverter noise
- Long cable run
- Ground noise
The software should keep a transport abstraction so UART and RS-485 can be swapped without changing the application protocol.
If vehicle electrical noise causes issues, the transport layer can be switched to RS-485 without changing application logic.
+1 -1
View File
@@ -28,7 +28,7 @@ Pico Dashboard
Pico
RS-485
UART over CAT5
ESP32
+16 -9
View File
@@ -1,23 +1,30 @@
# CAT5 Pinout
## Primary Configuration
UART over CAT5
Pair 1
Blue +5V
Blue/White +5V
Blue +5V
Blue/White +5V
Pair 2
Orange Ground
Orange Ground
Orange/White Ground
Pair 3
Green RS-485 A
Green/White RS-485 B
Green Pico TX -> ESP32 RX
Green/White Pico RX <- ESP32 TX
Pair 4
Brown Ignition Sense
Brown/White Spare
Notes:
## Future RS-485 Conversion
- Use twisted pair for RS-485
- Double conductors for power
- Spare conductor reserved for future use
Pair 3
Green RS-485 A
Green/White RS-485 B
All other conductors remain unchanged.
+28
View File
@@ -0,0 +1,28 @@
# UART CAT5 Pinout
## Pair 1
Blue +5V
Blue/White +5V
## Pair 2
Orange Ground
Orange/White Ground
## Pair 3
Green Pico TX -> ESP32 RX
Green/White Pico RX <- ESP32 TX
## Pair 4
Brown Ignition Sense
Brown/White Spare
## Notes
- Double conductors used for power
- Shared ground required
- Spare conductor reserved for future use
- Pair 3 may later be repurposed for RS-485