• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Codemotion Magazine

Codemotion Magazine

We code the future. Together

  • Discover
    • Live
    • Tech Communities
    • Hackathons
    • Coding Challenges
    • For Kids
  • Watch
    • Talks
    • Playlists
    • Edu Paths
  • Magazine
    • Backend
    • Frontend
    • AI/ML
    • DevOps
    • Dev Life
    • Soft Skills
    • Infographics
  • Talent
    • Discover Talent
    • Jobs
  • Partners
  • For Companies
Home » AI/ML » Big Data » IOT Development: the Snap4City way
Big Data

IOT Development: the Snap4City way

Codemotion and Facebook organized the Tech Leadership Training boot camp, heres a personal reportage from one of our attendees.

March 13, 2019 by Paolo Caressa

During the last decade, application development has extended its borders far and beyond the classical web application paradigm. In particular, two main tendencies arose, namely Cloud Computing and the Internet of Things.

Delivering applications on cloud frameworks is now a simple and standard task for programmers. Production environments or even retail customers or software vendors require the capability to do it easily and efficiently. The same is becoming true for IOT applications, which pose a different level of complexity and new challenges to developers.

Indeed, by its very nature, IOT has to do with different hardware devices and communication protocols and it displays a manifold of ways to collect data, connect to a device or even manage devices to prepare them for a connection. While in the Cloud Computing paradigm big vendors provide APIs and frameworks which have become de facto standards, in the IOT realm there is a more fragmented picture concerning platforms, devices and standards.

In particular, IOT development aimed at smart city applications is becoming an important issue. Providing a unified, integrated and complete framework is where  Snap4City comes into play. It delivers a fully open source, data-driven, scalable platform based on cloud, which also enables its users to analyse and aggregate huge amounts of data by means of big data and machine learning techniques, and to offer services such as anomaly detection, early warning and environmental risk assessment.

Snap4City applications should be viewed as data-driven applications, which may be customised tailoring on specific needs and shared among the community. The basic tool to use and manage IOT applications on Snap4City is the dashboard, which is in a sense the governance layer of smart city application within Snap4City itself:
 

Img 1: Interaction between Snap4City Dashboard, IOT application and the Smart City.

The dashboard provides both the front-end of the applications and the development environment in which to create them. Snap4City allows us to set up an application by combining micro-services according to a given logic flow, in a stateful manner, thanks to a GUI editor to describe graphically the logic flow and all the single services it ought to connect.

