Skip to content

Add endpoints from upstream and move the detailed docs out of the README - #56

Merged
chiconws merged 6 commits into
devfrom
feature/upstream-endpoints-and-docs
Oct 14, 2026
Merged

chiconws merged 6 commits into
devfrom
feature/upstream-endpoints-and-docs

Conversation

@chiconws

Copy link
Copy Markdown
Collaborator

Summary

Adds the endpoints from sipeed/NanoKVM and sipeed/NanoKVM-Pro that are in a released firmware but were missing from the client, and splits the README into a short landing page plus a docs/ folder.

Changes

  • Autostart scripts (non-Pro 2.3.1): get_autostart_scripts, get_autostart_script, upload_autostart_script and delete_autostart_script. A missing autostart directory, which the firmware reports as code -1, reads as an empty list. Names that are empty, ., .. or contain / raise ValueError before any request.
  • get_time() (Pro 1.2.6) reads the first event of the /vm/time stream and returns an aware UTC datetime.
  • set_frame_detect(enabled) and pause_frame_detect(duration) (non-Pro) control MJPEG frame skipping. The pause holds the request open on the device for its whole duration, so its timeout covers that.
  • set_tls(enabled) (non-Pro 2.2.7) switches the web interface between HTTP and HTTPS.
  • Docs. The README keeps installation, one example and links. Connecting and authentication, the API reference, errors and SSH moved to docs/. The API reference lists every public method with the hardware and firmware it needs, including the ones above.
  • uv.lock is ignored.

Notes

  • The firmware restarts its web server inside the /vm/tls handler, before the answer goes out, so the request always ends in ServerDisconnectedError. set_tls treats that disconnect as success. Every failure before the restart answers with an error code.
  • The new Pro routes (LCD screen-off and display policy, image checksum, update source, manual update) are left out. None of them is in a Pro release yet; the latest is 1.2.15.
  • PicoClaw management (non-Pro 2.4.0) is left out.
  • The requirement tables in docs/api.md follow the decorators on each method. A few methods check versions in their body instead; those have a note under their table.

Behaviour changes

None. All methods are additions.

Testing

408 unit tests pass, 4 of them new. Each endpoint was also run against a device before its commit:

  • NanoKVM PCIe 2.5.2: an autostart script uploaded, read, listed and deleted; frame detection switched off and on, and a 2 s pause returned after 2.1 s; TLS enabled and then disabled through the client, with HTTPS and then HTTP answering again. Frame counts on a static screen did not show a clear difference between detection on and off.
  • NanoKVM Pro 1.2.15: get_time() matched the local clock within a few milliseconds.

@chiconws
chiconws merged commit 55765b9 into dev Oct 14, 2026
2 checks passed
@chiconws
chiconws deleted the feature/upstream-endpoints-and-docs branch October 14, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant