Are you thinking about building your own IoT Cloud Application? Do you want to connect your vehicle fleet, devices or sensor nodes into the cloud? Or do you already have a running cloud solution and want to gain more benefit out of the collected data? Then let’s have a look at two different cloud technologies hosted by the local phone and internet provider Swisscom. First, there’s the Swisscom IoT-Cloud to get your things online as simple and fast as possible. And second, there’s the Swisscom Application Cloud to build unique and scalable apps, fitting your individual needs.
“I never worked with cloud technologies before, thus I was surprised how fast our first thing was online.”
Since the IoT Cloud is powered by deviceWISE, the platform is based on the Telit IoT Portal. Whereas the Application Cloud is built upon the open source project by the CloudFoundry Foundation. That allows you to adapt your application to cloud services from international providers that use the same technologies.
To cover as many use cases as possible we developed a hardware demo-case containing a Siemens LOGO, a SmartConnector (made by Noser), a Raspberry Pi with a Sense HAT extension board and a Xmodus GSM/GPRS-Router with SIM-Card.
With the aim to fit the above mentioned devices into one portable suitcase, an aluminum sheet has been designed. There are slots for the Siemens LOGO and the Raspberry Pi as well as holes for potentiometers, LEDs, switches and sockets. The Siemens LOGO has been configured to provide two analog inputs connected to two potentiometers. The six remaining inputs are digital and connected to red LEDs . Furthermore, it has four output relays, each connected to a Finder relay.
The SmartConnector is powered by a 3.3 V coin cell battery. This little IoT masterpiece measures the temperature as well as the acceleration in X, Y and Z direction. The collected sensor data is sent to the Raspberry Pi gateway via Bluetooth. Therefore, the Raspberry Pi is running a Python script to collect the data and transmit it to the IoT Cloud. Because the suitcase is always on the road, the GSM-Router ensures the connection to the cloud. Below the aluminum surface an Ethernet switch connects the Siemens LOGO, the Raspberry Pi and the GSM-Router to a small network.
The Raspberry Pi with the Sense HAT extension is installed inside our office in Winterthur to act as a static sensor node. It measures the temperature, pressure and humidity, while it runs the deviceWISE gateway firmware simultaneously.
Stage 1: The Gateway
During the process of connecting a device to the IoT Cloud the first stage to pass is the asset gateway (in this case the GSM router). Assuming that the device is configured to measure some kind of physical data, it is now the challenge to convert this data into a form, the gateway can forward to the cloud. Therefore, the GSM router has to run the deviceWISE gateway firmware, which supports a wide range of drivers for commonly used devices. To configure the gateway a computer with the deviceWISE Workbench installed is needed.
A connection to the gateway can be set up successfully if the computer and the gateway share the same network. As an alternative an Open TR50 connection achieves the same goal. Once logged in, the driver can be installed and the licenses for these drivers registered. A new device can now be added by filling in the name, IP address and device type in a form.
In case of the Siemens LOGO the sensor data can now be pulled out of a database which represents the devices registers. Finally, the Workbench allows you to create triggers, for example to push data into the IoT Cloud either with a scheduled interval or an on-data-change-event. The data packages are sent over a REST API including a timestamp, a thing key and a data key to recover the data source in the IoT Cloud.
Stage 2: The IoT Cloud
The IoT Cloud allows you to create dashboards to visualize the device data in charts, gauges, maps and other widgets. Therefore, the devices have to be added as things with the same thing key as was defined in the Workbench. Then properties and attributes can be assigned to the thing and again a key refers to the data origin. Now the pushed sensor data is stored into the attribute or property with the matching data key.
The screenshot on the left shows the default dashboard of a new defined thing. On the IoT Cloud platform it is now possible to add event triggers, for example to send an e-mail (see right screenshot).
But what to do if you want to add smart features to your application, like predictive maintenance or you want to store your data save and over a long time period? You have to enter the next stage.
Stage 3: The Application Cloud
With the Application Cloud Swisscom offers a Platform-as-a-Service (PaaS). It allows you to create flexible and scalable applications with multiple service options.
To use the potential of the Application Cloud a bunch of extra features have been implemented. To demonstrate condition monitoring, the user can activate smart features. One uses the orientation of the SmartConnector to toggle a relay of the Siemens LOGO. A second feature observes the values of the analog inputs of the LOGO and shows an alert if both values rise over a defined limit. The last feature is a simulation of an engine where the load depends on one of the analog input values of the LOGO which can be adjusted by turning the potentiometer. The chart displays the remaining service life and makes a prediction of when the engine will reach the end of its life-cycle. That gives the operator the chance to maintain the machine exactly when it’s required.
Our demo case connects things via GSM router to the IoT Cloud using a REST API. The IoT Cloud shares its data with the Application Cloud also using REST API. The data traffic is handled in the Node.js backend application. With the help of HTTP requests the frontend web application displays and uses the collected data.