Andreas, no Lego this time?

The last time I asked Andreas what on earth he was doing, his desk was full of Lego. Quite a valid question in that case. The result of this work is called Augmented Commerce.

This time things look a little more ‘conservative’…

IMG_2629 1

…but still: “Andreas, what technology are you just working on?”

“I’m working with some old friends of hybris labs: a Raspberry Pi and an Arduino. And of course we have the usual suspects like Neopixel rings and so on…  But this time we’re also trying to connect to YaaS.”

“Ok, now what connects to what? What does what and why?”

“The Raspberry Pi does the talking to the YaaS platform, taking control of the whole process. And the Arduino is responsible for the hardware stuff, like LED’s and proximity sensor. This time we’re also using a coin slot which is kind of new. Basically, we’re trying to enable the customer to pay on the YaaS platform with coins.”

“So, we’re building a smart vending machine…”

“I wouldn’t call it that, because it can be more. The idea is that you can connect anything to what we’re building here. We’re not providing a complete vending machine, but only the YaaS-connection. You have your front end through which you can pay and interact with this device, but it’s only the interface of YaaS. What you connect it to in the end is up to you.”

“Apart from lights flashing when I throw in a coin, what else happens? There’s something going on with NFC or RFID, right?”

“At the moment it’s RFID (developer language for: ‘I’ve got no idea if this is going to work. It could be anything at the end. RFID, NFC, telepathy…’). The idea was that somehow you have to authenticate yourself to access your YaaS account. We wanted to do this with RFID, at least that’s the plan for the moment (for translation see above). So, you go up to the machine and through the proximity sensor it notices you’re approaching. It greets you and says ‘Hello, please swipe your card, NFC tag, RFID token, whatever… (Ok, now I’m being a bit mean. To be fair, the things Andreas builds usually work really well. There is a reason his second name is Brain.) Once it knows who you are, you can order the product of your choice. Then you are asked to please pay. You can either throw in coins, or you use the credit you already have on your YaaS account, or you pay by Bitcoin.”

“So, you can either pay physically or digitally via your account. But when you overpay with coins you don’t get any change back, right?”

“That’s the idea, because it simplifies our device. We only take money and don’t return any…”

“Makes sense, sounds good.”

“…yes. What you overpay goes directly to your YaaS account and you can use it the next time.”

Thanks Andreas, we’re curious to see the finished prototype.

Intro to IoT with the ESP8266 microcontroller board

Today we want to give you an introduction to a new module that has gotten a lot of attention in the IoT community lately. It doesn’t have a sexy name like the Particle Cores, Espruinos, LightBlue Beans and all the others out there. The name is simply ESP8266. Anyone exploring IoT components these days has probably run into one of the ESP8266 modules.
The first time I came across this little module was in August 2014 on the hackaday blog . Back then it seemed to be more of a cheap alternative to existing WiFi modules for Arduinos with a price tag of under $5, compared to the Arduino WiFi shields that run around $40. The SDK for the SoC of this module was not very mature and most of the documentation was available in Chinese language only. The only usable firmware supported AT commands.
But luckily a lot has changed since then. There are now more than 12 different variations of the ESP8266 available, multiple Firmwares, many projects are using it and it’s becoming more and more popular every day. With this post we want to give an overview on this.

 

Available module variants

ESP-01

ESP-01

  • Dimensions: 14.3mm x 24.8mm
  • PCB antenna
  • GPIO0/2/16
  • Very common module

 

ESP-02

ESP-02

  • Dimensions: 14.2mm x 14.7mm
  • U-FL connector
  • GPIO0/2/15
ESP-03

ESP-03

  • Dimensions: 17.4mm x 12.2mm
  • Ceramic antenna
  • GPIO0/2/12/13/14/15/16
  • Very common module
ESP-04

ESP-04

  • Dimensions: 14.7mm x 12.1mm
  • No antenna
  • GPIO0/2/12/13/14/15/16
ESP-05

ESP-05

  • Dimensions: 14.2mm x 14.2mm
  • U-FL connector
  • No GPIO
ESP-06

ESP-06

  • Dimensions: 14.2mm x 14.7mm
  • No antenna
  • GPIO0/2/12/13/14/15/16
  • Metal shield claims FCC
ESP-07

ESP-07

  • Dimensions: 22mm x 16mm
  • Ceramic Antenna & U-FL connector
  • GPIO0/2/4/5/12/13/14/15/16
  • Metal shield claims FCC

 

ESP-08

ESP-08

  • Dimensions: 17mm x 16mm
  • No antenna
  • GPIO0/2/12/13/14/15/16
  • Metal shield claims FCC
ESP-09

ESP-09

  • Dimensions: 10mm x 10mm
  • No antenna
  • GPIO0/2/12/13/14/1

 

ESP-10

ESP-10

  • Dimensions: 14.2mm x 10mm
  • No antenna
  • No GPIO
ESP-11

ESP-11

  • Dimensions: 19.3mm x 13mm
  • Ceramic antenna
  • GPIO0/1
