Install
openclaw skills install recamerareCamera (RV1126B) device full-stack Web API reference covering authentication, device management, video/audio/image configuration, recording rules & storage...
openclaw skills install recameraComplete API reference for the reCamera (RV1126B) embedded camera platform. This skill enables agents to correctly construct HTTP requests, handle responses, and follow the interaction protocols required by the device.
All CGI endpoints are prefixed with:
/cgi-bin/entry.cgi/{api_category}/{resource}/{sub_resource}
Exceptions clearly noted per-endpoint (e.g. serial port uses /api/v1/..., file relay uses /storage/relay/...).
Login flow (mandatory for all authenticated operations):
GET /system/key (no auth required)POST /system/login with {sUserName, sPassword} (password RSA-encrypted)iStatus: 0, iAuth: 1), the HTTP response contains a Set-Cookie header like Set-Cookie: token=<jwt_value>; Path=/; .... You MUST capture the token value from this header.Cookie: token=<jwt_value>For curl / shell scripts:
# Login and capture token from Set-Cookie header
RESPONSE=$(curl -s -D - -X POST http://{ip}/cgi-bin/entry.cgi/system/login \
-H "Content-Type: application/json" \
-d '{"sUserName":"admin","sPassword":"<RSA-encrypted>"}')
TOKEN=$(echo "$RESPONSE" | grep -oP 'Set-Cookie:.*token=\K[^;]+')
# ALL subsequent requests must carry the token cookie
curl -s -X GET http://{ip}/cgi-bin/entry.cgi/system/device-info \
-H "Cookie: token=$TOKEN"
For browser automation (browser-use agent):
After navigating to the login page and submitting credentials, the browser automatically stores the token cookie from the Set-Cookie header. However, you should verify the cookie exists by checking document.cookie for a token= entry after login succeeds. All subsequent same-origin XHR/fetch requests will include the cookie automatically (the app uses withCredentials: true).
IMPORTANT: If you receive an HTTP 401 response or a response body with "code": 401, the token has expired or is missing. You must re-login to obtain a fresh token.
When user intent matches one of the following tasks, execute the corresponding workflow directly.
Trigger intent examples: "scan subnet", "find recamera on 192.168.x.0/24", "discover devices in LAN"
Mandatory workflow:
GET http://{ip}/cgi-bin/entry.cgi/system/key (no auth).200, andsPublicKey.reachable_ipsrecamera_ipsnon_recamera_ipsunreachable_or_timeout_ipsDo not treat "TCP port open" alone as reCamera confirmation. /system/key verification is required.
Trigger intent examples: "login device", "call authenticated API", "configure after login"
Mandatory workflow:
GET /system/key to fetch RSA public key.POST /system/login with {sUserName, sPassword} (RSA-encrypted password).iStatus: 0, iAuth: 1), parse Set-Cookie response header and extract token.Cookie: token=<jwt_value>Do not continue authenticated calls without a captured token.
CRITICAL: For any endpoint that supports both GET and POST/PUT:
GET the current full configurationPOST/PUT the complete modified configuration backNever send a partial configuration constructed from scratch. The device expects the full config object and omitted fields may revert to defaults or cause unexpected behavior.
JSON keys use a type-prefix + camelCase convention:
| Prefix | Type | Example |
|---|---|---|
i | Integer | iCpuUsage |
f | Float | fConfidence |
s | String | sSerialNumber |
l | List/Array | lActiveWeekdays |
d | Dict/Object | dNtpConfig |
b | Boolean | bRuleEnabled |
Operation endpoints (POST/PUT/DELETE) return:
{
"code": 0,
"message": "success"
}
code: 0 = success. Non-zero = error (see error code ranges below).
| Range | Module |
|---|---|
10xxx | Device Info |
20xxx | Live Video |
30xxx | Recording & Storage |
40xxx | AI Inference |
50xxx | Terminal & Logs |
| Action | Method | Path | Notes |
|---|---|---|---|
| Get RSA public key | GET | /system/key | No auth. Encrypt passwords with returned key |
| Login | POST | /system/login | Body: {sUserName, sPassword}. IP-based lockout on failures |
| Change password | PUT | /system/password | Body: {sUserName, sOldPassword, sNewPassword} (RSA-encrypted) |
Login response key fields:
iStatus: 0=correct, -1=wrong password, -3=rate limitediAuth: 1=success, 0=fail, 2=must change password| Action | Method | Path |
|---|---|---|
| Device info | GET | /system/device-info |
| Get system time | GET | /system/time |
| Set system time | PUT | /system/time |
| System resources (CPU/NPU/Mem/Storage) | GET | /system/resource-info |
| Get network (LAN) | GET | /network/lan |
| Set network (LAN) | PUT | /network/lan |
| WiFi status | GET | /network/wifi-status |
| WiFi power on/off | POST | /network/wifi-status?power=on|off |
| Scan WiFi list | GET | /network/wifi-list |
| Connected WiFi info | GET | /network/wifi |
| Connect WiFi | POST | /network/wifi |
| Forget WiFi | DELETE | /network/wifi?Ignore={ssid} |
| Get HTTP API settings | GET | /web/setting |
| Set HTTP API settings | POST | /web/setting |
| Get FTP settings | GET | /ftp/setting |
| Set FTP settings | POST | /ftp/setting |
| Get serial port config | GET | /api/v1/device/serial-port |
| Set serial port config | POST | /api/v1/device/serial-port |
| Export device config | GET | /config/export |
| Import device config | POST | /config/upload |
| Reboot | POST | /system/reboot |
| Factory reset (two-phase) | POST | /system/factory-reset |
| Get HTTPS status | GET | /system/secure |
| Set HTTPS | POST | /system/secure |
| Battery status | GET | /system/battery |
| Action | Method | Path |
|---|---|---|
| Get video encode config | GET | /video/{stream_id}/encode |
| Set video encode config | PUT | /video/{stream_id}/encode |
| Get stream push config | GET | /video/{stream_id}/stream |
| Set stream push config | POST | /video/{stream_id}/stream |
| Get OSD config | GET | /osd/cfg |
| Set OSD config | POST | /osd/cfg |
| Get audio encode (stream) | GET | /audio/{id} |
| Set audio encode (stream) | POST | /audio/{id} |
| Get audio encode (storage) | GET | /audio/storage |
| Set audio encode (storage) | POST | /audio/storage |
stream_id: 0=main stream, 1=sub stream
| Action | Method | Path |
|---|---|---|
| Get all ISP params | GET | /image/0 |
| Reset to defaults | POST | /image/0 |
| Switch scene profile | PUT | /image/0/scene |
| Video adjustment (rotation/flip) | PUT | /image/0/video-adjustment |
| Night-to-day params | PUT | /image/0/night-to-day |
| Image adjustment (brightness etc.) | PUT | /image/0/{scene_id}/adjustment |
| Exposure | PUT | /image/0/{scene_id}/exposure |
| Backlight (BLC/HDR/HLC) | PUT | /image/0/{scene_id}/blc |
| White balance | PUT | /image/0/{scene_id}/white-blance |
| Image enhancement (denoise) | PUT | /image/0/{scene_id}/enhancement |
scene_id: 0=general, 1=day, 2=night
ISP Configuration Workflow:
GET /image/0 — fetch all params and determine current scene/profile in usescene_id / iProfile: 0|1|2) based on current mode or user-specified modePUT /image/0/scene with {iProfile: 0|1|2} — enter that profile's live edit mode (5min timeout)PUT /image/0/{scene_id}/{specific}PUT /image/0/scene with {iProfile: -1} to exit edit mode and finalize changesMandatory sequence for image tuning tasks: "select mode -> enter mode edit state -> adjust params -> send save command". Do not skip the final save/commit step.
| Action | Method | Path |
|---|---|---|
| Get/Set global rule config | GET/POST | .../record/rule/config |
| Get/Set schedule rule | GET/POST | .../record/rule/schedule-rule-config |
| Get/Set record rule (triggers) | GET/POST | .../record/rule/record-rule-config |
| Recording system info | GET | .../record/rule/info |
| HTTP rule trigger | POST | .../record/rule/http-rule-activate |
| Get/Set storage config | GET/POST | .../record/storage/config |
| Storage status | GET | .../record/storage/status |
| Storage control | POST | .../record/storage/control |
Trigger types: INFERENCE_SET, TIMER, GPIO, TTY, HTTP
Storage control actions: FORMAT, FREE_UP, EJECT, CONFIG, RELAY, RELAY_STATUS, UNRELAY, REMOVE_FILES_OR_DIRECTORIES
File access requires a relay session:
POST .../record/storage/control with sAction: "RELAY" — returns dRelayStatus.sRelayDirectory (UUID)GET /storage/relay/{uuid}/ — list directories (Nginx autoindex JSON)GET /storage/relay/{uuid}/{path} — download file/path/to/.thumb/video.mp4.thumb.jpg (may not exist, implement fallback)| Action | Method | Path |
|---|---|---|
| List models | GET | /model/list |
| Upload model (resumable) | POST | /model/upload |
| Delete model | DELETE | /model/delete?File-name={name} |
| Get model info | GET | /model/info?File-name={name} |
| Set model info | POST | /model/info?File-name={name} |
| Supported algorithms | GET | /model/algorithm |
| Get inference status | GET | /model/inference?id=0 |
| Configure inference | POST | /model/inference?id=0 |
| Get notification config | GET | /notify/cfg |
| Set notification config | POST | /notify/cfg |
Notification output modes: 0=off, 1=MQTT, 2=HTTP, 3=UART
| Function | URL | Protocol |
|---|---|---|
| Inference results stream | /ws/inference/results | WebSocket |
| Terminal (ttyd + xterm.js) | /ws/system/terminal | WebSocket |
| System logs | /ws/system/logs | WebSocket |
Base URL: https://sensecraft-train-api.seeed.cc (prod) / https://test-sensecraft-train-api.seeed.cc (test)
| Action | Method | Path | Key Params |
|---|---|---|---|
| Create conversion task | POST | /v1/api/create_task | user_id, framework_type=9, device_type=40, file (.onnx) |
| List user models | GET | /v1/api/get_training_records | user_id, framework_type=9, device_type=40, page, size |
| Check task status | GET | /v1/api/train_status | user_id, model_id |
| Download model (v1) | GET | /v1/api/get_model | user_id, model_id — returns binary .rknn |
| Download model (v2) | GET | /v2/api/get_model | user_id, model_id — returns JSON with download_url |
| Delete cloud model | GET | /v1/api/del_model | user_id, model_id |
SenseCraft Auth Flow:
https://sensecraft.seeed.cc/ai/authorize?client_id=seeed_recamera&response_type=token&scop=profile&redirec_url={your_url}user_id: POST https://sensecraft-hmi-api.seeed.cc/api/v1/user/login_token with Authorization: {token} headerConversion polling: 2s interval on /train_status; download only when status === "done"
Two modes: local upload (resumable) and network download.
Network upgrade:
POST /system/firmware-upgrade?upload-type=network with {sReleaseURL} — returns version info + sConfirmTokenPOST /system/firmware-upgrade?upload-type=network with {sConfirmToken} — confirm upgradeGET /system/firmware-upgrade — poll download progressLocal upload (resumable):
POST /system/firmware-upgrade?upload-type=resumable with {iFileSize} — returns File-Id headerPOST /system/firmware-upgrade?id={file_id} with binary chunks (Content-Range headers)POST /system/firmware-upgrade?start={file_id}&md5sum={hash} — finalize uploadPOST /system/factory-reset — returns sConfirmToken (time-limited, ~1-5 min)POST /system/factory-reset with {sConfirmToken} — executes resetcv2.VideoCapture to grab frames from an RTSP stream, the first ~120 frames are stale buffered data. ALWAYS discard at least 120 frames before capturing a usable image (e.g. loop cap.read() 120 times, then take the next frame)"open" at a time in backlight settingsCONFIGURED; relay expires in 300sRegionFilter must be empty[[0,0],[1,0],[1,1],[0,1]])/api/v1/device/serial-port/storage/relay/...GET http://{ip}/cgi-bin/entry.cgi/system/key. This endpoint requires no authentication and returns immediately. A successful response (HTTP 200 with sPublicKey field) confirms the target is a reCamera deviceAPI_REFERENCE.md is intentionally large. Use it on demand instead of reading the whole file by default.
API_REFERENCE.md in full.API_REFERENCE.md only when the user explicitly asks for a full audit/review/export, or when cross-module validation is strictly required.Practical rule: prefer "minimum sufficient context" and keep reads scoped to the exact endpoint(s) being implemented or debugged.