====== 1 JSON API Basics ======
===== Scope =====
This document describes the HTTP/JSON API exposed by the Pinebox edge computing device. It is intended for developers integrating the Pinebox into industrial automation systems, IoT gateways, or custom HMI applications.
The API provides programmatic access to the following subsystems:
^ Subsystem ^ Coverage in this document ^
| [[pinebox:02-json-api:2_device|Device management]] | Firmware/hardware info, restart, reboot. Network, Wi-Fi, LTE and Node-RED control are partially covered. |
| [[pinebox:02-json-api:3_iolink|IO-Link Ports]] | Port mode and power management, IODD handling, process data read/write, parameter access |
| [[pinebox:02-json-api:4_counter-trigger|Counter / Trigger Engine]] | 8 configurable counters with edge- and threshold-based triggers sourced from IO-Link process data |
| [[pinebox:02-json-api:5_timer|Timer Engine]] | 8 timers for cycle-time and elapsed-time measurement between IO-Link process data events |
| Data Logging | SQLite-based process data recording and export — **not covered here** |
| Oscilloscope | Single-channel triggered capture of IO-Link process data values — **not covered here** |
===== Base URL =====
All endpoints are relative to:
http://:18080
* No authentication is required on the local network.
===== Transport =====
All endpoints communicate over **HTTP** using **JSON** request and response bodies, unless otherwise noted.
Binary transfers (configuration backup, SQLite export, IODD upload, firmware update) use ''application/octet-stream''.
This document does not cover the Pinebox web UI, Node-RED flows, MQTT, or OPC UA interfaces.
===== Common Response Fields =====
Most write/action endpoints wrap their result in a standard error envelope:
{
"error": 0,
"error_string": "no_error",
"error_string_loc": "...",
"error_string_loc_long": "..."
}
* ''error == 0'' indicates success.
* Any non-zero value indicates failure; the ''error_string'' fields provide human-readable and localised descriptions.