How do you enable the camera module in Ubuntu 16.04 running on a Raspberry Pi 3?
This is similar to my earlier question, except where that was for the Raspberry Pi 2, this is for the 3.
I ran through the same procedure I documented there, but even though all steps ran successfully, and the command
vcgencmd get_camera reports:
attempting to run
raspistill --nopreview --output image.jpg results in the error:
mmal: mmal_component_create_core: could not find component 'vc.camera_info' mmal: Failed to create camera_info component mmal: mmal_component_create_core: could not find component 'vc.ril.camera' mmal: Failed to create camera component mmal: main: Failed to create camera component mmal: Failed to run camera app. Please check for firmware updates
sudo rpi-udpate, re-checked by settings in
/boot/config.txt but everything looks right. I had previously gotten the camera working under Raspbian on the Pi3, and I haven't changed any wiring since replacing the SD card with an image of Ubuntu 16, so the I'm certain it's a software issue. What's different with Ubuntu? What can I do to diagnose and fix this problem?
$ lsmod Module Size Used by bnep 10340 2 hci_uart 17943 1 btbcm 5929 1 hci_uart bluetooth 326105 22 bnep,btbcm,hci_uart binfmt_misc 6388 1 snd_usb_audio 118608 0 snd_hwdep 5727 1 snd_usb_audio snd_usbmidi_lib 19801 1 snd_usb_audio snd_rawmidi 18516 1 snd_usbmidi_lib evdev 11396 0 snd_seq_device 3621 1 snd_rawmidi brcmfmac 186339 0 brcmutil 5661 1 brcmfmac cdc_acm 17370 0 cfg80211 427855 1 brcmfmac rfkill 16037 6 cfg80211,bluetooth bcm2835_gpiomem 3040 0 bcm2835_wdt 3225 0 uio_pdrv_genirq 3164 0 uio 8000 1 uio_pdrv_genirq snd_bcm2835 20447 0 snd_pcm 75762 2 snd_bcm2835,snd_usb_audio snd_timer 19288 1 snd_pcm snd 51908 8 snd_bcm2835,snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_rawmidi,snd_usbmidi_lib,snd_seq_device ipv6 347530 24 $ cat /boot/config.txt | grep -v '^#' | grep '.' hdmi_force_hotplug=1 hdmi_drive=2 start_x=1 gpu_mem=256 $ uname -a Linux localhost 4.4.23-v7+ #913 SMP Tue Oct 4 14:16:19 BST 2016 armv7l armv7l armv7l GNU/Linux
After I enabled
start_debug=1 in my
sudo vcdbg log assert shows:
002702.229: assert( source ) failed; ../../../../../middleware/confzilla/cp_front_fdt.c::cp_front_fdt_load_builtin line 115 rev c844c61 vcdbg_ctx_get_dump_stack: dump_stack failed ---------------- 003569.708: assert( card not initialised ) failed; ../../../../../filesystem/media/sdcard/sdcard.c::sdhost_close line 1045 rev c844c61 vcdbg_ctx_get_dump_stack: dump_stack failed ----------------
Edit: I'm not entirely sure what happened, but now it's working. In case anyone else runs into this, here's what I did.
I tried downgrading my firmware to a version from Oct 2015. That failed and caused by Pi to show the Rainbow Screen of Death. However, I was able to use rpi-update from my laptop to revert the firmware on the SD card, to get it to boot again.
Another issue I was having was insanely long boot times when unplugged from ethernet. I fixed this by editing
/etc/network/interfaces and changing eth0's entry from auto to manual. I also fixed a problem with eth0 being renamed to enx*, which might have been confusing network startup.
I was also seeing a boot up error from the "Load System Module" service. Looking at the log showed it was trying to load kernel module
bcm2808_rng which didn't exist. Researching this error found that this module is for the Raspberry Pi 2, and has been removed and replaced with the module
bcm2835_rng. Modifying the file '/etc/modules-load.d/rpi2.conf' and replacing the old module name with the new one fixed that error.
The docs for installing raspistill on Ubuntu had me cloning and building the
https://github.com/raspberrypi/userland.git repo. I was previously doing this from inside
/tmp. I changed this to
~, incase the build was saving important files in
/tmp which were then being lost after reboot.
After a few reboots, I again tested raspistill, and it worked. I'm not sure if any of those changes were fixes, or if I just scared away some gremlins, but I've rebooted a few times and raspistill is now working reliably.
I re-ran the shell commands I posted earlier, so see what's changed, and everything was the same except for the lsmod output. It shows the exact same kernel modules, but where the
evdev module was listed as being used by 0 other modules, it nows shows it's being used by 2 other modules, although it doesn't list those module's names.