The programmer can choose from dozens of micro-services which perform a single micro-task, such as, for example:

  • Device search services (geolocalisation, getting info, public transport routes search, etc.)
  • Snap4City job scheduling management (check existing jobs, trigger a job, pause a job, etc.)
  • Data analytics (descriptive statistics, machine learning predictions, time series predictions, etc.)
  • Service search (by GPS position, by keywords and tags criteria, by bus routes, etc.)
  • Application data management
  • Dashboard customisation (adding widgets, buttons, contents and more on a dashboard)
  • Sigfox integration (recall that Sigfox is a low cost connectivity solution for IOT https://www.sigfox.com/en).
  • Device handling (registration, etc.).

 

Img 2: Example of a micro-service description (developer view)

To actually build the application, Snap4City provides a graphical tool resembling BPMs, to assemble the invocation of micro-services into a control flow, and to insert a code snippet to perform some simple specific tasks which do not require a service but which alter the state of the application (for example variables’ values).
 

Img 3: GUI wizard to create and manage micro-services control flow.

More precisely, Snap4City provides a NodeRED-like tool augmented by the large set of micro-services discussed above. In this way, IOT applications can be fully integrated behind a City Dashboard for decision makers and for city users as well. However, it is worth stressing that an IOT application may or may not have a dashboard at all, or they also have many dashboards. Indeed, a dashboard itself is represented as a block in the oriented graph representing the control flow of the application.

It is worth showing how easy to use the Snap4City wizard is to build applications, with a simple toy example. Let us suppose we have two devices, providing temperature values in Celsius and in Fahrenheit, the first one storing the value in a JSON file, the second one just emitting a single value, the first one with frequency of five seconds, the second one with frequency of seven seconds.
Thus we have two devices with different values, different formats, communication protocols and different frequencies. We want to integrate their data inside a unique application to collect them and aggregate them into a single time series.
 

Img 4: Two simple different flows to be integrated, as they appear in the Wizard.

Next we can introduce two blocks, for example one Orion Context Broker block and one MQTT input block and configure them, by adding a “temperature” variable in the Orion block and linking it in the MQTT block, which also displays the name of the value produced by the second device:
 


 

Img 5 and 6: Blocks configuration.

To read the temperature from the JSON, via the Orion broker, it is needed to define a simple function block containing the code needed to get the value from the JSON and return it into a message. Notice that the snippet is written in Javascript:
 

Img 7: Code snippet (into a function) to get a value from a JSON.

Also needed is a function to convert Fahrenheit to Celsius, and we put it into another function block:
 

Img 8: Code snippet (into a function) to convert from Fahrenheit to Celsius.

At this point, we have all the element displayed in the wizard:
 

Flow control before aggregation and connection.

Img 9: Flow control before aggregation and connection.

To properly connect them, one can use an aggregator node. This one has to be installed by managing the user palette, which lets the developer search all along the NodeRED repository and filter according to keywords:
 

Img 10: Adding NodeRED nodes to the user palette.

Deploying and testing the application is simple as well as building it, as we have done in this toy example.

A final word: each application is executed through the Computation Management Service tools that have to verify the actual possibility to deploy and to execute each application on allocating and connecting the corresponding microservices (according to the compatible hardware and possible allocations). This allows for a kind of hybrid solution exploiting Edge/Fog Computing, cloud facilities, parallel and distributed batch processing, and also taking advantage of contextual information, and reducing latency in developed services.

Snap4City Hack

Snap4City platforms and solutions are available at Snap4city.org website, where you can register and start exploring its features. But if you want to really challenge your skills and propose your innovative solutions for connected cities, you can join the upcoming Snap4City Hack, the big online hackathon on the topics of Smart City and IoT.

Snap4City launched a big online Hackathon on Ecological Watch, Social and Service Evolution, Stimulating Business Growth, City Aware.

Using Snap4City tools to manage IoT, Big Data and analytics, the hackathon challenges will cover different themes – Ecological Watch, Social and Service Evolution, Stimulating Business Growth, City Aware – and real data from cities such as Helsinki or Antwerp.

Further information on the Hackathon is available on the on Snap4City.org/hackathon website.

facebooktwitterlinkedinreddit
Share on:facebooktwitterlinkedinreddit

Tagged as:IoT

Let’s Jam!
Previous Post
Creating a culture of responsibility: interview with Omosola Odetunde
Next Post

Related articles

  • MapReduce Not Dead: Here’s Why It’s Still Ruling in the Cloud
  • Is Apache Kafka Still Relevant?
  • Data Lake vs. Data Warehouse: Which to Use?
  • Case Study: Implementing the Actor Model for Managing Huge Amounts of Data
  • Will NoSQL Survive Big Data?
  • Population Shift Analysis: Monitoring Data Quality with Popmon
  • 8 Techniques for Efficient Data Cleaning
  • 5 Ways To Grow Your Business Through Data Monetization
  • 7 Key Differences Between Data Analytics and Data Mining
  • 5 Rules of Engagement When it Comes to Data Visualization

Primary Sidebar

Codemotion Talent · Remote Jobs

Flutter Developer

3Bee
Full remote · Android · Flutter · Dart

Python Back-end Developer

h-trips.com
Full remote · Django · Pandas · PostgreSQL · Python

AWS Cloud Architect

Kirey Group
Full remote · Amazon-Web-Services · Ansible · Hibernate · Kubernetes · Linux

AWS SysOps Administrator

S2E | Solutions2Enterprises
Full remote · Amazon-Web-Services · Terraform · Linux · Windows · SQL · Docker · Kubernetes

Latest Articles

PLD security, IoT, 5G

How to Improve Programmable Logic Devices’ Security: Main Threats and Latest Advancements

Cybersecurity

What is RPA? Robotic process automation.

Emerging Tech: Everything You Need to Know About Robotic Process Automation (RPA)

Machine Learning

A survei on AI Coding tools. An infographic.

Codemotion AI Coding Tools Survey Results!

Infographics

This article offers an infographic to understand Logical Data Warehouses

Logical Data Warehouse: All you Need to Know

Infographics

Footer

  • Magazine
  • Events
  • Community
  • Learning
  • Kids
  • How to use our platform
  • Contact us
  • Become a Contributor
  • About Codemotion Magazine
  • How to run a meetup
  • Tools for virtual conferences

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • YouTube
  • RSS

© Copyright Codemotion srl Via Marsala, 29/H, 00185 Roma P.IVA 12392791005 | Privacy policy | Terms and conditions

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • RSS