Autofocus issues

Hi,

Here is my Raspbian version,

Raspbian GNU/Linux 10 (buster)

and I use Autofocus.py by Python 3.7.3

At first, the result was great, however after I executed few times(it happened randomly), there is an issue where the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

The only way I found to solve it rebooting my Raspberry Pi.

I had already checked the connection between camera and raspberry Pi and the FPC cable.

Is there any way to solve it?

Thank you.

Hi,

It is due to the i2c busy is busy. The camera and the focus motor will share the i2c bus.

You can try to disable the camera’s auto exposure and auto white balance function and retry it.

What we can do is try our best to do not let the camera occupy the i2c bus.

Let me know if you need more help.

 

 

This works perfectly. Thanks for your reply!

Hi,

Great to hear you have solved your problems.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results, but the focal distance seems to be the same, and I have no idea why this would happen.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

Is there anything I should do but I didn’t?

Thank you so much for your answers.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

AFissue

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

https://imgur.com/VWACMbn

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

https://imgur.com/VWACMbn

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

https://imgur.com/a/YA8jVAy

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Here is another issue I found these days.

According the position where I called time.sleep(), camera preview would get different results.

Although the second way gets better preview, however, the i2c channels fill up and the code returns the error: picamera.exc.
Pi CameraMMAL Error: Failed to enable connection: Out of resources.

And the first way executed perfectly, and the focal distance I got seems to be the same as the second way, and I have no idea why this would happen.

Is there anything I should do but I didn’t?

Thank you so much for helping me.

Hi,

Please attach me your whole code and I will help you test it and reply you as soon as possible.

 

Hi,

Here is my whole code, an error occurs when AF the image about 60-100 times, then the i2c channels filled up.

https://pastebin.com/XkPpAhmq