01 Debugging

Serial log (USB): filter by tag.

- [PCAT]: catalog: manifest load, requests, parse errors, rejected paths, bundles
- [PHTP]: plugin HTTP client, token/config file access ("Manifest file not allowed")
- [PEVT]: events: subscriptions, queueing, delivery
- [WEB]: web endpoints: relay, fetch, plugin-fs, jobs

Browser: the dev tools console shows Plugin render failed: <name> <error> and Plugin load failed: .... The network tab shows every /api/relay call, with the upstream status in the X-Relay-Status header.

Reproduce device requests from a computer. Replace the variables by hand and use curl:

  TOKEN=$(jq -r .token token.json)
  curl -s -H "Authorization: Bearer $TOKEN" "https://api.example.com/books?offset=0&limit=9" | jq '.items[0]'

If jq '<your items path>.0.<your title path>' prints the title, the reader will too.

Check manifests before copying:

  for f in device.json manifest.json; do
    python3 -m json.tool "$f" > /dev/null && echo "$f ok ($(wc -c < "$f") bytes)"
  done

Talk to the device from a terminal:

  R=http://crosspoint.local
  curl -s $R/api/status | jq
  curl -s $R/api/plugins | jq
  curl -s -X POST $R/api/relay -d '{"plugin":"my-plugin","method":"GET","url":"https://httpbin.org/get"}' -D -
Reader file (.txt)