Skip to content

Add pretty capture.py & log-replay.py, to make i2c reversing extra awesome - #74

Open
wejn wants to merge 2 commits into
jamesbowman:masterfrom
wejn:master
Open

Add pretty capture.py & log-replay.py, to make i2c reversing extra awesome#74
wejn wants to merge 2 commits into
jamesbowman:masterfrom
wejn:master

Conversation

@wejn

@wejn wejn commented Aug 29, 2026

Copy link
Copy Markdown

I have tweaked the python3/samples/capture.py and added python3/samples/log-replay.py that makes I²C debugging much more pleasant.

Full explanation: https://wejn.org/2026/08/sniffing-i2c-traffic-visually-with-i2cdriver/

A few screenshots, to explain what I mean (with a brief explanation in the title underneath):

better-capture
better capture using capture.py

better-capture
shows NACKs properly

replay
replay allows you to viz log.csv the same way (here write with one ACK, one NACK and STOP missing)

For full explanation, the code is it. But anyway -- acked reads/writes are light+bold. Non-acked reads/writes are dimmer and not-bold. If there's non-ack of the address, the heading is red. If there's STOP missing, the ending bracket is red.

I haven't exhaustively tested it, but works for me, and does what I need.

Also note:

  • Added possibility to spec speed at cmdline
  • Not resetting the bus when starting capture
  • When stdout ain't a tty, the colors are skipped

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