DNS Tunneling with an ESP8266

There’s a big problem with the Internet of Things. Everything’s just fine if your Things are happy to sit around your living room all day, where the WiFi gets four bars. But what does your poor Thing do when it wants to go out and get a coffee and it runs into a for-pay hotspot?

[Yakamo]’s solution is for your Thing to do the same thing you would: tunnel your data through DNS requests. It’s by no means a new idea, but the combination of DNS tunneling and IoT devices stands to be as great as peanut butter and chocolate.

DNS tunneling, in short, relies on you setting up your own DNS server with a dedicated subdomain and software that will handle generic data instead of information about IP addresses. You, or your Thing, send data encoded in “domain names” for it to look up, and the server passes data back to you in the response.

DNS tunneling is relatively slow because all data must be shoe-horned into “domain names” that can’t be too long. But it’s just right for your Thing to send its data reports back home while it’s out on its adventure.

Oh yeah. DNS tunneling may violate the terms and conditions of whatever hotspot is being accessed. Your Thing may want to consult its lawyer before trying this out in the world.

IoT Enabled Thomas The Tank Engine

This month the popular “Thomas the Tank Engine” toy celebrated its 70 anniversary. As a fun project, [tinkermax] wanted to bring this traditional toy into the age of IoT, while preserving its physical appearance and simple charm.

He used a model called the “Diesel” which seemed big enough to house the electronics, but proved otherwise once he inspected the innards. He needed to fit in an ESP8266 module, an accelerometer breakout, some discrete parts, a nifty analog multiplexer, and a 14500 3.7V LiPo. Once done, he was able to control its speed remotely over WiFi, with an auto “throttle-boost” that kicks in when the accelerometer senses that the train is going uphill, and has remote monitoring of battery state, engine load, inclination and track vibration – all in real-time using MQTT over WiFi. It’s quite a demonstration of the power of these super-cheap WiFi modules that are powering the current wave of IoT innovation.

The train motor works off a single 1.5V battery, so [tinkermax] tried a couple of boost converters to get the ESP-12 to work. But the modules were a tad bigger, and couldn’t provide the high peak current needed by the ESP-12. So he used a 14500 3.7V LiPo battery instead. A series diode drops the LiPo voltage to a circuit friendly 2.9V ~ 3.6V range. The ADXL345 accelerometer is used to measure “pitch” to detect going up and down a hill, “roll” to check for tilt or tip over and vibration to identify track defects. It communicates with the ESP-12 using a special Lite-SPI library that he wrote.

Two analog measurements are performed. One uses a resistor in series with the PWM driven motor to measure its current, with a low pass filter to smooth out PWM noise. The other is a resistor divider network used to monitor battery voltage. But the ESP-12 has just one ADC channel. Instead of adding another ADC module, [tinkermax] used a neat device – the FSA3157 – which allows two analog inputs to be channeled to a single output much like a SPDT switch. One PWM output is used to control motor speed and a second one to pulse a LED.

The sensor data is streamed 5 times a second over the MQTT protocol to a Raspberry Pi based MQTT broker. Finally, a JavaScript webpage receives the MQTT messages and plots the data graphically. One upgrade he would like to implement is speed measurement, to allow constant speed drive. If you have any ideas on how to extract that information from an accelerometer, chip in with your comments below. Check out his build log in the short video below. And if you’d like to see how all of this can be used in the real world, check this other video where [tinkermax]’s colleague gives a run down about a commercial enterprise IoT cloud platform hooked up to Thomas the Tank Engine.

Continue reading “IoT Enabled Thomas The Tank Engine”

Hackaday Prize Entry: Telling Dad The Stove Is Off

A month ago, Hackaday landed at the NYC TechCrunch Disrupt, a bastion of people up all night on MacBooks and immense amounts of caffeine and vitamin B12. For 20 hours, everyone was typing away trying to build the next great service that would be bought by Google or Amazon or Facebook. Tucked away in one small corner of the room was the Hackaday crew, giving out dev boards, components, and advice to the few dozen hardware hackers at Disrupt. [David], one of these Hackaday enthusiasts won the Twilio Sponsorship Prize at Disrupt, and now it’s a Hackaday Prize entry.

[David]’s dad has a little bit of paranoia of accidentally leaving the stove on. This usually manifests itself a few minutes after leaving the house, which means turning the car around just to make sure the stove was off. At the TechCrunch hackathon, [David] built a small IoT device to automatically read the temperature of the stove, send that off to the Internet, and finally as an SMS via Twilio.

The hardware [David] is using is extremely minimal – a thermopile, a gas sensor, a WiFi module, and a microcontroller. There’s a lot of iterations in this project, with [David] looking at everything from TI MSP430s to Teensys to Arduinos to ESP8266 modules. Still, rough prototype thrown together in 20 hours is all you need to win the Twilio prize at Disrupt, and that’s more than enough for a very good Hackaday Prize entry.

The 2015 Hackaday Prize is sponsored by:

Massive Microsoft Machinations For Makers

If you’re not stuck in the tech news filter bubble, you may not have heard the Microsoft Build Developers Conference is going on right now. Among the topics covered in the keynotes are a new Office API and a goal to have Windows 10 running on a Billion devices in a few years.

There are, however, some interesting things coming out of the Build conference. Windows 10 is designed for hackers, with everything from virtual Arduino shields running on phones, Windows 10 running on Raspberry Pis, and Visual Code Studio running on OS X and Linux.

