Can not enable Camera Module

I’ve got a DietPi installation, on a Raspberry Pi 2 - 1GB, which is admittedly a little old - when I try to do dietpi-update, it says it can’t connect to http://github.com, and fails to update (which seems strange, and is possibly a topic for another post. Network connection is working fine on it, and I can wget the github page with no problems), and I’d rather avoid a full SDCard reimaging, so I was hoping to get this sorted with my current version. When I run dietpi-config, and try to enable the camera module, under Display Settings, the screen flashes, and the “Disabled” label doesn’t change over to “Enabled” as I’d expect. Exiting this screen asks me if I want to save my settings, despite them not having really been changed. If I choose to save the changes, and reboot, I am unable to use the Camera, as it’s not been enabled.

Since raspi-config is not present in the build, I Googled for how to manually enable the camera module, and found that I should be able to edit /boot/config.txt, adding/editing the line “start_x=1”. However, when I edit this file, it simply says that the file has been replaced with dietpi’s RAMDisk version, at /DietPi/config.txt. Editing that file shows the exact same message.

So, how can I - either manually or automatically - enable the camera module on my Pi?

Well that was silly.

Editing the /DietPi/config.txt, and adding the line “start_x=1” did the trick.

I was under the impression that something was out of sorts, given that the file’s contents were simply raw text, explaining that the file was moved, and didn’t even try editing it. I assume this change will be persistent, as it survived at least one reboot, so far.

Still not sure why the dietpi-config menu wasn’t able to apply the change, but I’m up and running, now.

I’d be happy to provide any info I can, regarding the deitpi-config issue, if someone wants to look into it.

Hi,
I would like to refresh topic. I installed recently ver. 139 and I had no problems with camera at all. I’ve updated DietPi to 141 via SSH and I lost all my settings. Content of DietPi folder gone so I installed all from the skracth and since that time I have no camera picture on web page. It looks like on the picture. I use RaspPi Cam connected to CSI.
I started to think that there is something with my camera but after installing raspistill all is OK and camera captures pictures.
In syslog I have following errors:

Jan  9 22:44:20 DietPi motion: [1] [CRT] [NET] netcam_start: libjpeg decompression failure on first frame - giving up!
Jan  9 22:44:22 DietPi wpa_supplicant[511]: wlan0: WPA: Group rekeying completed with 00:1d:0f:ea:2f:6e [GTK=TKIP]
Jan  9 22:44:30 DietPi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
Jan  9 22:44:30 DietPi motion: [1] [ALR] [NET] netcam_start: Network Camera thread starting... for url (http://localhost/cam_pic.php)
Jan  9 22:44:30 DietPi motion: [1] [NTC] [NET] netcam_setup_html: connected, going on to read image.
Jan  9 22:44:30 DietPi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Jan  9 22:44:30 DietPi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Jan  9 22:44:30 DietPi motion: [1] [CRT] [NET] netcam_start: libjpeg decompression failure on first frame - giving up!
Jan  9 22:44:40 DietPi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
Jan  9 22:44:40 DietPi motion: [1] [ALR] [NET] netcam_start: Network Camera thread starting... for url (http://localhost/cam_pic.php)
Jan  9 22:44:40 DietPi motion: [1] [NTC] [NET] netcam_setup_html: connected, going on to read image.
Jan  9 22:44:40 DietPi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Jan  9 22:44:40 DietPi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Jan  9 22:44:40 DietPi motion: [1] [CRT] [NET] netcam_start: libjpeg decompression failure on first frame - giving up!
Jan  9 22:44:50 DietPi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera

I used dietpi-config to enabled camera and this is confirmed with start_x=1 in /boot/config.txt.
Could you please point me to any idea?

You’ll need to apply any config.txt changes to the RAMdisk location, else, they will not be saved during reboot:

/DietPi/config.txt

Also, the camera requires 128MB GPU memory split. This should be applied during installation of DietPi Cam, however, please check this is current in:
dietpi-config > Display > GPU/Memory split

DietPi-Config not applying startx=1

Thanks for the report, i’ll take a look and see if we can get this resolved: https://github.com/Fourdee/DietPi/issues/706

Memory split set correctly:

Hardware : RPi 3 Model B (armv7l)                                      │
Current: 128 MB GPU | 896 MB RAM

And I checked setup in config.txt using USB card reader, so it is set:
Clipboard01.png
I also confirmed this using SSH and mc after reboot:
Clipboard02.png
so I assume is was loaded correctly.
Still no changes. I can see for a while red Loading and then screen as on the first post.

Yep, all looks in order. I’ll setup a test system and see if we can replicate.

samezrp,

Please can you try the following and let us know if problems persist:

apt-get install -y libraspberrypi-bin
dietpi-software reinstall 59

Ok, thanks in advance. If I can help you with any logs or something pls revert. One thing, at the beginning there was no /dev/video0 device. I had to run:

modprobe bcm2835-v4l2

it did not helped, but /dev/video0 appeared.

When I run hdparm I got:

root@DietPi:~# hdparm -i /dev/video0

/dev/video0:
 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
root@DietPi:~#

Maybe this somehow broke the system but as I said without this command problem was the same. On ver. 139 all was OK, unfortunatelly I deleted that revision and I cannot find it anymore to download and test.

[edit1]
I’ve just red last post. I will do within few minutes and revert.

[edit2]
BINGO!
At the first moment I got:

root@DietPi:~# apt-get install -y libraspberrypi-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
libraspberrypi-bin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

so I ran:

apt-get remove libraspberrypi-bin

and then ran all your commands, I shut system down waiting for 5 minutes before pulling the plug out. Started system and… viola!


Thank you for your help!

Excellent, thanks for letting us know. We’ll get this patched for our next update (v142).