ESP-12

ESP-12

  • Dimensions: 24mm x 16mm
  • PCB antenna
  • ADC + GPIO0/2/4/5/12/13/14/15/16
  • Very common module
  • Metal shield claims FCC

Here are some modules we rarely see being used, but we want to mention them here for completion.

WROOM-01

WROOM-01

  • GPIO0/2/4/5/12/13/14/15/16
WROOM-02 / ESP-13

WROOM-02 / ESP-13

  • GPIO0/2/4/5/12/13/14/15/16

 

ESP8266 ESP-12 wiring

In our exploration of the ESP8266 we have mostly focused on the ESP-12. We had a bunch of ESP-01 and ESP-12 available that we got off of AliExpress, but ESP-12 was mainly chosen because it has more GPIO pins.
The wiring for flashing a new firmware is pretty straight forward. In addition to connecting the VCC and GND you need to pull up the CH_PD and GPIO02 and pull down the pins GPIO0 and GPIO15. After running into unstable behavior of the module, we decided to add a dedicated power supply to have a constant current. The last missing part to flashing a new firmware is an FTDI USB-serial adapter. Connect the TX to RX, RX to TX and the GND. We don’t need the VCC since we already have a power supply. With the wiring as shown below, we should be ready to get our firmware on the ESP8266.

Wiring of ESP8266 ESP-12

Wiring of ESP8266 ESP-12

 

Available Firmwares

Espressif’s Official Firmware

The official firmware from Espressif gives you the best performance and control of your implementations with more memory available for code than the others below. There are many projects using this firmware, the most popular is probably esp_mqtt. The downside with this firmware though, is that you have set up a full toolchain on your development machine which can take some time. Even though some of the libraries were not open sourced there are very frequent releases at the moment. This helped us to get the ESP8266 connected to the hybris-as-a-Service offering over HTTPS as the older firmwares have a broken SSL library.

NodeMCU

The NodeMCU firmware was initially released at the end of 2014 and allows you to write your application code in Lua. This firmware is also very popular and allows quick prototyping. Unfortunately the NodeMCU is based on an older version of the official firmware. Due to memory restrictions this base can’t easily be upgraded as the remaining memory for custom code would be too low to do any serious coding. This also means that the recent fixes made to the SSL libraries etc. are not available in NodeMCU.

Frankenstein

This Firmware, as the name suggests, consists mostly of different bits and pieces that are publicly available. It is meant mainly as an alternative to an AT Firmware and has a limited control of GPIOs.

Sming

An open source and native firmware that allows you to work with GPIO in Arduino style. Comes with great built-in modules but is also compatible with Arduino libraries. But unfortunately based on an older version of the official firmware.

 

Other firmware projects in progress

Micro Python Port for ESP8266

  • highly experimental
  • Python REPL over UART0
  • Garbage collector

Espruino Port for ESP8266

  • Port of Espruino JavaScript engine
  • Slow progress

 

Toolchain set up on Mac OS X Yosemite

As mentioned above we would need to set up the toolchain in order to be able to compile the firmware and flash the ESP8266. In the following walk-through we’ll assume you have the drivers installed for the FTDI USB serial adapter. In most cases it should be pretty straight forward.

 

Essentials

First we need to install some essential tools that we would need to build the toolchain. We are mostly using homebrew to install additional software but you will also find same packages on MacPorts.

 

Toolchain and SDK

In the next step we need to create a case-sensitive filesystem, clone the sep-open-sdk repository and build it.

Once we have a successful build we need to add the toolchain path to our environment. Edit your profile with

and add this at the bottom

Don’t forget to reload your terminal

 

Flashtool

The last missing piece for the setup is a tool for flashing the compiled firmware onto the ESP8266. We’ve used ESPTool in most cases. It’s using a Python library PySerial that you can install with pip.

For the ESPTool itself you can simply git clone the repository and

 

First build

To verify that we set up the toolchain correctly we can compile a sample project. As I mentioned above, esp_mqtt is a very popular project. So let’s just compile that.

Now we can compile our own projects, too. It would be cool to integrate the toolchain into an IDE. We would have code highlighting, code completion and would also be able to build and flash the firmware in one single tool.

 

Eclipse set up

Download Eclipse IDE for C/C++ Developers and install it. Once done, you can import the esp_mqtt project into Eclipse as shown on the screens below.

To allow building and flashing of the firmware we can simply add the make targets (all, clean, flash) on the rights as shown here.

One last important part is still missing. We need to add the PATH variable to Eclipse to help it find the toolchain. Add in the Preferences under C/C++ → Build→ Environment a PATH variable with Value /esptools/esp-open-sdk/xtensa-lx106-elf/bin and we should be ready to develop our application.

 

First request to YaaS

We had successfully used MQTT with the ESP8266, but the upcoming hybris-as-a-Service platform yaaS is following the micro services architecture and is all RESTful Webservices over SSL. As mentioned earlier the SSL libraries were broken in earlier versions of the SDK. The latest official SDK though has proper SSL support. We got the ESP8266 to talk to yaaS with the sample code from Espressif. Just configure the WiFi SSID and password in the user_set_station_config function. Replace at the top the NET_DOMAIN and TLSHEAD with your server address and HTTP request.

