Wednesday, March 8, 2017

Detecting motion with RPi

Using OpenCV library and few lines of Python code it's easy to create a simple motion detection with a Raspberry Pi.

This could be accomplished with other methods, like using a PIR sensor, but sometimes you just want to use a webcam without adding further hardware.

For this post I'm using my Sphaera configuration. This means that the video from a PiCamera is available as a web stream, but it would be easy to get your video frames from different sources...

Tuesday, November 22, 2016

OpenVPN on a Raspberry Pi

Sorry if lately I'm publishing really few posts, but this year I've been quite busy planning my weddings, so I have almost no time for everything else...

Anyway in these days I created a simple VPN server on one of my Raspberry Pi (a model 2 B). This small project has been realized for the honeymoon. Let me explain why, before looking at the procedure.

Monday, June 6, 2016

Send photos with Telegram

In the last post we saw how to use the Telegram bot APIs to send a message from a Raspberry Pi to our smartphone.

This time I will show you how easy is sending a photo using the same APIs and the Python library. You can use the same APIs also for sending videos and audio files with really small efforts.

Thursday, April 14, 2016

Using Telegram with Raspberry Pi

Until few months ago to communicate with my Raspberry Pi I used Yowsup that is able to connect to the Whatsapp servers.

Unfortunately this method has several issues that made me choose something different... First of all the need of a sim card or at least a phone number not used for other Whatsapp connections, the frequent changes on the Whatsapp protocol and so to the Yowsup libraries that force you to always check for them and eventually update the software and your scripts also on the RPi and least but not last the fact that Whatsapp do not like that their servers are used with a software that is not their messenger!

There are several different solutions to communicate with a RPi. One that I'm using is Pushover, but it's just a one way system (from RPi to the smartphone). It works quite well if you just need text notifications, but if you need something really like Whatsapp the solution could be Telegram.

Thursday, February 4, 2016

Fish tank and Raspberry Pi

First of all, sorry if lately my posts are published less often than before, but I'm quite busy with several other things and my time for hobbies is quite limited...

Today I will show you a project made for request.

One friend have a small fish tank and he wished to make a really small system, just to check the temperature, pilot lights and few other things .

One Raspberry Pi model A+ was perfect to manage the fish tank with those features, so I decided to start this project and I finished it in few days.

Now this system has been named Aquarius and it's working as it was requested, with some small addition made by myself.

Sunday, January 10, 2016

Adding a sensor zone to Sphaera

My Sphaera project is  nice and useful when used alone, but I designed it to be expandable quite easily by adding more Raspberry Pis to the LAN

Also, with the new extremely low cost Raspberry Pi Zero You can add several expansions at an affordable price without sacrifying system performance, as this new board has the same performances of an A+ model.

In this article I will show you just one example of configuration, but adding a new Raspberry Pi would be almost the same for any number of them.

It will be a short and surely not complete description, but could give you a starting point for building something similar. Anyway if you have some question about it, just ask.

Thursday, November 5, 2015

Raspberry Pi and astronomy

This time I selected a topic a bit different from usual. After all the blog is about experiments and not only home automation, with RPi...

Since I was a child I've always loved astronomy. I own a small telescope and I took several photos with film cameras, but now I can go a step further thanks to my RPi.

Tuesday, October 6, 2015

Watchdog for Raspberry Pi

Maybe not all of you know that Raspberry Pi has an integrated watchdog timer. This can be really useful, especially when you need to leave your RPi unattended for some time.

For those who doesn't know what is a watchdog, let's see just a small explanation...

Immagine that you made an incredibily wonderful home surveillance system and you are going to use it to check your house during an long trip abroad. After a bunch of days, something goes wrong and your system hangs, so it become unuseful. The only way to solve this problem would be to reboot the system, but you are away from it...

Watchdogs do this reboot for you.

Tuesday, September 22, 2015

Make Raspberry Pi SD card last longer

If you have one Raspberry Pi always on or running several hours every day, probably you also had some SD card faults.

Unfortunately SD cards have a limited number of writings allowed. After that number the internal electronics is no more reliable and there could be read/write errors.

Debian usually do several writings on the os partitions, so the maximum writing cycles is rapidly reached.

So, what could we do to make the sd last longer with our RPi?

Thursday, September 10, 2015

Using AirPlay with Raspberry Pi

AirPlay is an Apple protocol which allows wireless streaming of audio, video, photo and so on. Even if it's a proprietary protocol, it can also be used with Android devices or personal computers by installing simple apps.

Of course you can also install AirPlay on a Raspberry Pi.

When I built my Sphaera, I also added an external audio card, an audio amplifier and a speaker. Initially I used this audio system just for some notification, but going from that to a wireless speaker it really easy.

Wednesday, August 12, 2015

Home automation server - Sphaera

When I showed you my RaPiRo some post ago I explained why I would not use it as a case for my home automation server.

