diff --git a/HARDWARE.md b/HARDWARE.md new file mode 100644 index 0000000..52784ce --- /dev/null +++ b/HARDWARE.md @@ -0,0 +1,30 @@ + +--- + +# Relay Wiring + +Current architecture uses the onboard relay contacts +as the load switching device. + +Positive-side switching: + + Battery + + | + Fuse + | + Relay COM + | + Relay NO + | + Load + + +Load negative returns directly to the ground bus. + +Relay 1: + + Starlink Mini + +Relay 2: + + Fridge + diff --git a/docs/PARITY_MATRIX.md b/docs/PARITY_MATRIX.md index 37f3a14..5e87066 100644 --- a/docs/PARITY_MATRIX.md +++ b/docs/PARITY_MATRIX.md @@ -79,3 +79,31 @@ Error responses should include: error: "error_code" Status/config responses should preserve the generic data model used by `/status`. + +--- + +# Project Status + +API/UART/USB parity status: + + COMPLETE + +Covered: + + Status + Configuration + Relays + WiFi + BMS + Temperature Sensors + Save Config + Factory Reset + +Future additions must be implemented on: + + USB Serial + UART JSON + HTTP API + +before parity is considered maintained. + diff --git a/docs/TEMP_API.md b/docs/TEMP_API.md new file mode 100644 index 0000000..22eb5d8 --- /dev/null +++ b/docs/TEMP_API.md @@ -0,0 +1,40 @@ +# Temperature API + +## Scan + +POST + + /temps/scan + +Response: + +{ + "type":"temp_scan_response", + "ok":true +} + +## Assign + +POST + + /temps/assign + +Body: + +{ + "id":"temp_1", + "index":1 +} + +## Clear + +POST + + /temps/clear + +Body: + +{ + "id":"temp_1" +} + diff --git a/docs/TEMP_SETUP.md b/docs/TEMP_SETUP.md new file mode 100644 index 0000000..2541d83 --- /dev/null +++ b/docs/TEMP_SETUP.md @@ -0,0 +1,50 @@ +# DS18B20 Temperature Sensor Setup + +## Wiring + +All DS18B20 sensors share a single 1-Wire bus. + +ESP32: + + GPIO4 = DATA + 3.3V = VCC + GND = GND + +Required pullup: + + 4.7k resistor between DATA and 3.3V + +Example: + + 3.3V -----+---------------- Sensor Red + | + 4.7k + | + GPIO4 ----+---------------- Sensor Yellow + + GND ----------------------- Sensor Black + +## Multiple Sensors + +All sensors share the same bus: + + DATA + VCC + GND + +Only one 4.7k pullup resistor is required. + +## Scan + + scan temps + +Example output: + + DS18B20 Sensors Found: + 1) 28:7D:56:25:00:00:00:34 + +## Assign + + assign temp 1 1 + save + diff --git a/docs/testing/http-api-tests.md b/docs/testing/http-api-tests.md new file mode 100644 index 0000000..7a8dd1d --- /dev/null +++ b/docs/testing/http-api-tests.md @@ -0,0 +1,36 @@ +# HTTP API Validation + +## Status + +curl -s http://ESP32_IP/status | jq + +## Relay On + +curl -X POST http://ESP32_IP/relay/set \ +-H "Content-Type: application/json" \ +-d '{"id":"relay_1","state":true}' + +## Relay Off + +curl -X POST http://ESP32_IP/relay/set \ +-H "Content-Type: application/json" \ +-d '{"id":"relay_1","state":false}' + +## Scan Temps + +curl -X POST http://ESP32_IP/temps/scan + +## WiFi Config + +curl -X POST http://ESP32_IP/config/wifi \ +-H "Content-Type: application/json" \ +-d '{ + "networks":[ + { + "ssid":"Starlink", + "password":"PASSWORD", + "priority":1 + } + ] +}' + diff --git a/docs/testing/uart-tests.md b/docs/testing/uart-tests.md new file mode 100644 index 0000000..f8c4c34 --- /dev/null +++ b/docs/testing/uart-tests.md @@ -0,0 +1,26 @@ +# UART Validation + +## Status + +{"type":"status_request"} + +## Relay On + +{"type":"set_relay","id":"relay_1","state":true} + +## Relay Off + +{"type":"set_relay","id":"relay_1","state":false} + +## Scan Temps + +{"type":"scan_temps"} + +## Assign Temp + +{"type":"assign_temp","id":"temp_1","index":1} + +## Clear Temp + +{"type":"clear_temp","id":"temp_1"} +