Saturday, November 19, 2016

ActoSenso - My Automation Project - System Overview

Introduction

Over the past few months I have created an easily expandable, well scaling and easy to optimize solution for controlling and otherwise bringing together a wide range of disparate devices.

With it one can gather data from all kinds of sensors (e.g. light, noise, pollution, position, etc) to keep a log, or aggregate data and display them in a centralized manner as well as make things happen in real life, for example lock/unlock things, or manage a workflow.

In the following few articles I would like to share it in the hope some may find it useful and inspirational.

More than a year ago (as many others interested in embedded electronics and gadgets) I started experimenting with some ESP8266 based modules, starting with the ESP-01 module. I soon moved on to more powerful modules such as the ESP-07, ESP-12, ESP-12E, WROOM-02 and lately I have been working with the ESP-12F modules. These modules have progressively more on-board flash memory (for programs), more GPIO available for the end user (me), and also have better antennas. Since these modules are ridiculously inexpensive (less than USD 3 a piece) compared to their abilities, I constantly keep an eye on any new versions that may be even better.

Unfortunately (and this is probably the only bad thing I can say about these modules), most modules' pin spacing are not 0.1mil (2.54mm), making them difficult to use them on breadboards, so they need some sort of an adapter. Some of these modules are pin compatible with each other (or very close to that) so I created a couple of development boards to speed up prototyping.

Development board for ESP8266 development

Solder side of ESP8266 development board

Using these development boards (or breakout boards) I have created some basic projects, each focusing on a certain aspect of the ESP chip. Then it occurred to me: Why not combine all of these and create something more flexible, more useful?

This is how ActoSenso Platform was born.

Monday, February 29, 2016

Installing OpenWrt on D-Link DIR-600 Router

Introduction

The D-Link DIR-600 is a consumer grade router. Although it's not a new model, it is still a very capable router at a price tag and feature set that is difficult to beat. Also, OpenWrt can be installed on it to make it even more capable and more configurable.
The DIR-600 comes in several different hardware revisions. My router is B5. This is important as each hardware revision requires a slightly different approach.
Hardware version: B5

Friday, May 22, 2015

Internet of Things (IoT) with ESP8266 - Proof of Concept

Introduction

Recently, I finished my first, usable IoT prototype on a breadboard. It is a simple unit, consisting of an LED (emulating a digital output) and a switch (emulating a digital input). Many of the IoT applications can be traced back to this simple application, so even if a particular application needs more than the capabilities of my prototype, the processes, methods, modules and practices described below are likely applicable to any IoT application/project.
The ESP8266-01 on a breadboard, complete with power supply and some simulated environment (LED, button).

Saturday, May 16, 2015

Installing Mosquitto for Use with ESP8266

Introduction

I am working on a home automation project which required I installed Mosquitto, an open source MQTT broker, on my Raspberry Pi. Installation went smoothly, so a few minutes after first hearing about Mosquitto it was ready to be used on my RPi.

Next, I tested it by subscribing to topics and publishing messages from different SSH sessions, all without a problem.

Problem

When I configured my ESP8266 to communicate with this Mosquitto broker, it could not connect to it. Interestingly, my ESP8266 could successfully communicate a test broker on the internet at test.mosquitto.org. This was really weird, as usually stuff works locally and migrating to the internet things tend to break, not the other way around.

Looking through the logs I found the following errors:
May 12 12:01:47 dev mosquitto[2316]: New connection from 192.168.1.141.
May 12 12:01:47 dev mosquitto[2316]: Invalid protocol "MQTT" in CONNECT from 192.168.1.141.

Solution

A quick research on the internet revealed that I am not the only one with this problem, and that the root of the problem is that the version of Mosquitto that's in the debian wheezy repositories is not compatible with the version the ESP8266 uses.

The following steps need to be taken to correct the problem (taken from http://mosquitto.org/2013/01/mosquitto-debian-repository ):

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key sudo apt-key add mosquitto-repo.gpg.key

cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
sudo apt-get update
To display what version of Mosquitto is installed you can use the following:
sudo apt-cache search mosquitto
As soon as I restarted mosquitto the ESP8266 could connect to it with no problem.

Now the logs contain much friendlier messages:
May 12 19:05:37 dev mosquitto[3315]: New connection from 192.168.1.141 on port 1883.
May 12 19:05:37 dev mosquitto[3315]: New client connected from 192.168.1.141 as viktak (c1, k60).


Sunday, May 10, 2015

Fridge Magnets from your Own Photos

Introduction

This is not a pure DIY project in the sense I also used a third party company to achieve my goal. Nevertheless, it's a fun and pleasant one if you like photography as I do (I am also a photographer). In this article I will describe a novel way of using your favorite photographs.

A sheet of my very own fridge magnets

Searching for the new stuff

I am currently in the process of organizing a photographic exhibition of my own photographs. While looking for printing services online I came across a few companies who do prints on special materials, like wood, leather, stone, etc. I immediately liked the idea of "jazzing up" the exhibition with some merchandise other than a catalog of the exhibits, but I wasn't very warm about pictures printed on, say, a piece of wood. After some more digging I found a German company called PicPack printing images on fridge magnets. The price also looked OK for a test run, so I decided to do a test run to see if the quality is up to my expectations.

Below I am going to share my experiences and thoughts with this test run. Also, had I read an article like this before I used the service I review here, I would have had much better results for the first try. So I hope this will be useful for some.