3.2 KiB
REST API
Various information is directly accessible over specific REST calls.
To use it, just append them to the IP, separated with a /, e.g. http://192.168.1.1/json
Note: For more detailed information to the REST handler, have a look to the code in the repository: registered handlers
Control
-
flow_start
Trigger a flow start (if not running)
-
Set Pre Value
Set the Previous Value
/setPreValue?value=1234&numbers=mainwhere1234is the new value andmainthe name of the number to be adjusted. -
GPIO
-
Control a GPIO output
- The
GPIOentrypoint also support parameters:/GPIO?GPIO={PinNumber}&Status=high/GPIO?GPIO={PinNumber}&Status=low
- Example:
/GPIO?GPIO=12&Status=high
- The
-
Read a GPIO input
- The
GPIOentrypoint also support parameters:/GPIO?GPIO={PinNumber}
- Example:
/GPIO?GPIO=12
- The
-
-
ota
-
ota_page.html
Opens the Over-The-Air update html page
-
reboot
Trigger a reboot of the device
Results
-
json
Show result in JSON syntax
- Example:
{ "main": { "value": "521.17108", "raw": "521.17108", "pre": "521.17108", "error": "no error", "rate": "0.023780", "timestamp": "2023-01-13T16:00:42+0100" } }
- Example:
-
value
Show single result values
- The
valueentrypoint also support parameters: http://<IP>/value?all=true&type=valuehttp://<IP>/value?all=true&type=rawhttp://<IP>/value?all=true&type=errorhttp://<IP>/value?all=true&type=prevalue
- The
-
img_tmp/raw.jpg
Capture and show a new raw image
-
img_tmp/alg.jpg
Show last aligned image
-
img_tmp/alg_roi.jpg
Show last aligned image including ROI overlay
Status
-
statusflow
Show the actual step of the flow incl. timestamp
- Example:
Take Image (15:56:34)
- Example:
-
rssi
Show the WIFI signal strength (Unit: dBm)
- Example:
-51
- Example:
-
cpu_temperature
Show the CPU temperature (Unit: °C)
- Example:
38
- Example:
-
sysinfo
Show system infos in JSON syntax
- Example:
[{"firmware": "","buildtime": "2023-01-25 12:41","gitbranch": "HEAD","gittag": "","gitrevision": "af13c68+","html": "Development-Branch: HEAD (Commit: af13c68+)","cputemp": "64","hostname": "WaterMeterTest","IPv4": "192.168.xxx.xxx","freeHeapMem": "2818330"}]
- Example:
-
starttime
Show starttime
- Example:
20230113-154634
- Example:
-
uptime
Show uptime
- Example:
0d 00h 15m 50s
- Example:
Camera
-
lighton
Switch the camera flashlight on
-
lightoff
Switch the camera flashlight off
-
capture
Capture a new image (without flashlight)
-
capture_with_flashlight
Capture a new image with flashlight
-
save
Save a new image to SD card
- The
saveentrypoint also support parameters: http://<IP>/save?filename=test.jpg&delay=1
- The
Logs
-
log
Last part of todays log (last 80 kBytes))
-
logfileact
Full log of today
-
log.html
Opens the log html page
Diagnostics
-
heap
print relevant memory (heap) information- Example:
Heap info: Heap Total: 1888926 | SPI Free: 1827431 | SPI Larg Block: 1802240 | SPI Min Free: 758155 | Int Free: 61495 | Int Larg Block: 55296 | Int Min Free: 36427
- Example: