Balboa & Raspberry Pi

Just to be clear, I was actually suggesting that you redownload the Python scripts included with our Raspberry Pi slave library for Arduino if you were not sure whether you had left any of the files changed. Alternatively, if you are familiar with Git, you can use that to check that the Python scripts on the Raspberry Pi are unmodified.

Unfortunately, I’ve been unable to reproduce the issue you are having with a Raspberry Pi Zero. With the default 100 kHz I2C frequency, and with PololuRPiSlave<struct Data,10> slave;, I can run benchmark.py, the original server_balboa.py, and the modified Python script you posted earlier without errors. (I do not have a Raspberry Pi Zero W to test with, but I expect it to work the same, and I am trying to get one to make sure.)

Are you running Raspbian on your Raspberry Pi and has it been updated recently? Could you run this command to double-check the I2C frequency and post the output you get?
sudo cat /sys/kernel/debug/clk/clk_summary|grep i2c

Could you also post the full output you get when you run python3 benchmark.py? (If it fails sometimes, please post the output from both a successful run and a failed run.)

Finally, if you obtained the pololu-rpi-slave-arduino-library software on the Raspberry Pi by cloning the repository with Git, could you run git status and post the output so we can check what files you have modified? (Even better, if you could put a fork of the repository with your changes on GitHub, I can be sure that I’m testing the same code you are.)

Kevin