Basic D-duino code (OLED, WifiManager)

In a previous blog post I introduced to you the D-duino ESP8266 boards. In this blog post, I’ll show you a small Arduino code which is providing the basic functionality for my next projects.

What’s in the box

I am using the awesome WifiManager library. I will handle the configuration and connection to a WiFi network. If  the ESP is unconfigured or the AP is not reachable, it will start an access point by its own. You can connect to this AP and a caption portal will open. Scan for networks, select one and enter the password. The configuration will be saved in the EEPROM. No need to set the credentials inside of your code.

Over-the-Air update is also implemented. This makes it very easy to update the code without connecting the MCU via USB to the host. It’s also faster than serial uploads.

Last part is of course the OLED display. I am using the ESP8266_SSD1306 library. It has some very nice features like progress bars, several graph commands (lines, shapes etc.), pictures and of text.

(more…)

Read More

DIY IoT Central – Home Assistant / InfluxDB / Grafana

Get started with Home Assistant, InfluxDB and Grafana.

Laying the Foundation

Create several directories to persist configurations, logs & data

You’ll most likely use different directory names – keep in mind that you have to update the docker-compose.yaml too
/share/Container/home-assistant Home Assistant configuration
/share/Container/influxdb InfluxDB Data & Config
/share/Container/grafana/log Grafana Logs
/share/Container/grafana/data Grafana Data

Basic configuration

InfluxDB Generate the default config for InfluxDB

docker run --rm influxdb:1.2-alpine influxd config > influxdb.conf

Now move the influxdb.conf to your config directory (in my case /share/Container/influxdb)

Home Assistant If no configuration is found, Home Assistant will create a basic configuration itself after the container has started.

(more…)

Read More

Use a ESP8266 to control your A/C via MQTT

We had some very (very!) hot days here in Sydney, up to 40 DegC over several days. After a day in the office, you open the door to your apartment and… 50 DegC 🙁 I looked for a solution to cool down home right after i left the office – with my phone – using MQTT 😉

Hardware

I am using three components for my project. The MCU, an adapter board and the IR-LED

NodeMCU

  • ESP8266
  • 4Mbyte ROM
  • On-board USB/UART

Grove Base Shield for NodeMCU

  • 5 Digital connectors
  • 2 I2C sockets
  • 1 Analog connectors (A0)
  • Power indicator LED

ShopWiki

Grove – Infrared Emitter

  • Voltage: 3.3-5V
  • Distance:10m

Shop | Wiki

 

Software

 

The Basics

The project is based on the Arduino core for ESP8266 and uses several additional libraries. I am using the platform.io IDE for development. The advantages are the fully integrated build and deployment process (via USB or over WiFi), the library manager and the code completion and linting. You can download my complete platform.io project here.

You’ll also need an MQTT server like RabbitMQ to send commands and receive the status. If you are familiar with Docker, you should read my previous post Dockerize RabbitMQ to get a server up and running in no time. If not: There are several binary pages on the RabbitMQ Website.

(more…)

Read More

Install rtl-sdr on a C.H.I.P

Check your hardware

First you should make sure that your rtl-sdr stick is properly connected to your c.h.i.p and that your power source is suitable to drive the chip plus the rtl-sdr. Some of them are consuming more than 500mA (which is out of spec for USB2.0) which can cause the system crashing if under load.

Connect your rtl-sdr to the c.h.i.p, login and run lsusb -t. You should see an output like the one on the screenshot below. The last two lines are the rtl-sdr stick.

(more…)

Read More

Setup a C.H.I.P in Headless mode (no screen)

So you got your C.H.I.P but unfortunately you can’t connect to a Display and you don’t have a keyboard available? This guide should help you to get started. You will connect the C.H.I.P to your wi-fi, update the software and install a vnc server to use the gui.

Initial connection

Connect you C.H.I.P via USB to your Computer.

Open your favourite terminal program and connect to the comport with 115200 baud. For windows you can use putty. On OSX i suggest using cu.

On OSX i am using this command sudo cu -l /dev/cu.usbmodem1423 -s 115200

If you’re connected and you don’t see any login screen just hit enter once

Login with the default credentials (chip/chip)

(more…)

Read More

OSX: Use a GUI (X11) app in Docker

Prerequisites

First install socat via brew:

If you don’t have brew installed, just follow these instructions.

Next is XQuartz. Download the DMG from http://www.xquartz.org/ and install it.

 

Preparations

Start socat:

Now start XQuartz. Go to Preferences and enable “Allow connections from network clients”:

 

XQuarts Setting Menu

Quartz Settings

Now find the ip address of our VM. Open virtualbox and go to the settings of your VM. Click to the “Network” Tab.

Screenshot 2016-02-18 21.56.24In my example, the interface we’re looking for is “vboxnet2“.

Lookup the ip by executing “ifconfig vboxnet2” in the terminal.
Screenshot 2016-02-18 21.57.48

