Sometimes a hack is the right solution…

So the remaining problem to be solved was to prevent the duff I2C reads and writes.  These caused completely random configuration failures, and also random sensors outputs.

The problem is simply that the Adafruit I2C SMBus python code would sometimes hit an Exception, I assuming due to timing in hardware.  Certainly it’s not the Python code at fault.  So the obvious solution is to simply retry the I2C read or write if the IOError Exception was hit; simples!  And it seems to have worked.  Yes, the exceptions are still being hit, but are now retried until the exception isn’t hit.  This seems to be infrequently, and only needs this second chance.

So finally, I’ve run out of problems to solve on the ProtoPi setup.  New MPU6050 is deployed, the RPIO PWM is deployed.  Time now to move the hardware and software changes over to the drone!  Reality bites time!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.