Category Archives: Raspberry Pi

Using the ESP8266 module for the Internet of Things

About two years ago, a cheap five dollar microcontroller has been entering the maker scene, featuring b/g/n wireless LAN.  The ESP8266 is manufactured by a Chinese company, called Espressif Systems and became soon very popular as a building-block for home-automation and IoT projects.These modules were distributed on  Ebay, the Amazon Marketplace or AliExpress for a few dollars. However, communication with most of the ESP8266 modules requires an external USB-to-Serial-Adapter and a special procedure to bring the device into “flash-mode”, which can be cumbersome in some cases, especially for beginners. With the brand-new WeMos D1 Mini, the setup was significantly simplified, so that it is as easy to use as an Arduino UNO.

esp8266-12-e1452522744313-300x231

Continue reading Using the ESP8266 module for the Internet of Things

Mastering the Raspberry Pi2 kernel update

As a visitor of many discussion forums about the Raspberry Pi, I recently stumbled upon a lot of cries for help, such as “My RasPi doesn’t boot anymore!” or “Help, my i2c-, spi devices and 1-wire sensors” suddenly disappeared.

Pi2ModB1GB_-compD O N ‘ T   P A N I C!

All of you probably belong to the Raspi lovers, that wan’t  to keep the device’s linux-kernel at a “bleeding-edge” release, doing an “rpi-update” almost every day. Be aware that such a kernel is still tagged as “experimental”, so that it can seriously damage your Raspbian installation. The number of messages is still very high in all discussion forums and a lot of experienced users already became tired in answering the help requests.

To be on the safe site, update your system using “apt-get update && apt-get upgrade” or “apt-get dist-upgrade”, unless you know what you are doing. If your upgrade already has failed, but you’re still able to boot the system, you can roll-back to a previous release with:

sudo rpi-update b2f6c103e5355bee90ff57f55cdf6d7005485a23

The long string represents the Git hash for the specific firmware revision. You can look for those hash in the rpi-update git repos commits list: https://github.com/Hexxeh/rpi-firmware/commits/master.

However, if you want to stay with the latest 3.18 kernel branch, here’s what you can do to solve your problems with i2c, spi, lirc and 1-wire:

Continue reading Mastering the Raspberry Pi2 kernel update

How to plot the frequency of PIR sensor events?

With a PIR sensor one can detect movements within it’s field of view and trigger other hardware, such as surveillance cameras. It is also possible to record the frequency of movements over time, e.g. to monitor motion activity in a room of your apartment.

pir_sensorWith a PIR sensor attached to my RasPi, I recorded motion events by storing UNIX timestamps in a single-column MySQL table. I wanted to visuaize these data points as a histogram displaying the frequency of motion events over time, but this task turned out to be more complicated than expected using GNUPlot. So here’s a short tutorial how it works:

Continue reading How to plot the frequency of PIR sensor events?