Skip to main content

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.

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.

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.

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)

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

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

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:

Read More

Docker on a Raspberry – Q&A

Soon after i published my last blogpost (Raspberry Pi + Docker + RTL-SDR) i received a bunch of feedback, questions and critic.

“Why not just compile the applications directly?” – “I may be missing the point here but why bother with Docker on the Pi?” – “It does nothing to help the Dump1090 program at all.”

So I’d like to adress some of the points in this post and explain my motivation for using Docker.

 

Let’s start right away with the most controversial question: Why Docker on a Pi?

Well, because it’s possible 🙂 About two weeks ago i stumbled over a blog post from the guys at Hypriot. They not only managed to install Docker on a Raspberry, they also packaged a nice and easy to use SD-Card image which i used for my first experiments. I already have some substantial background in terms of Docker as we’re using this in larger scale in our company. The concept of Containers and Images is a nice fit if you want to build an orchestrated and reproducible toolchain for you RTL-SDR – Build your Image, upload it to the docker hub – the next time you’re reinstalling your Pi (or installing a new one) you just have to run one command and the exact same version, incl. all the dependencies will be downloaded from the hub and ready to use in minutes. So no problems with outdated Howtos, updated libraries, missing git repositories etc.

Read More

Raspberry Pi + Docker + RTL-SDR

In the last days, i tinkered with different things: I installed Docker onto a Raspberry Pi 2, built several docker images [1][2] and got myself two new RTL-SDR-Sticks.

Today, I’ll bring all these Projects together and show you how to build a virtual aircraft radar (screenshot) – so fasten your seatbelt 😉

DUMP1090
DUMP1090 Screenshot

I’m ready – tell me what I need

  • You’ll need a Raspberry Pi 2  – yes, 2! – Of course, you can go with a Pi 1 – but to be honest, this thingy has just not enough ram and only one core so it’s not really suitable for docker. But hey, if you like the pain – go on 😉
  • The Pi has to be prepared to run Docker – You can use the guide from my blog post if you need help
  • And of course you need a RTL-SDR Stick – so if you ever watched DVB-T on your Laptop, the chances are good that you already have a suitable Receiver. Some people over at Reddit compiled a nice list of sticks which are suitable for our little experiment. Oh, and an Antenna would be awesome 😉

List completed? All points checked? Great, let’s go on!

Read More