IoT-in-a-Dongle – Connected apps for Software Developers
Update: 12.July – The crowdfunding campaign to bring this device to live just started!
This article is about a project developed in SAP Labs Bulgaria as part of the InnoJAM 2016 event.
The goal of the project is to lower the bar to entry the IoT world and in particular to allow developing of simple connected apps using SAP HCP Internet Of Things Service. Cost for acquiring the necessary hardware should be in the range 5-10 €, and there should be no special skills required.
The solution comprises of a new hardware module, custom default firmware and some sample apps on HCP to make an End2End scenario.
So far we made a couple internal trainings with a custom version of the device and the results were very positive. Lots of colleagues that felt intimidated by the need to connect wires, deal with voltages and so on were able to easily make the leap into the physical world and in fact hungry for more
A very common basic scenario for dealing with connected device comprises of few things:
- Connecting to a WiFi network and sending or receiving data – for this the popular hobbyist module ESP8266 is used
- Triggering a software event based on a physical event – this is why the module has a Button
- Collecting Time-Series data and doing some operations on them – so there is a Temperature Sensor
- Triggering a Physical event based on a Software event – so there is an RGB LED that can display different colors
There is a big number of development boards that utilize the ESP8266 module. Yet the problem with them is:
- Most of them can be used the create various scenarios, but make it hard for the complete beginners to start and require error prone connection of external sensors or actuators
- The prices quickly go above the 10 € range
- Most of them aren’t designed to be easily embeddable in 3d printed enclosures, which decreases the ease of use
This is why we designed a new board to overcome those limitations. The fact that there is a PCB Factory just 100m from SAP Labs Bulgaria makes it even more simple.
In addition to solving the requirements above, the board also has a couple additional benefits
- Built in USB Plug – eliminates the need to use a cable to connect the device to the PC while developing
- Built in Micro USB Port – allows for powering the device away from the PC
- Extension Ports on top – Once the user starts feeling more confident in the hardware he can plug different sensors, actuators, displays, etc – without the need to acquire another development Board
To reach the goal of a sub 10 € device, a certain number of devices need to be produced (100+) so that the fixed costs during PCB Design and Production can be shared across multiple devices. This is why a crowd-funding campaign is about to start in July to try to make this device a reality
Making the dream hardware device, may or may not become a reality. But in any case the required module can be assembled with relatively low technical skills using any existing ESP8266 development board.
Having this setup, the next thing is the Firmware of the device – the one that works with the hardware and communicates over WiFi.
Doing the initial setup of such devices is always troublesome. Somehow you need to connect to them. Often the solution is to have the device open a default Wifi Network and let the user connect and setup the stuff. There are few major drawbacks in this solution:
- During a training with 20 attendees, finding the right hotspot among 20 with similar names can be confusing
- Doing some additional configuration (HCP servers, ID, etc..) directly on UIs from the device, can be tricky due to the limited power, so no complex and nice Web Pages can be hosted
- Debugging connectivity problems becomes hard if the only connection is HTTP
This is why – the firmware allows to configure the device via Serial Commands, and the device itself installs as a Serial Port.
Sending the right commands via Putty or another tool for Serial communication is error prone. This is where the next part comes into play
Configuration Utility in as a Chrome App
The Chrome browser offers a nice API to develop operating system agnostic applications that use the Serial Port. The applications are in fact Web Pages, so any Web Technology can be used to develop them. For the first version – a simple Bootstrap-based page was chosen where the necessary HCP IoT Service configuration can be provided.
A built-in serial monitor helps to troubleshoot configuration problems, that happen a lot during trainings
HTML5 Web Apps running on SAP HCP and using IoT Service
The final step of the scenario is a script with examples – how to setup the Hardware Device and the IoT Service. Also there are example HTML5 Applications that can be directly deployed or extended so harness the power of HCP. With simple code-snippets the Web Apps show how to:
- Receive event triggers from the physical device via the IoT Service and popup a notification
- Receive TimeSeries data and show it into a table
- Choose a color and send it over to the device, so that the built in LED changes to it.
As a next step I plan to publish the firmware and example apps, as well as the script for configuration of HCP. If you are interested in this – follow this blog to get a notification once this is ready. If you are interested in getting notified on updates for the Hardware Dongle – register on the landing page above (or also follow this blog)