Let's summarize just something...

First of all the power. 12 motors are quite "hungry" and this means that using batteries is not an option if you need to keep it active all the day. You need to power with a plug, so it's mobility would be greatly limited.

It's noisy. All that motors can be quite annoying.

It can detect movement, but only when it's not moving itself, so it can check just a small area at a time.

There are other cons, but these are enough to let me think about a different solution for my home automation server.

Monday, July 20, 2015

Push notifications from Raspberry Pi

Often it's useful to just receive information from a Raspberry Pi. Surely Yowsup could be nice, but you need a phone card and also it's not a simple system to use.

Setting and using Whatsapp with Yowsup can be a nightmare and sometimes it seems a bit unreliable. I do not know if it's a Yousup issue or maybe from how I use the libraries (but I found other Yowsup users with similar problems).

If you just need to receive information from the RPi, without sending them, the solution could be using push notifications. These are messages sent to your smart device. The device can be configured to inform you of the incoming message as soon as this is received.

I searched a lot for different ways to get info from my RPi. One of the best systems I found seems to be Pushover.

Wednesday, July 8, 2015

Launch Python script at boot

Sometimes we could need to start a Python script when Raspberry Pi boots up in a full autonomous way.

RPi could be really useful if used headless, without a direct user interaction (at least when starting the system), so if we created a script for a RPi that needs to be executed at startup, we also need a way to accomplish this task.

In this post I will describe a way to execute a Python script (but this works also for every other kind of software) when booting the RPi.

Wednesday, June 17, 2015

Webserver on Raspberry Pi

There could be tons of reasons to configure a webserver in your home. From a simple blog (personal, just like a diary, or public if you wish to share your thoughts with the web) to host for an home software repository, a web developing ambient and so on.

For an home automation system, a webserver is probably the easiest way to access your house when you are away.

A Raspberry Pi is a quite useful piece of hardware if you need a small webserver. It shouldn't be used for big systems, where hundreds of people needs to connect at the same time and a lot of data is transferred through the network, but for small tasks is perfect!

Now with Raspberry Pi 2, things are getting even better as this new version is much more powerful than the original one.

Friday, May 29, 2015

Yowsup server

This time I wish to share some thought with you about an evolution of my projects. No need to code something for now...

In all my previous posts about Youwsup and Whatsapp messaging I always assumed on thing: chatting involved just one Raspberry Pi.

Anyway I own more than one RPi. What if I wish to use Whatsapp with more than one device?

Friday, May 8, 2015

Raspberry Pi Robot (RaPiRo)

Ok, after spending almost a month doing many things not related to Raspberry Pi and home automation, I wish to  show one of the latest projects about RPi: RaPiRo (contraction of Raspberry Pi Robot).

This is a really nice small robot that can be 3d printed at home without too much trouble (if you wish you can also buy the full kit, but it will cost you much more).
By printing the shell and using many parts I had at home, I got this nice item at a really low cost.

But you may ask what this robot has to do with home automation.... Well, let's se how it could be used.

Wednesday, March 25, 2015

Face detection with Raspberry Pi

One nice thing that can be done with the latest technology is a really powerful image analysis. Also using a small unit like a Raspberry Pi can be enough to create tasks such as face detection and recognition.

These two tasks are quite similar. Detection is just the task of finding a face in an image (could be static image or a frame from a video stream). Recognition is finding a known face in a picture. 

For this post I will show you how to configure a small face detection system using a RPi and a PiCamera.

Tuesday, March 3, 2015

Send vocal message using TTS and Yowsup

Last time we saw how to install PicoTTS to make our Raspberry Pi speak. Using PicoTTS (or any other Text To Speech engine you like) and the Yowsup class to send media files that we already used for pictures, we will be able to send vocal messages from the RPi, instead of just text answers.

In the future, if Whatsapp will really enable audio calls (and Yowsup will support them), it would be possible to integrate also a vocal recognition module, so we could ask something to the RPi directly, with just a call and hear the answer.

What a wonderful task from such a small device!

Thursday, February 26, 2015

Installing Pico TTS

Sooner or later you may wish to hear your Raspberry Pi speaking.

It's nice to get messages from your RPi by Whatsapp, or reading on a small display (or TV), but hearing this device answering you with a real voice could be amazing!

There are several TTS (Text To Speech) engines avaliable for a Raspberry Pi and you can find a list here.

Usually offline engines suffer from low quality voices (and sometimes limited languages avaliable). On the opposite side, online TTS engines could have really high speech quality, but you need an internet connection (and your recorded voice will be analyzed from someone else).

Thursday, February 19, 2015

Sending pictures with Yowsup

One feature that could be quite useful in home automation is the ability to send pictures took with a webcam to our smartphone.

This could happen on request, by just asking to take a photo with our parser, or automatically when the script is programmed to do that (at specified intervals or maybe when detecting movements).