On board Raspberry Pi Camera not working with Raspbian Stretch


I originally had the on board Raspberry Pi camera working on Raspbian Wheezy. It stopped working in Raspbian Jessie and does not work in Raspbian Stretch either. I suspect this is down to the fact that the original author of HomeGenie may not have updated the code to reflect the changes in the video4linux drivers.

The current Linux Kernal contains v4l2 drivers yet in the HomeGenie Maintenance Section under Package Installer there is an option to install a driver for the Raspberry Pi camera. This driver refers to Video4Linux 1.1 which appears to be an outdated driver.

Has anyone managed to get the Raspberry Pi camera module working under Raspbian Jessie or Raspbian Stretch. I did highlight this issue in the old homegenie forum but never received a response. I’ve tried the sudo modeprobe bcm2835 command to install the v4l2 drivers but that makes no difference.


I’m not holding out much help on the problem here. Just wanted to confirm that I have the on board Raspberry Pi camera working in Raspbian Wheezy but this release is really not suitable as it no longer supports the sending of email notifications among other things.

I think the problem lies somewhere in the Homegenie base code. Clearly the Raspberry Pi camera support stopped after the introduction of Raspbian Jessie. Maybe someone who looks at this post may have the expertise to resolve this problem.


I’ve got a camera so can have a play, but on hol for a week from friday. So wont be next week.


Ok thanks. Remember it works in Wheezy but not in Jessie or Stretch. I have to say I’ve exhausted all avenues I know. It was working under the v4l2 in Wheezy but something changed and I reckon Gene never bothered following it up.


Im not using Wheezy any more… Ill test with stretch - as that seems nice and quick with my testing :slight_smile:


As I said it works in Wheezy but Wheezy is EOL so not much point doing any testing in it. I’ve a feeling it’s down to the version of the Video4Linux utility in the Homegenie package manager. There’s been many changes to the v4l2 driver since Wheezy and I don’t think Gene made any changes to that package since Wheezy.

The bcm2385-v4l2 driver is loading fine, it’s shows up as loaded and registered using the dmesg command so that’s not the problem and raspistill and raspivid work fine.


The more I look at this problem it appears the problem lies in the MIG Package Video 4 Linux 1.1 that gets installed from the Package Manager in the Maintenance section. I imagine no updating of this package occurred between Wheezy and the release of Jessie and Debian.

I could be wrong here but there’s no other logical explanation I can see for this. I’m wondering if there’s dependencies issues or missing libraries as a result. I can’t see any documentation in the GitHub that might explain exactly what maintenance was done on this package.


had a quick dig and the build process might be the issue with this… looking in the externals folder there is a cameracaptureV4L folder with a makefile.

The build process that I did in appveyor does a remove of the existing folders as per gene’s scripts… but I dont think it builds properly - there is actually a linux cs proj that isnt part of the solution which might need adding…

I personally think we should ditch the mac and linux solutions and just have one - this might be the time to deal with this… will investigate when back from hols :slight_smile:

There is also a V4L video interface on gene’s own github which I have forked so I have a copy should the repo’s ever disappear.



Just doing a bit more debugging on this problem as I have a little more time today. I know it’s a bit difficult for others to join in if they haven’t got a Raspberry Pi and a Raspberry Pi camera module

Debugging on Startup of HomeGenie in the Camera section

2018-01-26 14:00:32.0255 Trace Media.CameraInput: Configuration=/dev/video0,640, 400,10
/bin/cp: cannot stat ‘/usr/local/bin/homegenie/lib/mig/v4l/raspbian_libCameraCap tureV4L.so’: No such file or directory

2018-01-26 14:00:35.8686 Debug Enabling Interface Media.CameraInput
2018-01-26 14:00:35.8856 Error System.DllNotFoundException: CameraCaptureV4L
at (wrapper managed-to-native) MIG.Interfaces.Media.CameraInput+CameraCaptureV 4LInterop:OpenCameraStream (string,uint,uint,uint)
at MIG.Interfaces.Media.CameraInput.Connect () [0x0008c] in <5d803dfdf1dc419b9 52079a12c633e3f>:0

After I attempted to enable in the HomeGenie in the interface Settings Camera section

00 /api/MIGService.Interfaces/Media.CameraInput/IsEnabled.Set/1// [CLOSED AFTER 0.025 seconds]
2018-01-26 14:35:38.6415 Info WebServiceGateway HTTP GET 2 00 /api/MIGService.Interfaces/Media.CameraInput/IsEnabled.Set/0// [OPEN]
2018-01-26 14:35:38.6450 Debug Disabling Interface Media.CameraInput
2018-01-26 14:35:38.6526 Info MIGService.Interfaces Media.CameraInput M IG Interface Status.IsEnabled 0
2018-01-26 14:35:39.1903 Info WebServiceGateway HTTP GET 2 00 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2018-01-26 14:35:39.1946 Info WebServiceGateway HTTP GET 2 00 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0.004 sec onds]
2018-01-26 14:35:39.3847 Info WebServiceGateway HTTP GET 2 00 /api/MIGService.Interfaces/Media.CameraInput/IsEnabled.Set/0// [CLOSED AFTER 0.743 seconds]
2018-01-26 14:35:44.2005 Info WebServiceGateway HTTP GET 2 00 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2018-01-26 14:35:44.2054 Info WebServiceGateway HTTP GET 2 00 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0.005 sec onds]
2018-01-26 14:35:54.0600 Info WebServiceGateway HTTP GET 2 00 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [OPEN]
2018-01-26 14:35:54.0814 Info WebServiceGateway HTTP GET 2 00 /api/HomeAutomation.HomeGenie/Config/Interfaces.List/ [CLOSED AFTER 0.021 sec onds]
2018-01-26 14:35:54.7376 Info WebServiceGateway HTTP GET 2 00 /api/MIGService.Interfaces/Media.CameraInput/IsEnabled.Set/1// [OPEN]
2018-01-26 14:35:54.7437 Debug Enabling Interface Media.CameraInput
System.DllNotFoundException: CameraCaptureV4L
at (wrapper managed-to-native) MIG.Interfaces.Media.CameraInput+CameraCaptureV 4LInterop:OpenCameraStream (string,uint,uint,uint)
at MIG.Interfaces.Media.CameraInput.Connect () [0x0008c] in <5d803dfdf1dc419b9 52079a12c633e3f>:0
at MIG.MigService.EnableInterface (System.String domain) [0x0003e] in <0d2ae85 60a244b2680fb8ebf44c6713f>:0
at MIG.MigService.Gateway_PreProcessRequest (System.Object sender, MIG.Process RequestEventArgs args) [0x000cb] in <0d2ae8560a244b2680fb8ebf44c6713f>:0
at MIG.Gateways.WebServiceGateway.OnPreProcessRequest (MIG.MigClientRequest re quest) [0x00021] in <0d2ae8560a244b2680fb8ebf44c6713f>:0
at MIG.Gateways.WebServiceGateway.Worker (System.Object state) [0x0042a] in <0 d2ae8560a244b2680fb8ebf44c6713f>:0

I wonder does anything stand out here. I can see the messages about the paths not being found
and raspbian_libCameraCaptureV4L.so missing and CameraCaptureV4L not found.


Well, I think that changed build process might led to this issue. V1.1.15 has been built from solution file for Windows. I pulled out missing files from my backup, please, try to put them inside <HG installation dir>/lib/mig/v4l directory:
raspbian_libCameraCaptureV4L.so (128.0 KB)
debian64_libCameraCaptureV4L.so (160.1 KB)
debian64_libCameraCaptureV4L.so.gd3 (196.1 KB)

And this one raspbian_libCameraCaptureV4L.so (128.0 KB) inside <HG installation dir>/lib/mig directory.

I hope that this should fix DllNotFoundException errors.

It’s a dream to have only one .sln file :slightly_smiling_face:
If we are able to achieve this, we will greatly simplify our work.


Thanks Bounz. I’ll try them later and report back. I did think there was missing files on this install.

I noticed during debug a number of “object not set as reference” errors pop up. I used your v1.1.15 version on top of a vanilla install of Debian Stretch Lite. Could you try running Mono Homegenie.exe and have a look at the processes in a terminal and see if you spot anything out of the ordinary. Homegenie is running from the Pi.


Before I press ahead testing with these files I noticed you have included Debian64. Is that correct bearing in mind I’m running a 32 bit system.


I think we can also remove those additional projects that actually create
an empty class library and do solution items and deal with most in the
Appveyor config


Ok Bounz I downloaded and dropped those files into the folders you advised.

Here is a section of the debug after I restarted the Pi

2018-01-27 16:15:58.0644 Info WebServiceGateway HTTP GET 200 /api/MIGService.Interfaces/Media.CameraInput/IsEnabled.Set/1// [OPEN]
2018-01-27 16:15:58.0695 Debug Enabling Interface Media.CameraInput
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.Gateway_PreProcessRequest (System.Object sender, MIG.ProcessRequestEventArgs args) [0x000cb] in <0d2ae8560a244b2680fb8ebf44c6713f>:0
at MIG.Gateways.WebServiceGateway.OnPreProcessRequest (MIG.MigClientRequest request) [0x00021] in <0d2ae8560a244b2680fb8ebf44c6713f>:0
at MIG.Gateways.WebServiceGateway.Worker (System.Object state) [0x0042a] in <0d2ae8560a244b2680fb8ebf44c6713f>:0

It still cannot find CameraCaptureV4L. Where is it trying to find that file. I assume it is looking in the /mig folder which is exactly where it is. This is bizarre.


Could you confirm what the contents of the MIG-V4LCamera_1_1.zip is supposed to be.

As far as I can see that zip file is missing vital files and is of no use to anyone hoping to get the Raspberry Pi camera module working.

I’m thinking now that the v4l driver may have been updated since Gene last done any work on his video4linux interface back in 2015.

When you return from vacation David maybe you will be able to see something that I cannot. I’ve tried everything as per Bounz instructions and am still getting that missing file error in the log.


Just looking through the GitHub for Homegenie and was wondering if this is the file Homegenie is looking for.

Surely the MIG package manager would include this file.


@David_Wallis did you have a chance to connect the Raspberry Pi camera module to see if it works. The MIG installer looks incomplete and I’m wondering if the way the Video4Linux driver is loaded during the boot process in Stretch is causing the issue.

You can see above what I’ve tried to date but still no success.


I’ve been on holiday for a week, and was having the house decorated whilst away - but the decorator hand another week free so he is doing the rest…

The downside is that the house is a tip and I cant get into my office…

The plus side is I now have CAT5 to every light switch apart from my office (which isnt getting decorated just yet and I can do later :smiley: ) with regards to the missing files etc - yes I started looking at this yesterday - just building a new x64 VM with Stretch on so I can have a look at a few things in the build before I get to the PI :slight_smile:


I wonder how many more of the MIG package installers are incorrect or incomplete.

If HG doesn’t keep up with hardware development it will just disappear.

I expected at this stage a lot more contributions from a lot more contributors using a variety of different HA technologies. Raspberry Pi and other similar SBCs have overtaken the desktop/laptop configuration when it comes to home automation. That’s where HG should be targeted at now.

When you get the time maybe you can let me know if you ever get the Raspberry Pi camera module working with Raspbian Stretch.


I blame alot of this on a lack of unit testing, integration testing - but mainly on automated builds… there is no excuse not to have them with the free services - I have a commit almost ready for the interface skelton project that has a sample appveyor file that builds and packages interfaces… I’ve since had another think on how something slightly better could be done though (visual studio template) which I will play with.