This is not the first time in recent memory Microsoft has courted the maker market. Microsoft begrudgingly supported the hardware dev scene with the PC version of the Microsoft Kinect, and a year or two ago, Microsoft rolled out drivers for 3D printers that were much more capable than the usual serial interface (read: the ability for printer manufacturers to add DRM). To the true, tie-die wearing, rollerblade-skating, acoustic coupler-sporting, Superman III-watching hackers out there, these efforts appear laughable – the product of managers completely out of touch with their audience.

Depending on your perspective, the new releases for the Arduino, Raspberry Pi, and other ‘maker-themed’ hardware could go one way or the other.

As far as educational efforts go, the Windows Remote Arduino and Windows Virtual Shields for Arduino are especially interesting. Instead of filling a computer lab up with dozens of Arduinos and the related shields, the WVSA uses the sensors on a Windows 10 smartphone with an Arduino. Windows Remote Arduino allows makers to control an Arduino not through the standard USB port, but a Bluetooth module.

If Arduinos aren’t your thing, the Windows 10 IoT preview for the Raspberry Pi 2 and Minnowboard Max is out now. The Win10 IoT distribution does not yet have working WiFi or Bluetooth, making it the single most useless operating system for Internet of Things devices. It was, however, released at the Build conference.

Also announced was a partnership with a fabulous hardware project hosting site, Hackster.io. Microsoft and Hackster.io will be collaborating with hackathons and other events focused on Windows technology. I get why they wouldn’t want another, vastly more popular project hosting site doing this, but I’m a little confused at why Instructables wasn’t the top Microsoft pick.

As always, you may express your infinite derision in the comments below. Spelling Microsoft with a dollar sign will result in a ban.

Kickstarting Even More Router-Based Dev Boards

The latest and greatest thing makers and IoT solutions is apparently router hacking. While most Hackaday readers lived through this interesting phase where Linksys routers were used to connect sensors and other such digital bits and bobs to the Internet a few years ago, SOCs have improved, and now there are router-based dev boards.

The latest is the Onion Omega, an exceptionally tiny board just under two inches square. Onboard is an Atheros AR9331 chipset – the same found in a number of cheap WiFi routers – attached to 32 pins breaking out GPIOs, SPI, I2C, and USB. With WiFi and Ethernet, this is a board designed to connect sensors, motors, actuators, and devices to the Internet.

This is not the only recent router-based dev board to make it to the crowdfunding sites. A week or so ago, the Domino hit Kickstarter, featuring the same AR9331 chipset found in the Onion Omega. The Onion does have a few things going for it – cloud integration, a web-based console, and an app store that make the Onion vastly more useful for the ‘maker’ market. The Domino has a boatload of pins available, and competition is always good, right?

Internet of Cowbell

If this is a sign of the times, the Internet of Things promises a lot of entertainment for hackers who can come up with wacky ideas and interactive projects. [Brandon] built a cowbell that rings when you tweet #morecowbell. Why? Because!

On the hardware side it is quite simple, and can be built in a number of different ways depending on the parts you have lying around. [Brandon] used an Electric Imp and its corresponding breakout board. A Sparkfun mini FET shield helps drive the solenoid that hits the cowbell. And because he had one lying around, he added a counter across the solenoid to count the number of times the Twitterati have rung the Cowbell.

The code for the Electric Imp consists of two parts – the “agent code” that runs on a server in the Electric Imp Cloud and the “device code” that runs on the imp itself – and is available at this Git link. Once you tweet with the hashtag, the Cowbell replies back, randomly selecting one from a list of stored responses. Would be nice to see a video of the Cowbell in action. And if it can be made to play the Salsa beat.

Another Radio Module for IoT fun – EMW3162

The availability of cheap radio modules is making them ubiquitous in an increasing number of projects that we have been seeing recently. The usual go-to solution is using any one of the several modules based on the ESP8266 device. [Willem] wrote in to share with us his experiences with another radio module – the EMW3162 from MXChip, which at $10 isn’t as cheap as the ESP8266 modules, but is a more capable, power packed, device.

The EMW3162 (PDF datasheet) is a low-power embedded WiFi module with integrated wireless LAN, and a STM32F205 Cortex-M3 microcontroller that runs a “self-hosted” WiFi networking library and software application stack. The microcontroller has 1M flash, 128k RAM and runs at 120MHz. And since MXChip is a Broadcom partner, they are allowed to use the WICED_SDK.

The on-board ARM M3 means all kinds of useful interfaces are available: UART, SPI, I2C, ADC, DAC, PWM, TIMERS, GPIO, and a JTAG flash interface. The good news could be on the power consumption figures – the module is touted to be low-power, and the data sheet shows 7mA when connected to an access point but with no data transfer. When transmitting at 20kbps, the current draw is about 24mA, which goes up to 320mA at 11Mbps.

[Willem] has his EMW3162_WICED repository up on Github, but also take a look at the MXChips MICO (Mico-controller based Internet Connectivity Operation System) repository. At the moment, he has it working using Linux, with a gnu gcc compiler and a JLINK JTAG programmer. He also has the WICED SDK working and has a WiFi AP with an on-board 120MHz arm chip. It would be interesting to hear about other users’ experiences with this radio module. Do let us know in the comments below!