I am trying to use the Raspberry Pi Camera to take pictures and videos. It was all working fine for about 3 days, after which things started to go downhill. First, I noticed that the website where I was streaming the Raspberry Pi's video showed the unloaded image sign (https://www.thewindowsclub.com/wp-content/uploads/2018/06/Broken-image-icon-in-Chrome.gif). Therefore, I went back to my raspbian terminal and tried basic commands. First, I tried this:
raspistill -o /home/pi/Desktop/image.png
This worked perfectly the past few days, and I thought it worked again, until I opened the image. Image Viewer said that the image is not a PNG file at all. This was the popup:
Fatal error reading PNG image file: Not a PNG file
After looking up the error, I reinstalled the PNG library, and still no luck. So, I decided to use jpg instead. I next executed this:
raspistill -o /home/pi/Desktop/img.jpg
And... I got another error:
Error interpreting JPEG image file (Not a JPEG file: starts with 0xc5 0xdb)
After looking it up again, I used this command:
file /home/pi/Desktop/img.jpg
I got the following output:
/home/pi/Desktop/image.jpg: data
So... if the jpg file is actually a data file, what is the problem?
Also, it was working perfectly for the past few days in a Python script and with the terminal... What happened now?
Some additional information: I always use xrdp to Remote Desktop from my Windows Laptop to my Raspberry Pi (4 B+). Therefore, I cannot see if the preview works or not. I am using Raspberry Pi Camera Rev. 1.3 and Raspbian Full 32-bit.
Some more important information: This error started occurring after an incident that I can't explain. I had my Windows Laptop connected to my Raspberry Pi with Remote Desktop, and I accidentally pressed the Sleep button. When I woke the laptop again, it said Remote Desktop terminated unexpectedly. I kept trying to reconnect but it wouldn't work. So, I unplugged the Raspberry Pi and plugged it in again. After I used Remote Desktop to connect to it again, it started doing this. This made me think it was a software problem, so I enabled and disabled Camera from Raspberry Pi Configuration and raspi-config, but it was no use.
I am stuck and don't know what to do. Any help would be greatly appreciated. Thank You in advance.
EDIT: The preview shows up perfectly, it's just the saving of the image that somehow gets corrupted. Is there any way to re-install raspistill?
I had the same problem.
Installation steps:
-Raspberry pi 4 B 8 Gb
-RPi camera 8 MP v2.1
-Used official Raspberry pi imager app for MacOS to install the official Raspberry Pi 32 bit OS onto 32 GB card
-Set up the Rpi by following all setup prompts
-Ran, sudo apt update, sudo apt upgrade & sudo rpi-update in terminal and rebooted
-Ran sudo rasps-config in terminaI and went to “Interfacing options” and enabled interface option P1 Camera
-Shutdown and connected the raspberry pi camera to the camera interface on the board, made sure the ribbon was right way round and properly seated at the port and at the other end on the card containing the camera
-Ran sudo vcgencmd get_camera in terminal and it returned “supported=1 detected=1”
Here is what I did next:
-Ran raspistill -o Desktop/image.jpg in terminal, got a camera preview on screen
-Ran raspivid -o Desktop/vid.h264 in terminal, got camera preview
-Went to the desktop, the two files were there ,opened the jpg file with image viewer and it looks fine. Tried to open the h264 video file using VLC media player and all I got was a strip of pixelations across the top of the screen
-Installed Kodi player because I thought it might be better at opening h264 video files than VLC
-Installed omxplayer from terminal and tried to open the h264 video file from there - didn’t open
I then repeated installation steps above and installed the OS afresh. In the process I shutdown and I removed the camera from the port, reinserted the camera then rebooted and ran vcgencmd get_camera in terminal and it returned “supported=1 detected=1”.
Then I did the following image/video capture steps:
-Ran raspistill -o Desktop/image.jpg in terminal, got a camera preview on screen
-Ran raspivid -o Desktop/vid.h264 in terminal, got camera preview
-Went to the desktop, the two files were there
-Tried to open image.jpg and got some error message saying “Error interpreting JPEG image file (Not a JPEG file: starts with 0xc% 0xdb”
-So now I could not open either the captured image file or the video file
I kept using the raspberry pi over a day or so to do other things and in the process I probably rebooted/shutdown several times. I deleted Kodi because it didn’t help and was taking up space. I may have done installation steps another time but not sure if I did. I then ran the image/video capture steps mentioned immediately above and to my surprise not only did I get the previews but I was able to open the jpg file and the h264 video file using image viewer and VLC respectively. The camera seems to function correctly. Not sure what happened. Might have been the reinstall or the installation and subsequent deletion of Kodi that did it - I guess I will never know but it looks like reinstalling OS, update, upgrade and reseating both ends of the camera ribbon cable may have done the trick.
Related
I recently bought raspberry pi pico and I follow the How to get started with raspberry pico in C/C++ tutorial, but I have only windows computer. I want to debug my pico with usb. I compiled the example hello world project with cmake usb configuration (as shown in tutorial) and draged a usb/hello_usb.uf2 file to pico. Also there is a elf file for debugger, but I have no idea, what to do with it. Only thing about connecting pico usb stdout to computer, that I found in tutorials and datasheets is this command for minicom:
$ minicom -b 115200 -o -D /dev/ttyACM0
Unfortunately minicom is only available for Linux, but I found out what different parts of that command means:
Port: /dev/ttyACM0
Baud rate: 115200
-o means that minicom doesn't initial setup (I don't exactly know what it is)
And I tried to enter these informations to puTTY:
I tried a lot of other combinations of values that are not specified in that command (On screenshot is config for some arduino board, that I found), but I always just heard windows fail tone. All stuff I do and describe here might be wrong, I am a beginner, but I didn't found a good source of information about this.
Should I use something else (not puTTY)?
EDIT:
I got it! I did some mistakes during sdk setup and tinyUSB didn't work, so I couldn't even see pico in device manager. I did the whole setup again and everything works now. I also found video, how to connect pico via putty: https://youtu.be/BjGc60Mmwz8 . Also as aMike said, you have to type just com port to puTTY, not /dev/ttyACM0.
Thats not really debugging. Putty is just a serial monitor for getting printf() from your Pico device. For real debugging abilities (breakpoints, variable watch etc..) and to understand how those .elf files work, check this project.
I am trying to load a program on a Raspberry Pi Pico. Have loaded the standard blink program on it using USB connected to my Macbook and used Thonny to run and stop the program.
However if I disconnect the Raspberry Pi Pico, from the USB, the program disappears. I found this video (https://www.youtube.com/watch?v=IMZUZuytt7o) that shows how to make it work with a windows system, but if I try the same with Macbook does not work. It gets stuck at Trying to connect to REPL
Can someone suggest how we can flash the program on the Raspberry Pi Pico so that it stays whenever we connect it to power?
Here is the program I tried
import machine
import utime
led_onboard = machine.Pin(25, machine.Pin.OUT)
while True:
led_onboard.value(1)
utime.sleep(1)
led_onboard.value(0)
utime.sleep(.5)
I tried using the suggested RShell solution using pip install rshell. However it does not seem to work on macbook very well when it comes to copying the program to the pico. So I tried an alternate REPL writer called ampy
To install ampy follow the guide on https://github.com/scientifichackers/ampy
pip install adafruit-ampy
In your shell go to the folder where the program is stored. Keep the file name as main.py
Run ampy using the command
ampy -p /dev/cu.usbmodem0000000000001 put main.py
The format is
ampy –p [USB-Port] put [file to copy]
The file is now copied into the board.
Now if you unplug and re-plug the power source the program in main.py would execute.
I am trying to make my raspberry pi open a set of page's automatically when i start it up in the morning but unfortunately i can't get it to work
i already have the links in chromium so if chromium can start automatically and get to the full screen mode it is solved
so the only thing that needs to happen is to automatically start up chromium
i tried to use Kiosk for it but it gave me a lot of trouble
this is the code i have right now
#chromium-browser --kiosk
If u want to start your browser in fullscreen mode at boot use the following line in terminal to edit the startup file. (if you're already in root then u dont have to use sudo)
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
Then add the following to the startup file.
For using chromium
#chromium-browser --start-fullscreen
It is basically the same as pressing f11 but then automatically.
If u want to add an URL to this u can do that in-between the command and the argument like this.
#chromium-browser http://localhost --start-fullscreen
This will launch the browser in fullscreen in the requested URL.
I am using OdroidXu4 armv7 board, ubuntu 16.04. Dont know why my all menu disappear, but the files on desktop can still be operated.
I followed https://itsfoss.com/how-to-fix-no-unity-no-launcher-no-dash-in-ubuntu-12-10-quick-tip/ to reinstall ubuntu-destop or unity, but it didn't work.
Then I used the command below
dconf reset -f /org/compiz
setsid unity
The menu flashed a while then disappeared again, returned error:
file /dev/mali0 is not of a compatible version (user 10.6, kernel 10.1)
ERROR: The DDK is not compatible with any of the Mali GPUs on the system.
The DDK was built for 0x620 r0p1 status range [0..15], but none of the GPUs
matched:
file /dev/mali0 is not of a compatible version (user 9.0, kernel 8.0)
I was confused with the "GPUs", because I didn't have any GPU.
How to fix the problem, thanks for your help
I was using Ubuntu 16.04.In my case unity, launcher and even terminal is not working.I followed the steps as described in https://www.itsmearunchandel.co.in/linux/ubuntu/how-to-reset-ubuntu-desktop.html .
1. Go to command line mode, press Ctrl+Alt+F1
2. Give username and password.
3. Run the commands as described in the link.
This way my issue was resolved.
I am working on a project similar to the one at http://www.instructables.com/id/Raspberry-Pi-Wall-Mounted-Google-Calendar/?ALLSTEPS
Similarly, I need my pi to stay on constantly. I have the regular Raspbian OS installed and I am using Iceweasel browser to run a web application all day.
I have tried every single one of these suggestions from this link http://www.bitpi.co/2015/02/14/prevent-raspberry-pi-from-sleeping/
Yet the pi fails to stay on longer than 10 minutes. Any help would be greatly appreciated.
I installed xscreensaver
sudo apt-get install xscreensaver
Once installed, go to Rpi's desktop "Menu" (left top corner)
Go to preference --> screensaver.
You will see a screen saver main menu. In the mode drop-down menu, select "disable screensaver" then close the window.
Reboot the Raspberry PI.
It should work now.
You don't need to install lib, just edit lightdm
1 - Open lightdm using your prefer text editor, eg using default editor(nano).:
sudo nano /etc/lightdm/lightdm.conf
2 - Add this line
xserver-command=X -s 0 -p 0 -dpms
I recently installed Raspian Buster with Desktop (circa 2019-September) - the smaller install with the Desktop, but without the "recommended software". I found there are two settings that have to be changed as either one of them will blank the screen in ten minutes under the default settings.
set screen saver timeout to zero:
xset s 0
and set dpms (EnergyStar) to disabled:
xset -dpms
This way I haven't needed to install anything (no screensaver). It was confusing because I'd tried both items, but it wasn't until I learned they both were blanking the screen at ten minutes that I saw what was going on. As this has tested out OK, the next step for me is to put them into an autostart routine.
ps Verify your settings with
xset q
Without installing anything, official Raspberry Pi doc:
On the Console
If you are using the Raspberry Pi solely on the console (no desktop GUI), you need to set the console blanking. The current setting, in seconds, can be displayed using
cat /sys/module/kernel/parameters/consoleblank
Here, consoleblank is a kernel parameter. In order to be permanently set, it needs to be defined on the kernel command line.
sudo nano /boot/cmdline.txt
Add consoleblank=0 to turn screen blanking off completely, or edit it to set the number of seconds of inactivity before the console will blank. Note the kernel command line must be a single line of text.
https://www.raspberrypi.org/documentation/configuration/screensaver.md
Simply enter the config with sudo raspi-config and disable screen blanking in the display settings.
I've created a picture frame with a pi 3 and want to stop the screen going blank. I installed xscreensaver as in answer 22 and it's working a treat:
sudo apt-get install xscreensaver
After install, went to Rpi's desktop "Menu" (left top corner)
Went to preference ---> screensaver.
Then In mode : section, selected "disable screensaver" and closed.
Rebooted Rpi.
I had the same issue with Raspbian OS that was installed on raspberry Pi device. I just installed xscreensaver by using the following command in default Command panel.
sudo apt-get install xscreensaver
After installation is completed, Go to the menu in the left corner and select preference. First time you will see a pop up to enable xscreensaver on your screen. Just accept it. After that you can disable the screensaver.