Hi everyone, I’m stuck with the focus control on this Raspberry Pi camera (SKU B0176) and I can’t figure out what I’m doing wrong.
The camera itself works, I can capture images with it. The problem is I cannot use the focus function over the I2C bus at all, and the camera address never shows up when I run i2cdetect.
First thing we need to understand on a Pi 3B is which I2C buses actually exist, because the camera muxes things around and the numbering is not what people expect.
Can you run these two commands and paste the output?
i2cdetect -l
and the one you already tried:
i2cdetect -y 0
Also, can you confirm the exact detect command you used? I want to make sure we’re scanning the right adapter.
OK, i2cdetect -y 10 does show an address now, so the “can’t see the camera on the I2C bus” part is solved.
But I hit two more things:
The camera only shows itself on the bus if it’s actually powered on. I have to run raspistill -t 0 first, then it appears and only then I can send focus commands. Is that expected?
The Focuser.py example refers to I2C 7. It needs to be modified to work with i2c0 (or rather the correct bus on this setup), otherwise it just errors out for me.
In my opinion the documentation and the example programs should be revised, this is pretty confusing for an end user.
Both observations are correct, and they’re good feedback.
On the power-on point: yes, the focus controller on the camera module is only present on the I2C bus once the sensor/camera has been activated. So raspistill -t 0 (keeps the camera open) makes the device appear so you can then talk to it over I2C. Without that, the address won’t respond.
On Focuser.py: that example hardcodes a bus number (it references I2C 7), so on your setup it has to be changed to match the muxed channel you actually detected. That’s a documentation/example issue rather than a hardware problem.
Could you do one more thing for us? Confirm which bus had the address in the output of i2cdetect -y 10 so we can note whether the change should be to i2c-0 or keep i2c-10 in your case.
The address shows on i2c-10 (the mux channel 1 one), not i2c-0. So in Focuser.py I’m currently adjusting the bus reference so it points at the right adapter.
One last question: are the instructions in B0176_Manual.pdf to command the focus through I2C actually the only ones needed for this board? Or do they need to be integrated with the updated ones? I want to know if I’m missing a step or if the manual is just outdated.
Thanks, that matches what we expected on this mux setup, so to summarize the state of things:
i2c-11 is the physical bcm2835 bus and it’s split through a mux into chan_id 0 → i2c-0 and chan_id 1 → i2c-10.
The focus controller is on the i2c-10 channel, so the correct detect command here is i2cdetect -y 10, not i2cdetect -y 0.
The camera must be powered/activated (e.g. raspistill -t 0) before its address appears on the bus and focus commands can be sent.
Focuser.py references a hardcoded I2C bus (I2C 7), so it has to be edited to point at the correct bus for your configuration.
As for the manual: the B0176 instructions alone aren’t sufficient/current for this muxed numbering, so use the updated B0176R manual: https://www.uctronics.com/download/Amazon/B0176R_Manual.pdf and treat the bus number as i2c-10 in your case. We’ve noted your feedback that the docs and the example programs should be revised to avoid this confusion for other users. If you still can’t get the focus commands through after fixing the bus in the script, post the exact error and we’ll keep digging.