Trilobot sn3218 problem

I would like to get my bot running. I have a Raspberry Pi 4, 8GB. The pi runs fine.

Trilobot Example: Print Distance

Traceback (most recent call last):
File “/home/jay/Pimoroni/trilobot/examples/./”, line 16, in
tbot = Trilobot()
File “/usr/local/lib/python3.9/dist-packages/trilobot/”, line 134, in init
self.sn3218 = sn3218.SN3218()
File “/usr/local/lib/python3.9/dist-packages/sn3218/”, line 34, in init
File “/usr/local/lib/python3.9/dist-packages/sn3218/”, line 63, in enable_leds
self.i2c.write_i2c_block_data(I2C_ADDRESS, CMD_ENABLE_LEDS, [
OSError: [Errno 121] Remote I/O error
Exception ignored in: <function Trilobot.del at 0xf705b730>
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/trilobot/”, line 155, in del
AttributeError: ‘Trilobot’ object has no attribute ‘sn3218’

The above is the result of trying any of the examples. Except for the name of the example.

I have built the trilobot. I have the latest version Raspberry Pi OS. Here is the result of ‘uname -a’:

Linux telzey 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

Any help will be appreciated.

Try enabling I2C in sudo raspi-config :) It’s under ‘interfacing options’.

I’ve done this. Then rebooted. I’ll take it apart and do my best to debug the I2c.

Thank you.

Hmm, I’d probably check next that there’s a solid physical connection between Trilobot and your Pi header…

Got it. A couple pins in the expansion header got bent. I unbent them with the proper use of force. Then jammed everything together, properly this time. The examples now work, but there is still a problem: After the example is ended, I get the following. It doesn’t harm anything, because it only happens at the end.

Exception ignored in: <function Trilobot.del at 0xf706f9b8>
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/trilobot/”, line 156, in del
AttributeError: module ‘sn3218’ has no attribute ‘disable’