On board Raspberry Pi Camera not working with Raspbian Stretch


I’ve forked the project for the camera, added a build and hopefully added some additonal logging - if you want to try this versions @Bounz happy if you want to fork this and then Ill delete my repo :slight_smile:

grab the interface zip from here: https://github.com/davidwallis3101/mig-media-v4lcamera/releases


@David_Wallis how can I install this into HG. I went into HG Package Manager, pointed the link to the installer and the installer is just spinning around. Nothing showing up to install.


download the zip from the releases page and just install and interface from the zip file using the hg interface…


@David_Wallis yes I downloaded the Releases file to /usr/local/bin/homegenie folder on the Raspberry Pi and confirmed its there. I go into the Package Manager in HG and on the browser bar I put the location /usr/local/bin/homegenie and nothing showing up on the screen and the progress wheel is just spinning

Is there somewhere else in HG I can install this file.

Did you manage to get the camera working yourself


that’s not how you install an interface from a zip, think it’s sittings then down at the bottom right


I think you may be getting confused here. It’s Configure-Maintenance-System Options-Install Package. You have the browser bar above followed by a list of packages that are available to install. The link points to https://api.github.com/repos/Bounz/homegenie-packages/contents which is obviously Bounz repo.

What I’m trying to do is install your file via this method. I am not aware of any other method of installing your file in HG


You can install interface package from .zip file at Configure - Settings - Actions - Install interface.


Thanks Bounz that’s exactly what I was looking for.

@David_Wallis I installed your releases file and I dropped i all the relevant files that Bounz suggested earlier. Here is a section of the debug
2018-02-10 16:51:20.3790 Debug Enabling Interface Media.CameraInput
2018-02-10 16:51:20.3900 Debug 55
2018-02-10 16:51:20.3921 Debug 00
2018-02-10 16:51:20.3975 Debug 00-00-00-00-00-00-00-00
2018-02-10 16:51:20.3996 Debug 00
2018-02-10 16:51:20.4043 Error System.DllNotFoundException: CameraCaptureV4L
at (wrapper managed-to-native) MIG.Interfaces.Media.CameraInput+CameraCaptureV4LInterop:OpenCameraStream (string,uint,uint,uint)
at MIG.Interfaces.Media.CameraInput.Connect () [0x0008c] in <5d803dfdf1dc419b952079a12c633e3f>:0
at MIG.MigService.EnableInterface (System.String domain) [0x0003e] in <0d2ae8560a244b2680fb8ebf44c6713f>:0
at MIG.MigService.StartService () [0x00093] in <0d2ae8560a244b2680fb8ebf44c6713f>:0

What was the contents of that releases file you posted. CameraCaptureV4L file is still being reported as not found


I’m not getting confused, I’ll screenshot it next time I’m on the pc.


There must be some delay on these posts. Bounz already demonstrated where it could be found. I posted the results above of the debug after installing your releases file.

Did you actually get the Raspberry Pi camera module working using this. As far as I know nobody has managed to get the raspberry pi camera working in Jessie or Stretch. Try it yourself and you’ll see what I mean.

Just take a look at the debug results.


As i said previously - I didn’t claim to have fixed anything yet - just added more debugging… Can you post the full log from the point where you attempt to enable the interface from the version I provide.


the reason being is that the interface looks for certain files to determine which V4L driver to load… I’m not even sure if they are included in the packaging… but will have another look next once I have a bit more detail to debug with


I reverted to v526 which appears to have the relevant files correctly packaged for the MIG installer for Video4Linux.

It’s still reporting that it cannot find that file. I reckon that the only way to successfully debug this problem would be if you had a Raspberry Pi with a camera module attached in front of you.

I do know that I had build the v4l2 driver when I got it working in Wheezy following Genes instructions from the old forum. That was necessary as the v4l2 driver hadn’t been fully integrated into the Linux kernel at that stage.

I have the bcm2835-v4l2 loading at boot in the /etc/modules file and it’s confirmed working with the dmesg command.

The only thing I can think of that may be causing the problem now is that the path that the system is looking for the file in is incorrect or possibly a permissions issue.

As I said if you have access to a Pi and a camera module it would be a lot easier to debug this problem.


I have camera module etc… I will look at it as soon as I can :slight_smile: but again - i added logging to that version which should point at exactly which files are missing. ( when I say exactly - not quite, but I know what I mean!)


Debug of the camera being loaded on boot and the missing file reported. This is the only debug info relating to the camera I can see.

2018-02-12 12:32:52.5072 Debug Adding Interface Media.CameraInput
2018-02-12 12:32:52.5104 Debug Setting Interface options
2018-02-12 12:32:52.5118 Trace Media.CameraInput: Configuration=/dev/video0,320,240,1

2018-02-12 12:32:56.2153 Debug Enabling Interface Media.CameraInput
2018-02-12 12:32:56.2415 Error System.DllNotFoundException: CameraCaptureV4L
at (wrapper managed-to-native) MIG.Interfaces.Media.CameraInput+CameraCaptureV4LInterop:OpenCameraStream (string,uint,uint,uint)
at MIG.Interfaces.Media.CameraInput.Connect () [0x0008c] in <5d803dfdf1dc419b952079a12c633e3f>:0
at MIG.MigService.EnableInterface (System.String domain) [0x00039] in <23027418f9174dd68010f21fc4a3aea3>:0
at MIG.MigService.StartService () [0x00097] in <23027418f9174dd68010f21fc4a3aea3>:0


got a bit of time…


@Petediscrete - the additional logging wasn’t present due to the default log level in the nlog config… doh…

anyway for reference to launch in a proper debug mode then;

MONO_LOG_LEVEL=debug mono /usr/local/bin/homegenie/HomeGenie.exe

Just troubleshooting the issues (one main issue is a bug in the way I create the zip so the v4l files go in wrong folders… just working through this…


havent sussed this yet… just not loading the file, despite running

sudo apt-get install libgd2-noxpm-dev -y
chmod 777 /usr/local/bin/homegenie/lib/mig/libCameraCaptureV4L.so
echo /usr/local/bin/homegenie/lib/mig > /etc/ld.so.conf.d/homegenie.conf
sudo ldconfig
sudo ldconfig -p |grep V4L


Maybe if you have a look at the C# source code it may help. Also if nothing obvious shows up a possible starting point would be a look at the last working version of the Raspberry Pi camera module in HomeGenie, in Raspbian Wheezy and make a comparison

I cannot see any obvious difference in the boot sequence between HG v526 in Raspbian Wheezy v Raspbian Stretch.

If you could compare both boots you may be able to see where the loading of the camera module falls down in Stretch.

I’m not a programmer and C# is way out of my league but I can see no logic as to why it’s working in one release of Raspbian and not another. The only thing that comes to mind is a change in the Linux kernel firmware between releases which Gene never addressed.


I’m assuming this is the build that Gene included in the MIG Packager. I’m wondering I’d there could be any clues in here as to why it appears to load but not run.