Uncategorized

Upgraded Pan-Tilt Platform Kit for Raspberry Pi Camera

TLDR: C code for interfacing with i2c devices bypasses kernel module; Python interface needs it enabled though.

A while ago, Arducam came with a kickstarter campaign for a much better camera than those from Raspberry Pi, with the added bonus of Autofocus! Link.
During the campaign, they were also promoting their Upgraded Camera Pan Tilt Platform for Raspberry Pi, Nvidia Jetson. I decided to take one.

Upgraded Pan-Tilt Platform. The logo and the shiny molded plastic reminds me of Nintendo.

Surely enough, it has a git repo. And here one thing got my attention: the Raspberry Pi example is in C, while the one for Nvidia platforms is in Python.

The C code worked out of the box!

But one thing got my attention. The code is not only not Jetson-specific, its dependencies are not even for single-board-computers, but to much simpler microcontrollers running Circuit Python from Adafruit!

Surely enough, I should just follow the 3 steps above and this should work on the Raspberry out of the box, right? Right?

Well, no.

I kept having this error:

ValueError: No Hardware I2C on (scl,sda)=(3, 2)
Valid I2C ports: ((1, 3, 2), (0, 1, 0), (10, 45, 44))
Seems like i2c is not here.

Installing i2c-tools didn’t help either. I kept running into weird errors, like this:

$ i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

Surely enough, I went to Adafruit’s website about I2C. They ask about enabling i2c support on the kernel.

Which OF COURSE WAS ENABLED, AS I HAVE BEEN RUNNING THE C CODE!

Well, not quite. It was not enabled. Once I enabled it, everything worked out of the box.

Kids, remember to enable i2c on raspi-config! I even submitted a Pull Request on the manufacturer’s git repo, to at least make sure people read this.

Now I need to solve this mess which is Raspberry Pi OS 64 bits with cameras in Python and OpenCV.

Standard