LibreElec – Pi Camera Mjpeg Streaming

Following the setup of a Cent OS CCTV server, I’ve been using Raspberry Pi’s as video sources. But what if there was a Raspberry Pi in perfect situ for a CCTV camera, but was already in use as a media player?

A Linux system has always had the impression that it is versatile, so this should be an achievable task. A barrier would be how to get this done with the operating system installed, in this case it is LibreElec, an OS with the tagline “Just enough OS for Kodi”. Therefore, it would be more of a challenge than a usual Debian install.

The team at LibreElec saw this type of thing coming, and included the Docker service as a Kodi addon to allow the curious tinkerer to add more than Kodi to a Pi.

If you have the LibreElec based Pi in the opportune placement to add a camera, here is how to add Mjpeg streaming capabilities…

Continue reading “LibreElec – Pi Camera Mjpeg Streaming”

Motioneye – Cent OS CCTV Server

If you’d ever searched for Raspberry Pi projects that involved a camera then the results would certainly include Motioneye OS, an easy to use self-contained operating system that is truly (write then) plug and play.

Looking for a CCTV project earlier this year I too was drawn in by this, and with my small abundance of RPi spares it was the cheapest choice, using a couple of RPi 3B+ for video, and a Zero W for time-lapse image capture. All processing was self-contained on each Pi with capture data passed over via SMB to a Windows file share.

This worked, but had a couple of problems that prevented it from being trustworthy. Firstly, it stops recording video after a few days of uptime, by creating empty files. And secondly the time-lapse camera seemed to reset every few minutes that created in white out image capture as the camera’s exposure setting recalibrated, ruining a time-lapse video.

Looking wider there was also the performance issue. In Motioneye OS’ default state of managing all features, the highest FPS seemed to max at 15 fps even on the Pi 3B+. Forums suggest this is due to the motion eye daemon handling all the image processing in software, putting a strain on the Pi’s modest CPU.

The idea and goal is to move the processing and IO responsibilities to my server, which would be far more capable than the then latest available RPi, and as I have chosen Cent OS to be my go-to Linux OS of choice, this is what I’ll be using.

A gateway to make this possible is an option in Motioneye OS, Fast Network Camera. This when set relinquishes the Pi of all processing duties and serves to just stream the camera capture as best as possible via MJPEG.

Here’s how to set up Motioneye on a Cent OS server to be a central data hub for a network of RPi Motioneye OS cameras.

Continue reading “Motioneye – Cent OS CCTV Server”

OSMC on Pi 3A+ Problems – Switch to LibreELEC

For years, since it was XBMC on the original Pi I have been using OSMC as my Raspberry Pi media player. And following on from a whole home Pi redeployment for to include a CCTV system the latest installment was to install OSMC to two Raspberry Pi 3A+.

Raspberry Pi 3A+

Raspberry Pi 3A+

The Pi 3A+ plus is the cut down little brother to the latest 3B+ much akin to the original Pi B and A models. Both have the same quad-core ARM v8 processor, Broadcom Videocore-IV GPU and importantly the 2.4GHz and 5GHz 802.11b/g/n/ac Wi-Fi module for faster and stable WIFI out of the box. What’s cut down is the RAM, halved at 512MB, USB ports are reduced to one due to the removal of the onboard USB and gone is the ethernet port.

All the power without the ports make its perfect as a media player, all that’s needed to connect is the HDMI, with remote control provided via a CEC equipped TV.

The issue with OSMC

Here are the issues I experienced with OSMC on the Pi3A+, this is in no way a snarl at the developers who are doing an amazing job. I believe the 3 A+ is still a new and niche model so it’s understandable that development is slow for this product. I’m just hoping this will eventually be looked into and resolved, and putting it out there in case others have the same issue. Performance on the 3B+ is still exceptional.

From boot, selecting a 720p file (via Samba and h264 encoding) is fine, with subsequent auto-play files playing with no issues. However, with the next selection the issues start, selecting a file loads it but doesn’t play, having to go to the main menu and selecting Full-Screen to play the file. But then it buffers constantly. On the third play this workaround fails, and selecting Full-Screen results in a black screen.

In addition, even from boot any 1080p content fails to play with a black screen in its place, and playing h265 encoded files results in an immediate system crash.

480p content remains unaffected and plays perfectly.

LibreELEC to the rescue

Without resorting to buying a 3 B+, your media experience can still be made on 3 A+ by using LibreELEC, an alternative to OSMC that has the same goal of getting Kodi on the Raspberry Pi.

Continue reading “OSMC on Pi 3A+ Problems – Switch to LibreELEC”

RPi kills my internet

It was all going so well, got my Raspberry Pi and after the initial fiddle with Debian Squeeze I got another SD card and put Raspbmc on it, things were great!

Only niggle in my head was that the card I put Raspbmc on was 8GB, and that bigger card would be put to better use in my camera that was using a 4GB card. I thought it would be no problem to reformat cards and swap them over?

Wrong!

The 8GB in the camera was fine, and I used the Raspbmc installer as before to load it on the new SD card. The trouble was that when first booted up the Pi, it seemed to freeze on the

Sending HTTP request to server

No problem I thought, hop on my laptop and find out if other users experienced the same. But low and behold the internet on my laptop ceased to to work, with strange requests for proxy passwords to sites like Facebook and even the Weather gadget on Win 7!

First thoughts were that I cooked my router, as I been downloading a lot and on a warm day to (yes there was a warm day … I think!). But after it was off for as long as I could stand, powered it back on and normal service was resumed.

After rebooting all network equipment it finally dawned that the internet would go down for everything connected to my network when the Pi was powered up! I had never experienced this before and could not for the life of me fathom it out. I thought that it had a defect in the Pi meant that some sort of power surge was knocking out the system? This was quickly dismissed as local traffic was unaffected, meaning the network hardware was operating normally.

A quick glance at my Sky broadband supplied Sagem F@ST 2504 modem showed the internet connection had failed, with the internet indicator glowing orange with a red pulse every second. Stranger still, upon unplugging the Raspberry Pi, connection to the net restored within  seconds!

Drawing4

So how can a network device have the ability to target and destroy an internet connection? Its my understanding that a Pi has no ability to retain settings other than whats stored on a SD card, but this issue continued when using two different memory cards.

Drilling down to an extreme form of troubleshooting, all network devices, including my second switch/access point was disconnected from the Sagem router. leaving just the Pi connected. Then from Midori on Debian Squeeze (remembering that the internal network was unaffected) rebooted the router using the web interface.

Suddenly the Pi could connect, attaching my whole network back together I found that everything was back to normal,

Laptop, Pi, iPhone, everything!

And this is the worst thing, I don’t know what caused this, and what I specifically did in the reboot process that solved it?

So I would love to hear if this has happened to you, and if there was something you can pinpoint as the issue? This one has got me completely stumped!