Now we’re ready to start Firefox inside of a docker container 🙂

This will download a minimal image (~200MB) and start Firefox

Firefox

Read More

New toys – ESP8266 Modules

Yeah, new hardware to tinker with: a ESP-01 and a NodeMCU Board 🙂

Specs

The ESP8266 is a powerful and cheap SoC (System on a Chip) with onboard WiFi (b/g/n) capabilities. It has 16 GPIO pins, UART, i2c, SPI and QSPI for external flash memory.

ESP-01 Module

esp-01
ESP-01 Module

This very cheap module consist of o ESP8266, A PCB-Trace antenna and an external 1MB flash chip. It’s not breaking out every GPIO pins – just 2 (GPIO0 & 2).

This module has 8 pins: VCC & GND for power, RXD & TXD for serial communication, RST for reset (yeah, really :p ), CH_PD for chip enabled/disable and GPIO0 & GPIO3. This chip is intended for small projects or as a Serial-Wifi bridge.

Be aware: The module has no onboard logic-level-converter. So if you hook up this board to more than 3.3v, you will most likely see magic smoke !

You can get these board for ~3-6 AUD$ from eBay.

 

NodeMCU v2

NodeMCU (ESP8266)
NodeMCU v2

This module is a complete development board. It is utilising a ESP-12E which is basically a ESP8266, 4MB flash and an antenna on one small pcb. This pcb is soldered to the devboard which is powered by usb (3.3v step-down-converter), a USB-Bridge for easy programming and 2 buttons (reset and flash). You can use 10GPIO pins for your own projects – every of this pins is able to provide you i2c, 1-Wire and pwm functionality.

Again: The module has no onboard logic-level-converter for the GPIO pins!

It comes preflashed with the NodeMCU firmware (www.nodemcu.com) which enables you to program this module in LUA. It costs about 8-13 AUD$ on eBay.

 

Outlook

As i have some experience with Arduinos, i’ll most likely try to use the Arduino IDE to program this little friends –  (https://github.com/esp8266/Arduino)

My first Project will be a Wifi-Remote-Controller (infrared bridge) for my Daikin AC

Read More

The best for last: A complete Docker-RPi-RTL-SDR ADSB/ACARS Solution

 

After my last two blogposts [1][2], many of you asked “Why Docker on a Raspberry?” if you can install all the software directly (“There are so much tutorials“). Yeah, that’s right – but think how much work you have to invest to get the following setup running:

sdr_gear

  • Raspberry Pi 2 & 2 RTL-SDR Sticks
    • Nr 1 is monitoring ADSB via dump1090
    • Nr 2 is monitoring ACARS on 2 frequencies via acarsdec
  • FR24FEED (www.flightradar24.com) is taking the data from dump1090 and feeds it to FR24
  • FlightAirMap (PHP/MySQL) is taking the data from acarsdec and dump1090 to generate a comprehensive statistic and live map of your received data.
  • A Mysql server for storing the Data behind FlightAirMap

You need five services which you have to install/compile, to configure, to link and to manage.

But there is a much more convenient solution: docker-compose and one (!) configuration file 🙂

FlightAirMap & dump1090 Screenshots

flightairmap_3
FlightAirMap

flightairmap_2
FlightAirMap

flightairmap_1
FlightAirMap

dump1090
dump1090

(more…)

Read More

RPI + Docker + ACARS: Receive “Aircraft SMS”

After the fantastic feedback i got for my blog post about ADSB reception with RTL-SDR (and Docker), the next point in my list is ACARS.

The basics: What is ACARS?

ACARS is short for Aircraft Communications Addressing and Reporting System, a digital data link between an aircraft and a ground station and/or satellite.

ACARS Terminal
ACARS Terminal

The on-board avionic computer system (aircraft) consists of the ACARS Management Unit (ACARS MU) and a Control Display Unit (CDU) for sending and receiving digital information messages from the ground-based stations.

Ground equipment is made up of a network of radio transceivers managed by a central site computer called AFEPS (Arinc Front End Processor System), which handles and routes messages. Generally, ground ACARS units are either government agencies such as the Federal Aviation Administration, an airline operations headquarters, or, for small airlines or general aviation, a third-party subscription service. Usually government agencies are responsible for clearances, while airline operations handle gate assignments, maintenance, and passenger needs. (Wikipedia)

 

This is a message send by the CFD (Central Fault Display) of an aircraft 😉

#CFB.1/WRN/WN1511161031 383100506MAINTENANCE STATUS TOILET

Or something like this

N12114 CO0070 1EHAM REQUEST GATE ASSIGNMENT ETA0447

You’re now interested how to receive such messages with minimal Hardware? You have your Raspberry Pi 2 ready? Docker installed? RTL-SDR attached? Then read on.

If not, start with my earlier blog posts to get the basics:

(more…)

Read More