Camera issue "Camera Disconnected"

Hello All,
First of all thank you for the hard work involved in creating such a good project.
My issue is this: My camera module is installed v2 pi cam installed on a pi4
I was successfully able to detect the camera and take a snap and vid via terminal.
However when I execute the OpenFlexure eV program, where the camera stream should be it says camera disconnected and the time. I know the camera is functional. Any help would be great to get me past this hurtle.
Thanks again
T

I suspect we are reporting the same issue (mine is Exception loading builtin extension lens shading calibration)

I think if you reflash the sd card with the openflexure image and don’t install the raspberry pi update that you are prompted for, it will work (it did for me). Now after running updates, I have the same problem and ofm log shows an error message.

Thanks for the suggestion. I did as you described and still the same issue. I am still able to capture an image through terminal but The OpenFlexure program still has black screed and says “Camera Disconnected” with date and time. Also the led does not light up. I assume it is supposed to when the program is activated after watching some youtube videos.
Any additional suggestions would be appreciated.


T

Some help would be appreciated. I got the LED issue ironed out that was me. However, I still have the camera disconnected message.
I have this awesome microscope all completed and can’t use it.

@1Robomaker as no-one else has replied, it sounds as though it is not something others have seen. A last resort would be to replace the camera cable. At least re-seat it if you have no other cable. I gather that there are different data transfer methods with different camera modes, so the fact that you can see an image through the terminal may not be enough to say that everything is physically connected well.

I have found a python script to stream the video from the Camera. So I can atleast verify that it works. But I would love to get the Flexure program working.
Thank you for the reply.
T

1 Like

Hi @1Robomaker

I had a very similar issue once. I could get the picamera working externally but not in eV. I remember giving Joel a lot of flack about it but it turned out to be the cable. My understanding is something along the lines of:

The cable supports multiple streams for the camera. Raspivid uses only one of them, eV uses different ones for different modes so that it can do fancy things that @jc2450 can tell you about. If some of the lines on the cable are bad then this can mean that the Raspivid stream works, but the one eV uses for the live preview does not.

@jc2450 Can you explain this issue with less hand wavyness and we can put it in the microscope handbook under troubleshooting?

Thank you for the reply. Sounds interesting. For the time being I found a stand alone python script that allows me to stream video and atleast try it to some degree. I would love to get the program working though.
I will buy a new cable if it is the common consensus that this is the issue. However new and out of the box I doubt it. Any additional info is appreciated.
T

@jc2450 knows the video streaming stuff better than I do, but I’m pretty sure the “multiple streams” thing only applies inside the GPU - the data that passes down the ribbon cable is raw pixel data, the multiple streams happen after it’s been decoded in the MMAL drivers. I have a couple of students building microscopes at the moment and one of them has exactly the same issue as you, and it also seems to work from raspistill - so I suspect it’s more likely the latest SD card image has gone wrong.

I’m hoping to do a remote debugging session with him tomorrow, and I’ll post here to let you know what we discover!

Thank you very much!
I appreciate the info.
T

Yeah this is starting to smell like a software issue. I can’t reproduce on my Pi though which is concerning.

@JohemianKnapsody what’s the last SD image you ran the test script on? I thought we’d tested the latest one.

@jc2450 My last test was on July 22nd, I was happy that was stable and I’ve been using both PyClient and eV on that build ever since without issue

Ok if you get chance could you run the test suite on https://build.openflexure.org/raspbian-openflexure/2020-07-24-raspbian-openflexure-buster-full.zip ?

We might be able to figure out what changed between the two builds if you can reproduce the error.

When I flashed that image, the microscope didn’t show up in Connect at all. It passed all tests from my iPy SD checker and I could SSH in to check the images were there. After running the SD checks, the microscope then showed up in Connect. From then, I could control and capture from eV as normal.

As far as I can see, it’s possible (but obviously not ideal) that finding the microscope and running a move, scan, autofocus and capture in the PyClient is a temporary fix?

I couldn’t replicate connecting to the microscope without the camera working, but it’s possible that if I’d connected through PyClient, then connected through eV without using the camera, it may have lead to the OP’s issue

That sounds to me like Connect was just having a moment. There’s an issue where if you open Connect before powering on and connecting the microscope, it may not discover it automatically. Reloading Connect restarts the discovery.

Improving that is on the todo list. But yeah I think that’s unrelated.

See above reply. I think the issue you had was unrelated and on the Connect side of things. If the py client found the microscope and everything worked then the server must have loaded and that includes the camera.

Curious…

I’ve just flashed the new image again fresh, and no amount of waiting or restarting the microscope/connect/force reload made the microscope show in connect through ethernet until I ran

microscope = openflexure_microscope_client.find_first_microscope()

from PyClient. I haven’t ran anything else in PyClient yet, and I’ve managed to replicate the original issue that way
image

Running microscope.capture_image() returns a 500 server error. Capturing and saving an image on the SD through the PyClient goes through, but saves a black image.

Running any extension through return self.extensions["*key name here*"] gives a key error.

This is the exact issue that I have. Same screen.
T