Sofia2 IoT example with Android: Tag, you’re it!

example-overview.png

This post is an example on how easy is to integrate an IoT scenario using Sofia2 IoT platform. The example was presented on February 17th during an introduction lecture on Sofia2 basics for the Embedded & Distributed Systems Sofware Master course at the Universidad Politécnica de Madrid (UPM).

The setup will simulate a typical IoT scenario with just a couple of elements:

  • Android Smarpthone (running at least a 4.4 Android version)
  • BLE (Bluetooth Low Energy) Beacon
  • An upgraded user for Sofia2.com platform (ROL_COLABORADOR)

 

example-overview.png

The demo app will periodically fetch data from the smartphone’s accelerometer sensor and GPS. It will also operate as a BLE scanner, triggering an asynchronous event when the selected beacon is placed nearby. Data will be modeled using a Sofia2’s Ontology. Using Sofia2 console, we will create a Dashboard to represent periodic real-time data. A Groovy script will be also generated to evaluate whether the beacon was detected. If that is the case, it will send an e-mail to the user: “Tag, you’re it!”

Seguir leyendo “Sofia2 IoT example with Android: Tag, you’re it!”

Sofia2 IoT example with Android: Tag, you’re it!

Caso ejemplo Sofia2 IoT con Android : ¡Tú la llevas!

En este post se presentará un sencillo ejemplo de integración IoT sobre la plataforma Sofia2. Este ejemplo fue presentado el día 17 de Febrero en una charla de presentación y de formación de conceptos básicos de la plataforma IoT Sofia2 a los alumnos del Máster en Software de Sistemas Distribuidos y Empotrados, en el grupo de investigación SYST de la Universidad Politécnica de Madrid (UPM).

El escenario simulará un escenario típico de IoT con un par de elementos sencillos:

  • Smartphone Android (versión igual o superior a 4.4)
  • Dispositivo beacon con BLE (Bluetooth Low Energy)
  • Usuario en plataforma Sofia2.com, con nivel de ROL_COLABORADOR

 

example-overview.png

 

Para el demostrador se obtendrán datos periódicamente de los sensores de acelerómetro del terminal móvil y de la geo-posición del mismo. Además se realizará un escaneo sobre Bluetooth Low Energy (BLE) que cuando detecte la cercanía del Beacon seleccionado, dispare un evento asíncrono. En Sofia2, se recogerán los datos en una Ontología, representando acto seguido los valores periódicos en un Dashboard, y evaluando la ocurrencia del evento asíncrono en un Script que notificará de manera instantánea la detección del evento en el e-mail del usuario: ¡Tú la llevas!

Seguir leyendo “Caso ejemplo Sofia2 IoT con Android : ¡Tú la llevas!”

Caso ejemplo Sofia2 IoT con Android : ¡Tú la llevas!

Sofia2 IoT Workshop: CEP Rule Creation. SCRIPT Rule Creation. Final Exercise. (Part 4/4)

The goal of this workshop is the realization of a real example on which we can evaluate the capabilities of Sofia2 platform.

 

In order to do this, we are going to simulate a building that has several floors, and three devices for the reading of energy consumption, temperature and humidity in each one of them.  Finally, we will create a dashboard to display this information and we will publish data in an API to be consumed in a simple way by any application.

 

In order to get a better understanding of the workshop, we will structure the steps to follow in 4 posts.

 

In previous posts we were working about:

 

(Part 1/4) – Data Model. Ontology. ThinKP.

 

(Part 2/4) – Simulate input data. Simulator Configuration and Execution.

 

(Part 3/4) – Control panel. Gadget and Dashboard Creation. Publish Ontology as Api.

 

Today we will see (Part 4/4) where we’ll create a CEP rule, a SCRIPT rule, and we’ll make a final exercise. This will conclude the IoT workshop.

 

Seguir leyendo “Sofia2 IoT Workshop: CEP Rule Creation. SCRIPT Rule Creation. Final Exercise. (Part 4/4)”

Sofia2 IoT Workshop: CEP Rule Creation. SCRIPT Rule Creation. Final Exercise. (Part 4/4)