Compile and flash the firmware onto the ESP8266. Restart the ESP8266 module to let it run your custom code that we flashed.

There it is! The ESP8266 got it’s first token from yaaS!

Moto – "It’s so simple, even Nick can run it…”

Thanks Lars… Have you finished playing with Minecraft?…

So, what is Moto? Moto is the fourth prototype of our IoT series and again we’re shifting the focus of what we want demonstrate. When we built the Smart Wine Shelf, we concentrated on the customer experience. With Funky Retail we focused more on the analytics. Tiles was a step closer towards exploring the technological aspects around mobility. And now finally, with Moto we’re diving even further into the IoT technology and the possibilities it leverages to permanently reconfigure the prototypes functions.

IMG_2566[1]

The ‘active’ physical components of a Moto are a distance sensor, a turning platform, and a LED-ring. Moto connects to an Android app via BLE and uses the device as data hub. The components and their actions can be connected in any way that seems sensible, by the means of a programming tool called ‘Node-RED’. And exactly this the essence of Moto. ‘Node-RED’ allows users without special expertise in coding and programming (like Nick…) to configure an IoT-based system. The actual Moto and the actions taking place merely serve as an example. These actions are displayed in a web page UI through which they also can be triggered.

We’re deliberately not telling a specific business story around this prototype. Basically it’s a bit of plug & play for IoT.

Screen Shot 2015-06-05 at 4.08.13 PM Screen Shot 2015-06-03 at 11.12.29 AM

Screen Shot 2015-06-16 at 5.05.20 PM

Read the more techy posts on Moto here!

First Lego, now Minecraft. Yes, we love our bricks!

20150612_120327_HDR[5]

It is continuously becoming more difficult to sustain a touch of seriousness here… Imagine one of your colleagues just finishing to play with Lego at his desk, when the next starts “working” with Minecraft and shares the fruits on the big screen in the office. Questions do arise… Okay, let’s try to explain.

Lars is currently exploring how IoT and SAP HANA fit together with a very simple approach. He’s measuring the room temperature in the office. Don’t laugh! This is serious stuff! Yeah okay, it does sound a bit ridiculous actually… but here goes: Lars connected a temperature sensor to a BeagleBone Black which sends the data to the SAP HANA Cloud Platform. From there it goes to a Raspberry PI that has Minecraft running on it and is connected to a TV. So much for the basic architecture. Here’s the idea: Lars wrote a script with which the temperature data can be displayed in a Minecraft landscape. Why? Because this is what it looks like in SAPUI5:

Screen Shot 2015-06-22 at 1.14.45 PM

Lars is planning to add mores sensors. Suggestions, anyone? Maybe even with a commerce related background…?

Making IoT visual. Using Node-RED for hybrislabs moto.

Our prototype ‘moto’ is just taking an interesting turn. It’s technically pretty robust, we’re finishing off some UI/product choice things and we asked ourselves: that’s it? While we’ve developed one story for each prototype so far, it seems we’re focusing on different, higher-level issues when it comes to IoT with moto. That’s the issue of how things are wired up, how things can interact and how existing configurations can quickly be changed.

So instead of one story, we’ll have many stories for moto. It will stay interesting, from a technical perspective, too. But the real story is: using Node-RED extensions, we’re able to rewire the logic of moto very quickly. And: it’s a tool for business-users. No hardwired setup.

IMG_20150601_173538 (1)

Just like most other IoT-focused prototypes that we have (Wine Shelf, Funky Retail, Tiles), Moto also has a REST-based web API to control the light and motion. As well as a webhooks-based system to communicate with the outer world. But because moto is also built around MQTT (just like funky retail), it is easy to extend. With Node-RED and MQTT, we have a direct hook into the core messaging system of our IoT prototype. And we’re using the extensions we’re currently working on to make the commands and events easy to wire up. Take a look at a very simple example:

Screen Shot 2015-06-05 at 4.08.13 PM

 

Here, a node triggers every 5 seconds. It will first hit the ‘red, slow, counter-clockwise’ node and the connected moto (here #2) will begin to turn red and slowly rotate counter-clockwise. After a delay of 2sec, it will turn green, move clockwise and fast. And finally after another 1 sec delay it turns off the motor and the LEDs turn white. It then starts over again.

We’re just having the first successes with Node-RED, but it looks very promising to become the brain of our prototypes. It might be smart move, as others (e.g. non-technical people, the business guys, the guys with the smart stories) can rewire moto in whatever flavor they want.

Next up in tech are the input nodes, e.g. moto can send presence events that can start interactions.

Just to wrap up, another example where we took the current temperature in Munich, converted that into a moto command and send it to moto for displaying the temperature via light:

Screen Shot 2015-06-03 at 11.12.29 AM

Let us know what you think!