Preparing the remote control app for Christmas

Winter is soon to arrive in Sweden and the amount of daylight is decreasing every day. Thus it’s time to set up some extra light sources indoors and outdoors. I have been using my web app for remote controlled outlets (link) for some months now, but with the additional light sources needed for this time of year, I have to extend the application. As Sweden goes into the dark season I would also like to have an on/off schedule for some of the lights so that they are turned on/off automatically according to a set of specified events.

Continue reading →

Advertisements

A web app for IoT data visualization

As described in some earlier posts, I have a setup at home with IoT devices that publish measurement messages to a Raspberry Pi via MQTT. The RPi stores the data in a database and also forwards the messages to a cloud service (Adafruit IO).

In this post I have made a self-hosted data visualization web app that can be accessed from any browser-enabled device.

Continue reading →

A self-hosted MQTT environment for Internet of Things – Part 1

MQTT (MQ Telemetry Protocol) is a lightweight machine-to-machine communication protocol that works on top of TCP/IP and it is very much suited for usage in an Internet-of-Things scenario. MQTT uses the publish-subscribe pattern where the clients subscribe to topics and publish messages through a broker. There are many different framework implementations of MQTT as well as complete cloud services that use MQTT (Adafruit IO, CloudMQTT, ThingMQ etc). The cloud services are nice and easy to use, but if you don’t want your data uploaded to a third party storage, you can host an MQTT environment yourself and have full control of the gathered data. Even if you decide to upload data to the cloud, the local MQTT environment can work as a gateway where data goes out to the Internet only from one single place on the Intranet. This makes it easier to control and change the outgoing data flow.

In this post I will show how I have self-hosted an MQTT environment with the help of a Mosquitto broker running on a Raspberry Pi and let two different ESP8266 microcontrollers publish sensor data through the broker. I will also use the Raspberry Pi as a subscriber for the messages, and these data will be persisted in a MongoDB database. Another subscriber will route the messages to a cloud service.

Continue reading →

Daemonize that Python script!

This post builds on a previous experiment where I made a remote control app for my outlets with a Raspberry Pi, Python/Flask and AngularJS. For the backend to be really useful, I want to make it behave as a service in Linux. It should start automatically after a reboot and there should be some control mechanism for manually starting, stopping and viewing the status of the service. There should also be a proper logging in place.

Continue reading →

RCSwitch revisited – control RC outlets with a web app

In two previous posts, I used the RCSwitch and pi-switch libraries for communication between an Arduino Uno and a Raspberry Pi. I touched briefly on the main purpose with these libraries – to control RC outlets. In this post I will dig deeper and decode the RC signals so that the remote control can be replaced by a web app running on any browser-enabled device.

Continue reading →

Arduino to Raspberry wireless communication – some improvements

In my previous post, I experimented with sending measurements values from an Arduino UNO to a Raspberry Pi via a 433 MHz radio protocol. After testing the setup for a few days, I decided to make some improvements:

  • Add an additional sensor for measuring outdoor temperatures. Now there will be four different sensor values transmitted from the Arduino to the Raspberry Pi.
  • Add the possibility to send float values for more precision and, for adopting to the Swedish climate, allow negative values.
  • On the receiver side (the Raspberry Pi), add storage of the values to a csv file so that the measurements can be visualized in graphs with Excel or a similar application.
  • Improve the noise tolerance.

Continue reading →