Add configurable DS18B20 temperature probe support
This commit is contained in:
+55
@@ -538,3 +538,58 @@ Runtime behavior:
|
||||
AP always remains enabled.
|
||||
STA tries saved networks by priority.
|
||||
If STA disconnects, saved networks are retried every 30 seconds.
|
||||
|
||||
---
|
||||
|
||||
# Temperature Probe Setup API
|
||||
|
||||
## Scan Temperature Sensors
|
||||
|
||||
POST /temps/scan
|
||||
|
||||
Response:
|
||||
|
||||
{
|
||||
"type": "temp_scan_response",
|
||||
"ok": true,
|
||||
"devices": [
|
||||
{
|
||||
"index": 1,
|
||||
"address": "28:AA:BB:CC:DD:EE:FF:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
## Assign Temperature Sensor
|
||||
|
||||
POST /temps/assign
|
||||
|
||||
Request:
|
||||
|
||||
{
|
||||
"id": "temp_1",
|
||||
"index": 1
|
||||
}
|
||||
|
||||
Alternative request:
|
||||
|
||||
{
|
||||
"slot": 1,
|
||||
"index": 1
|
||||
}
|
||||
|
||||
## Clear Temperature Sensor
|
||||
|
||||
POST /temps/clear
|
||||
|
||||
Request:
|
||||
|
||||
{
|
||||
"id": "temp_1"
|
||||
}
|
||||
|
||||
Alternative request:
|
||||
|
||||
{
|
||||
"slot": 1
|
||||
}
|
||||
|
||||
@@ -414,3 +414,41 @@ Attempt STA WiFi connection using saved networks by priority.
|
||||
AP remains available at:
|
||||
|
||||
192.168.4.1
|
||||
|
||||
---
|
||||
|
||||
# Temperature Probe Setup
|
||||
|
||||
## scan temps
|
||||
|
||||
Scans the DS18B20 1-Wire bus and prints detected sensor addresses.
|
||||
|
||||
Example:
|
||||
|
||||
scan temps
|
||||
|
||||
## assign temp <slot> <number>
|
||||
|
||||
Assigns a detected physical sensor to a configured temp slot.
|
||||
|
||||
Example:
|
||||
|
||||
assign temp 1 1
|
||||
assign temp 2 2
|
||||
save
|
||||
|
||||
## clear temp <slot>
|
||||
|
||||
Clears and disables a configured temp slot.
|
||||
|
||||
Example:
|
||||
|
||||
clear temp 1
|
||||
|
||||
Wiring reminder:
|
||||
|
||||
DS18B20 red -> 3.3V
|
||||
DS18B20 black -> GND
|
||||
DS18B20 yellow -> GPIO4
|
||||
|
||||
A single 4.7k resistor is required between 3.3V and GPIO4/data.
|
||||
|
||||
@@ -232,3 +232,37 @@ Preferred response:
|
||||
{"type":"config_wifi","networks":[{"ssid":"Starlink","password":"password","priority":1},{"ssid":"Home WiFi","password":"password","priority":2}]}
|
||||
|
||||
Lower priority numbers are tried first.
|
||||
|
||||
---
|
||||
|
||||
# Temperature Probe Setup
|
||||
|
||||
## Scan Temperature Sensors
|
||||
|
||||
Pico sends:
|
||||
|
||||
{"type":"scan_temps"}
|
||||
|
||||
ESP32 responds:
|
||||
|
||||
{"type":"temp_scan_response","ok":true,"devices":[{"index":1,"address":"28:AA:BB:CC:DD:EE:FF:00"}]}
|
||||
|
||||
## Assign Temperature Sensor
|
||||
|
||||
Pico sends:
|
||||
|
||||
{"type":"assign_temp","id":"temp_1","index":1}
|
||||
|
||||
Alternative:
|
||||
|
||||
{"type":"assign_temp","slot":1,"index":1}
|
||||
|
||||
## Clear Temperature Sensor
|
||||
|
||||
Pico sends:
|
||||
|
||||
{"type":"clear_temp","id":"temp_1"}
|
||||
|
||||
Alternative:
|
||||
|
||||
{"type":"clear_temp","slot":1}
|
||||
|
||||
Reference in New Issue
Block a user