Ooops I think I broke something

I’m just getting my camera setup to work but then I accidentally dropped my ov9281 unit down on the RPi’s GPIOin/out big pinstrip with the tall pins. Something happened and the pi immediately shut down and rebooted.

Now something is not right as I can’t get the camera to work again. When I for example run ‘read_write_sensor_reg’ I get:

Found sensor ov9281 at address 60
Setting the 0x7251 exposure to 0x10…
Can’t open the file
mmal: Failed to fix lens shading, use the default mode!
Read exposure value = 0x0A
Read 0x3502 value = 0xA0
Write 0x7251 exposure register to 0x0F…
Read exposure value = 0x0F

 

and when I run opencvGui which worked before, it start up the program and shows the window with the sliders but not thw camera view window.

Open camera…
Found sensor ov9281 at address 60
Setting the resolution…
Can’t open the file
mmal: Failed to fix lens shading, use the default mode!
Current resolution is (1280, 800)
Reset the focus…
reset_control: Unexpected result.
The camera may not support this control.
Setting one Exposure value
click
NULL pointer access

 

So some things seem to work but others seem broken.

Might this be rescuable or I just have to get a new camera?

 

Cheers

 

(That last output was actually from a slightly modified python script based on one of the example python scripts)

Hi, Have you tested it using arducamstill demo?

 

 

I just tried from my home directory to eliminate permissions issues.

>MIPI_Camera/RPI/arducamstill -t 5000 -m 1 -e jpg -o test.jpg


Open camera…
Found sensor ov9281 at address 60
mode: 0, width: 1280, height: 800, pixelformat: GREY, desc: (null)
mode: 1, width: 1280, height: 720, pixelformat: GREY, desc: (null)
mode: 2, width: 640, height: 400, pixelformat: GREY, desc: (null)
mode: 3, width: 320, height: 200, pixelformat: GREY, desc: (null)
mode: 4, width: 160, height: 100, pixelformat: GREY, desc: (null)
mode: 5, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lans raw8
mode: 6, width: 1280, height: 800, pixelformat: Y10P, desc: Used for ov9281 2lans raw10
mode: 7, width: 2560, height: 800, pixelformat: Y10P, desc: Used for synchronized stereo camera HAT 1280x8002
mode: 8, width: 2560, height: 720, pixelformat: Y10P, desc: Used for synchronized stereo camera HAT 2560x720
2
mode: 9, width: 1280, height: 400, pixelformat: Y10P, desc: Used for synchronized stereo camera HAT 640x4802
mode: 10, width: 640, height: 200, pixelformat: Y10P, desc: Used for synchronized stereo camera HAT 320x200
2
mode: 11, width: 320, height: 100, pixelformat: Y10P, desc: Used for synchronized stereo camera HAT 160x100*2
mode: 12, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 1lane raw8 1280x800 external trigger mode
mode: 13, width: 1280, height: 720, pixelformat: GREY, desc: Used for ov9281 1lane raw8 1280x720 external trigger mode
mode: 14, width: 640, height: 400, pixelformat: GREY, desc: Used for ov9281 1lane raw8 640x400 external trigger mode
mode: 15, width: 320, height: 200, pixelformat: GREY, desc: Used for ov9281 1lane raw8 320x200 external trigger mode
mode: 16, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x800 external trigger mode
mode: 17, width: 1280, height: 800, pixelformat: Y10P, desc: Used for ov9281 2lanes raw10 1280x800 external trigger mode
mode: 18, width: 1280, height: 720, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x720 external trigger mode
mode: 19, width: 640, height: 400, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 640x400 external trigger mode
mode: 20, width: 320, height: 200, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 320x200 external trigger mode
index: 0, CID: 0x00980914, desc: V4L2_CID_HFLIP, min: 0, max: 1, default: 0, current: 0
index: 1, CID: 0x00980915, desc: V4L2_CID_VFLIP, min: 0, max: 1, default: 0, current: 0
index: 2, CID: 0x00980911, desc: V4L2_CID_EXPOSURE, min: 0, max: 65535, default: 681, current: 898
index: 3, CID: 0x00980913, desc: V4L2_CID_GAIN, min: 0, max: 15, default: 1, current: 1
index: 4, CID: 0x00981901, desc: V4L2_CID_ARDUCAM_EXT_TRI, min: 0, max: 1, default: 0, current: 0
len = 8
name= test.jpg
Can’t open the file
mmal: Failed to fix lens shading, use the default mode!
Failed to set focus, the camera may not support this control.
Failed to set focus, the camera may not support this control.
Start preview…
Current mode: 1, width: 1280, height: 720, pixelformat: GREY, desc: (null)
Mono camera does not support automatic white balance.
mmal: Enable JPEG encoder.


No jpg written to home dir or ‘RPI’ dir.

Cheers

 

 

So I suppose it would be great to be able to identify if I fried the camera, or if I fried the Pi. (I don’t have another Pi to test with currently) I could just get another camera but then maybe it turns out that the Pi was broken.

I made these edits to the OpenCV python script loop:

while cv2.waitKey(10) != 27:
frame = camera.capture(encoding = ‘i420’) # sometimes errors returning NULL
if(frame == None):
print(“Capture returned NULL/None”)
print(“click”)
height = int(align_up(fmt[1], 16))
width = int(align_up(fmt[0], 32))
print(“A”)
print(type(frame))
print(frame.as_array.shape()) # no syntax error, but NULL pointer error.
print(“aa”)
image = frame.as_array.reshape(int(height * 1.5), width)
print(“B”)
image = cv2.cvtColor(image, cv2.COLOR_YUV2BGR_I420)
print(“C”)
cv2.imshow(“Arducam”, image)
print(“D”)


This stops at the following line,

print(frame.as_array.shape()) # no syntax error, but NULL pointer error.

‘aa’ never gets printed. And instead I get the error nessage

“NULL pointer access”

 

I don’t want to take up too much time with this but if you’re able to tell by these examples what is broken, I’d love to know.

Cheers

Fred

Hello,

Very sorry to hear that, if still not image data received. It does seems the sensor is defective. Maybe you should replace another new one. Please contact our [email protected] for a new one.

 

Thank you very much for the offer to replace the camera.

This was my fault though and my mistake so I will just order a replacement from RobotShop where I got the first one.

Thank you for your help.

I have now covered the GPIO pins up and will protect the next camera too. Looking at the gpio schematics I think I dropped it on the 5v pin and maybe that’s why.

Cheers
Fred

Hi,

You are welcome. any questions let me know at the first time and I will try my best to help you.