Hardware: GoPiGo 3, DexterOS v 2.2.0, correctly installed Raspberry Pi camera (tried both supplied cables), small silver USB drive installed and demonstrated able to store and open program files.
While in Bloxter Camera lesson:
Case A: program consists only of “move forward 1 inch.” Program runs correctly.
Case B: program consists of “move forward 1 inch” followed by “take photo.” Program fails to run (GoPiGo does not move) and Output window pops open with “Camera not detected” error.
It looks to me like there’s a flaw or mismatch in the packages that Python loads whenever there’s a camera-related block in the Bloxter program. Advice?
Robot has been rebooted multiple times. Using DexterOS V 2.2.0, the version that was packed with the GPG when I received it a few days ago. I assume the same version is on the micro-SD as on the standard SD.
I can’t seem to be able to run “sudo raspi-config” from Jupyter (keeps asking for password, and won’t accept ‘Jupyter’) or from notebook (responds with syntax error).
Ok, here’s a test to check if the camera is enabled or not.
In the Python section, start up the terminal. Enter grep start_x=1 /boot/config.txt
if it returns start_x=1 then the camera is indeed enabled. If it returns nothing then for some reason, it got disabled on your card. The good news is that you can take the SD card out of the Raspberry Pi, into a laptop, and edit the config.txt file in the /boot folder.
Make sure to edit with a code editor!!!
Look for this little piece of code and make sure start_x=1 is added.
Thanks for the suggestion, Cleo! The camera is indeed enabled on my DexterOS microSD.
My next step will be to buy another Raspberry Pi camera locally, substitute it for the one I received from Dexter, and see if it works. If it does, I’ll return the presumably faulty one to Dexter. If the new camera also fails to work, I’ll have to blame the Raspberry Pi board itself. I’ve already connected the camera with both cables that were supplied with the camera, so I think I can rule out connection issues.
Valid logic however I would add that connection issues are still a possibility. It’s very easy to think the cable is in properly when it’s not. Those cables have to be inserted so that the blue part barely shows, and is horizontal.
Also those cables are known to break internally, so that’s another possibility.
Before moving on, I would troubleshoot with a regular Pi and regular Raspbian, if that’s a possibility for you.
Beginners like me have to defer to the experts, so I, for the third or fourth time, disconnected and reconnected the camera to the GPG board. I used each of the two camera cables that came with my camera. Blue parts barely visible, and facing the correct way.
Got the same error each time.
I suppose it’s possible, but I’d say unlikely, that two different, randomly-packed cables would both be faulty. Anyhow, I still plan to try a new camera. I’ll report the result in this thread.
I did buy a new Raspberry Pi camera, which came with a new (slightly different) cable. Here are the results.
New camera on old cable - “Camera not detected”
New camera on new cable - “Camera not detected”
Old camera on new cable - “Camera not detected”
Cleo said, “Before moving on, I would troubleshoot with a regular Pi and regular Raspbian, if that’s a possibility for you.” But I have only the hardware that was part of my GPG3 purchase from Dexter (plus Mac and iPad), so I’d need more guidance on that.
I’m disappointed that I can’t use the camera on my GPG, but I will proceed with the distance sensor, which does work. In my mind, the camera problem appears to lie in the Raspberry Pi 3 board. I’d be happy if Dexter would send a new Pi board, which I would swap with the original and then return the original. Or…what do you propose?
Before we proceed with the Raspberry Pi replacement, can you share some photos of the camera connections? Both on the board, and at the camera level. Just to be sure we’re not overlooking something.
In addition to what @cleoqc has said, do you think you could give the PiCamera another chance with a pure distribution of Raspbian? The only things you’d have to do on a fresh image are:
Enable the PiCamera.
Run raspistill -o test.jpeg.
If this doesn’t work, then there’s something wrong with the connection between the camera and the Pi.
RobertLucian’s suggestion was spot on! After dredging an ancient USB-wired keyboard from my basement, and recabling my entertainment system, I was able to run raspistill -o test.jpeg on the Pi. It gave me 2-3 seconds of video feed from the camera! So the camera’s good and its connection to the Pi is good.
Then, for no rational reason, I reconfigured the robot with the DexterOS V 2.2.0 SD card, and verified that I still got the “Camera not detected” error.
What’s my next step? Should I download and flash a fresh DexterOS image onto my spare SD card, and try it in the robot?
Luckily, you didn’t stumble upon a PS/2 keyboard in your basement - that would have been a pain
So, we can definitely rule out a problem with the link between the two of them. Following this, this would be my course of action:
Rip the image you have that doesn’t work and put it somewhere so I can download it and test it with mine. Since we don’t want any “external noise”, a signature for the image would be very well welcome (think MD5).
At the same time, flash a different card with a new version of DexterOS v2.2.0 and see if it works.
And last but not least, can you tell me what is the version of your PiCamera?
I have no idea what RobertLucian means in his suggestion no. 1. How can I rip an image that never appears? But never mind that, his suggestion no. 2 (which I also proposed) did the trick.
After downloading DexterOS v 2.2.0 and burning it onto a new microSD, the camera function worked normally. I’m annoyed that Dexter sent me a damaged microSD, and frustrated that it took me a week, and extra expense, to fix the problem. But I’m glad to be back on track with my GPG3.