Skip to content

u44e/cardputerzero-rest-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RestCheck — CardputerZero REST API verification tool

A pocket REST API checker for the M5CardputerZero (AArch64 Linux / Raspberry Pi CM0, LVGL 9.5, 320×170). Keep a list of saved requests, fire any one with a keypress, or run them all at once for a PASS/FAIL health-check — then read the status, latency and a pretty-printed JSON body on the device.

Built the same way as u44e/cardputerzero-ssh-term: an LVGL dlopen app (app_main/app_event ABI, host owns LVGL) with a docker arm64 .deb build for the AppStore.

Features

Feature Status
Saved requests (name / method / URL / headers / body / expected status)
Ad-hoc send — new request, edit, fire
Methods: GET / POST / PUT / PATCH / DELETE / HEAD
Run All — health-check every request, live PASS/FAIL + latency summary
Response viewer — status + reason, latency (ms), size, headers, pretty JSON
PASS/FAIL vs per-request expected status (else any 2xx)
Per-request TLS-verify skip (self-signed test hosts)
Non-blocking HTTP (worker thread + lv_timer poll; UI stays responsive)
Persistence to /sdcard/restcheck.conf (seeded on first run)
On-device build (fbdev + evdev) + arm64 .deb ✅ builds / ⏳ hardware

Controls

  • List: ↑/↓ select · Enter send · e edit · n new · d delete · a run-all · SIDE = run-all
  • Editor: ↑/↓ field · Enter edit field (Method/TLS toggle with ←/→) · s save · g save+send · ESC back
  • Response / Run-All: ↑/↓ scroll · ESC back

Stack

  • C11, LVGL 9.5 (built-in fonts: Montserrat 12/14 + unscii_8 mono — no freetype).
  • libcurl for HTTP (methods, headers, body, TLS, timeouts, gzip).
  • cJSON (MIT, vendored in third_party/) for JSON pretty-printing.
  • pthread worker for non-blocking requests.

Build & run

Device build + .deb (docker, no hardware needed)

./port/build.sh

Runs an arm64 Debian Bookworm container and:

  1. verify build (off-screen memory display) — proves the app runs on arm64: seeds restcheck.conf, exits cleanly on SIGTERM.
  2. device build (-DPORT_FBDEV: lv_linux_fbdev + lv_evdev).
  3. CPackport/dist/restcheck_<ver>_arm64.deb.

Requires Docker (Apple Silicon runs the arm64 container natively).

Desktop emulator (optional)

EMU_DIR=/path/to/cardputer-zero/emulator ./build-emu.sh --run
EMU_DIR=/path/to/cardputer-zero/emulator ./build-emu.sh --shot   # -> build-emu/shot.bmp

Needs the cardputer-emu tree. Test hooks: AUTO_SCREEN=editor|check, AUTO_SEND=<idx>.

Config format

/sdcard/restcheck.conf (override with $RESTCHECK_CONF), flat key=value. Multi-line headers/body are stored on one line with \n escaped — so complex requests can also be authored directly in the file:

endpoints=1
e0.name=httpbin POST
e0.method=POST
e0.url=https://httpbin.org/post
e0.headers=Content-Type: application/json\nAuthorization: Bearer TOKEN
e0.body={\n  "hello": "cardputer"\n}
e0.expect=200
e0.insecure=0

In the on-device editor, headers/body are edited as a single line; multi-header or multi-line bodies are best authored in the file above.

Scope / notes

  • Not yet verified on physical hardware (CardputerZero ships ~Nov 2026). The evdev Fn/symbol layer and SIDE keycode use standard Linux keycodes pending the device keymap (port/evdev_kbd.c, override -DAPP_SIDE_KEYCODE).
  • Out of scope (v1): OAuth flows, request import/export, HDMI output.

License

MIT. Bundles cJSON (MIT).

About

REST API verification tool for M5CardputerZero — saved requests, run-all health check, ad-hoc send, multi-line editor, pretty-JSON responses. C + LVGL 9.5, arm64 .deb.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages