[TUTORIAL] Using the official Raspberry Camera module with Gladys

Hello everyone,

I’m offering you this mini-tutorial to quickly and easily use the official Raspberry Foundation camera module. I personally use the v2 8MP (https://www.kubii.fr/cameras-accessoires/1653-module-camera-v2-8mp-kubii-640522710881.html) but the new modules will also work.
To create the rstp stream, run the following commands (more info here: Surveillance camera with Raspberry Pi – Sylvain Durand):

sudo apt-get install cmake liblog4cpp5-dev libv4l-dev
git clone https://github.com/mpromonet/v4l2rtspserver.git
cd v4l2rtspserver/
cmake .
make
sudo make install

To launch the server, simply run:

v4l2rtspserver -H 972 -W 1296 -F 15 -P 8555 /dev/video0

To have the server start at each system boot, replace the ExecStart option with the previous command using the command:

sudo nano /lib/systemd/system/v4l2rtspserver.service

You can now configure your camera in gladys (Camera | Gladys Assistant) with the video link: rtsp://RASPBERRY_IP:8555/unicast

Hello @Exilon62, thanks for this tutorial!

If you want to help us even more, it would be great to add this compatibility natively to Gladys without any tweaking. We really avoid tweaking in Gladys v4.

Given how simple it is to set this up, it would be nice to have a small « native camera » service that handles this automatically :slight_smile: Do you think you can help us?

Does it work with infrared cameras too?
This means that we can set up a scene with motion triggering (with a sensor) that takes a photo, or starts recording and sends a notification via Telegram.

If you want to help us even more, it would be great to add this compatibility to Gladys natively without any tinkering, we really avoid tinkering in Gladys v4.

Yes of course! I’ll look into it this weekend to see how to integrate this new service :slight_smile:
But by creating a new service directly, I think we can access the camera directly without installing anything else, with this tutorial I create an rtsp server that adds unnecessary latency to use the Gladys camera module

Does it work with infrared cameras?
This means that we can plan a scene with motion triggering (with sensor) that takes a photo, or triggers the video and sends a notification via Telegram.

It seems to me @Tlse-vins that these are the same commands (raspivid) included with Raspbian. Precisely, my goal was: every time my front door opens (xiaomi sensor) which does not recognize my nut keychain, I send photos via telegram of the person opening the door.

I love it!!
I have a Netatmo camera but for now there is no service for this brand or the camera.

Even better! :slight_smile:

Don’t hesitate if you have questions while developing the service.