Skip to content

cyberpunkunicorn-os 0.1.4: a reader that takes no commands is woken or named - #18

Merged
hellofrequencylab merged 1 commit into
mainfrom
claude/project-thread-lhkr1c
Oct 21, 2026
Merged

hellofrequencylab merged 1 commit into
mainfrom
claude/project-thread-lhkr1c

Conversation

@hellofrequencylab

Copy link
Copy Markdown
Owner

Daniel's 0.1.3 logs from 2026-10-21 show a stuck reader. The PN532 ACKs its I2C address, and hat.probe says it is live. But every one of the 43 polls in a 30 s placard write ended with "no ack", even right after a fresh power-up.

Each poll took about 700 ms. With fast NACKs a poll takes about 120 ms. At 700 ms, every I2C transfer is running into Wire's 50 ms timeout, so something is holding the bus.

What changed:

  • readerOpen() now asks the chip for its firmware version at 100 kHz and prints the answer on serial ([freq] PN532 firmware ...). That line shows up in the website's device log.
  • If the chip doesn't answer, the firmware ends Wire, runs the 9-clock bus recovery (hatI2CRecover()), starts the chip again and asks once more. If it still doesn't answer, it returns the new CARD_READER_STUCK.
  • waitCard() handles a reader that stops mid-wait. After 4 "no ack" polls in a row it does the same recovery once, then returns CARD_READER_STUCK instead of spinning to the timeout.
  • Over the remote protocol this is reader_stuck. The timeout reply now includes the elapsed ms.
  • The on-device screens say "READER STUCK ... Unplug the board for 10 s, DIP 3 only", and so does the freq CLI.
  • Version bumped to 0.1.4.

Not built locally: this container can't reach the PlatformIO registry (403 on tool-scons). This PR's CI build is the compile check. Not yet run on the board.


Generated by Claude Code

…r named

Daniel's 0.1.3 logs: the PN532 ACKed its I2C address but every one of 43 polls
in 30 s ended 'no ack', about 700 ms each, i.e. every transfer ran into Wire's
timeout, even on a fresh power-up. readerOpen now asks for the firmware version
at 100 kHz and logs the answer; if none comes it frees the bus (9-clock recovery)
and starts the chip again once. A wait that sees 4 'no ack' polls in a row does
the same once, then ends with CARD_READER_STUCK ('reader_stuck' over the remote
protocol) instead of spinning to the timeout. Timeout replies also carry the ms.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Aw32AU4vVqCSEoNA5aP3U
@hellofrequencylab
hellofrequencylab marked this pull request as ready for review October 21, 2026 15:13
@hellofrequencylab
hellofrequencylab merged commit 167515b into main Oct 21, 2026
2 checks passed
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.

2 participants