IonBlock-Sdk-Paasmer

How to Use the IonBloc SDK

ManagementTeamMouli1

Srinidhi Murthy

What is Block Chain?

A blockchain – originally block chain – is a distributed database that is used to maintain a continuously growing list of records, called blocks. Each block contains a timestamp and a link to a previous block. A blockchain is typically managed by a peer-to-peer network collectively adhering to a protocol for validating new blocks. By design, blockchains are inherently resistant to modification of the data. Once recorded, the data in any given block cannot be altered retroactively without the alteration of all subsequent blocks and a collusion of the network majority. Functionally, a blockchain can serve as “an open, distributed ledger that can record transactions between two parties efficiently and in a verifiable and permanent way. The ledger itself can also be programmed to trigger transactions automatically.”

Blockchains are secure by design and are an example of a distributed computing system with high Byzantine fault tolerance. Decentralized consensus has therefore been achieved with a blockchain. This makes blockchains potentially suitable for the recording of events, medical records, and other records management activities, such as identity management, transaction processing, and documenting provenance.

IonBloc

ionBlocIonBloc Data flow and usage

IonBloc is our version of Open source Ethereum Blockchain network that can be setup as a public production implementation or a private test implementation depending on client needs.

In an IoT network, the blockchain can keep an immutable record of the history of smart devices. This feature enables the autonomous functioning of smart devices without the need for centralized authority. Thus, blockchain opens the door to a series of IoT scenarios that were remarkably difficult, or even impossible to implement without it.

By leveraging blockchain, IoT solutions can enable secure, trust less messaging between devices in an IoT network. In this model, the blockchain will treat message exchanges between devices like financial transactions in a Bitcoin network. To enable message exchanges, devices will leverage smart contracts which then model the agreement between the two parties.

Using blockchain will enable true autonomous smart devices that can exchange data, or even execute financial transactions, without the need of a centralized broker. This type of autonomy is possible because the nodes in the blockchain network will verify the validity of the transaction without relying on a centralized authority.

Installation:

The IonBloc SDK allows for a seamless connection to our private Blockchain. Here’s how you can do it. You need to have a Raspberry PI 3 with a 16GB SD card and running the latest Raspbian OS. Also, you need to have a stable high speed Internet connection (500 kbps at a minimum)

  • Download the Zip file from Github or execute a git clone command on our repository.
  • Extract and Install the SDK using the Installation script.
  • Some of the necessary support libraries are installed and you are taken to a GETH console.

Once you are in the GETH console,

  • Create a new account. (Noted down the password)
  • Provide our Admin Enode address and Pair
  • That’s it you are connected to our private Block Chain.

Now the possibilities are endless, but to get you started we have given a sample code and procedure to create contracts to blink an LED connected to a GPIO pin on the R-PI.

You can create contracts which have more features, which can read sensors, turn on actuators, monitor sensors etc.
IonBloc SDK is just the starting point … the tip of the iceberg. Some of the more advanced use cases can be found in

IonBloc SDK is just the starting point … the tip of the iceberg. Some of the more advanced use cases can be found in

  • Industrial and manufacturing for improving monitoring and efficient “Just in Time” (JIT) processes.
  • Connected and Driverless vehicles where every vehicle becomes a node and there can be an efficient vehicle to vehicle communication.
  • Public infrastructure and smart cities: Smart devices are already being used to track the health of bridges, roads, power grids etc. Blockchains can be used to interconnect these to share efficiencies and to conduct maintenance, forecast usage trends for power usage, pollution etc.

We have given a limited set of features to create a working POC that can be later developed into fully fledged modules. There are many more features that can be added as a part of customization for specific requirements.
We can do a lot more with IonBloc (some of the features are present in the data flow diagram).

Please feel free to contact us at the mailto:support@paasmer.co for any information or customization.

Paasmer-Ion-Tor_2

How to use the IonToR SDK

ManagementTeamMouli1

Srinidhi Murthy

First Up, What is this TOR Network? TOR or The Onion Router funnels all the data traffic from the device to its end user or master update servers via a Tor-Kind connection, instead of using the public Internet.

The software is run to turn on a Tor configuration, which, in a simplified explanation, sets up a special Onion site on the device. Remote users who want to access the IoT device will need to know the Onion link to the software first, which will then relay the connection to the actual IoT device, working as a proxy. The advantages of using such a system are palpable, for both users and IoT vendors, who might be interested in embedding such technology into their devices by default.

First off, there’s no need to complicate software development with setting up complex SSL/TLS certificates for supporting HTTPS connections, since all Tor connections are encrypted by default, with several layers of encryption (Onion protocol).

Secondly, users don’t need to uselessly open firewall ports or use VPNs to access their IoT devices.

Here’s a simple illustration of how a traditional TOR network Works.Ion-Tor_paasmerOverview

The IonToR SDK provides the ability to connect your things or Devices to the Internet and the ability to control them across a TOR Network via a TOR Browser.

The IonToR SDK for Single Board Computers (SBC) like Raspberry-PI, Intel Edison, and Beagle Bone is a collection of source files that enables you to connect to the IonTor service. It includes the tor libraries to connect to TOR network. It is distributed in the application form and intended to be built into customer solution along with other libraries. The below Image represents how IonTor works.

Ion-Tor-Paasmer1Features

The IonToR SDK simplifies access to the TOR network and automatically configures an .onion DNS name along with a hidden service for accessing a UI on a TOR browser. The SDK installs all necessary software and creates a simple web UI through which sensor data can be viewed and actuators controlled. The SDK has been tested to work on the Raspberry Pi 3 running Raspbian Jessie. Support for Other SBC’s running any flavors of Linux would be available shortly.

Installation
Installation of the IonTor SDK is a matter of a few simple steps and viola! You are ready to control and read sensor information from anywhere in the across a TOR network. The TOR SDK can be installed from the GitHub location. Following the steps in the installation guide (Readme file) will complete the installation.

Installation includes the following modules.

  • HostAPD: to provide an access point for Wireless sensors to connect.
  • LAMP Serve: Facilitate the being up of the UI on the SBC.
  • TOR Installation : Configures Hidden service and provides the “dot onion” DNS address.
  • Configuration files need to be edited to give proper names to Sensors and Actuators

Running the given script enables the data gathering from sensors after configures interval and is stored in the DB.

Tor Client Access Setup

The TOR Browser allows you to access your PAASMER-IonToR instance over Tor from your laptop or mobile device, using Tor Browser

A Hidden Service Authentication credentials must be added to the TOR browser to allow the access of the Hidden Service configured on the SBC. Once connected to the “dot onion” site, you are presented with a graphical representation of your sensor data and Actuator control. This Sensor data being displayed is live data and you can turn on and Off Actuators.

Ion-Tor-Paasmer_dashbord

The IonToR SDK can be used to create Proof of Concept projects that can be later developed into fully fledged modules. There are many more features that can be added as a part of customization for specific requirements.

The IonToR SDK provides a completely anonymous way of accessing your devices, things, sensors and it protects the users and the devices from attacks like DOS, Bot-nets etc.

All connections will go through the Tor hidden network, and nobody will know to what you’re connecting. It could be your IoT baby cam at home or a drug marketplace. It’s anyone’s guess.

Scanning Tor-protected IoT devices are technically impossible. This means no more searching for vulnerable IoT devices via Shodan and blindly stumbling upon vulnerable equipment.

Please feel free to contact us at the support@paasmer.co for any information or customization.

Paasme-machine-learning-iot-platform

Machine Learning and IoT

ManagementTeamMouli1

Srinidhi Murthy

Given all the hype and buzz around machine learning and IoT, it can be difficult to cut through the noise and understand where the actual value lies. In this Blog, we explain how machine learning can be valuable for IoT when it’s appropriate to use, and some machine learning applications and use cases currently out in the world today.

What is Machine Learning?

Machine Learning is not a novelty innovation. As early as 1959, Arthur Samuel defined the concept of machine learning as the ability of computers to learn to function in ways that they were not specifically programmed to do. Of course, the timeline from definition to implementation in everyday life can be a long one. Today, many factors have come together to make machine learning a reality, including large data sources that are great for learning, increased computational power for processing information in split seconds, and algorithms that have become more and more reliable.

What is Data Analytics? How is it different from Machine learning?

Data analytics can help quantify and track goals, enable smarter decision making, and then provide the means for measuring success over time.

Machine learning, on the other hand, is a process of continuous learning, to which the system can make immediate adjustments to improve processes, timelines, decision making etc.

Machine Learning Use Cases in IoT

The data models that are typical of traditional data analytics are often static and of limited use in addressing fast-changing and unstructured data.

When it comes to IoT, it’s often necessary to identify correlations between dozens of sensor inputs and external factors that are rapidly producing millions of data points.

In general, machine learning is valuable when you know what you want but you don’t know the important input variables to make that decision.

Some of the typical use cases of Machine Learning and IoT are given below.

Cost Savings in Industrial Applications

Predictive capabilities are extremely useful in an industrial setting. By drawing data from multiple sensors in or on machines, machine learning algorithms can “learn” what’s typical for the machine and then detect when something abnormal begins to occur.

A Large Equipment Manufacturer has installed Many IoT sensors on its equipment which continuously send data to be learned and any deviation above a threshold be highlighted and immediately triggered as a notification to the concerned person.

Shaping Experiences to Individuals

We’re actually all familiar with machine learning applications in our everyday lives. Both Amazon and Netflix use machine learning to learn our preferences and provide a better experience for the user. That could mean suggesting products that you might like or providing relevant recommendations for movies and TV shows.

Similarly, in IoT machine learning can be extremely valuable in shaping our environment to our personal preferences.

The Nest Thermostat is a great example, it uses machine learning to learn your preferences for heating and cooling, making sure that the house is the right temperature when you get home from work or when you wake up in the morning.

And More

The use cases described above are just a few of the virtually infinite possibilities, but they’re important because they’re useful applications of machine learning in IoT that are happening right now.

But overall …. We’re Just Scratching the Surface. The billions of sensors and devices that will continue to be connected to the internet in the coming years will generate exponentially more data. Not only will we be able to

predict when machines need maintenance, we’ll be able to predict when we need maintenance too.
Machine learning will be applied to the data from our wearable devices to learn our baseline and determine when our

vitals have become abnormal, calling a doctor or ambulance automatically if necessary.

Beyond individuals, we’ll be able to use that health data at scale to see trends across entire populations, predicting outbreaks of disease and proactively addressing health problems.

Smart-Transportation-Paasmer-IoT-Platform

Smart Transportation and IoT

ManagementTeamMouli1

Srinidhi Murthy

Thanks to laptops and smartphones, human beings are able to stay connected to the Internet more often that ever before, but yet there are still some notable dead spots, particularly in cars, buses, and trains. Anyone with a daily commute can speak to lapses in coverage on the subway or when going through a tunnel.

But the Internet of Things is looking to change all that and keep people connected at every moment of every day. Connected cars, buses, trains, and even planes will allow people to have a stable Internet connection at almost all times.

And the transformation won’t stop there, as the IoT will make transportation itself more efficient and help us get from place to place more quickly.

A new term called as “Internet of Transportation” has been coined and it will create the new era of connected transportation and change how we travel.

With Internet of Transportation assets we can:

  • Reduce congestion by monitoring and controlling traffic lights.
  • Send alerts to drivers and emergency responders on trip conditions, then offer alternative routes.
  • Reduce fuel consumption and vehicle emissions.
  • Provide smart parking solutions that identify and communicate available spaces.
  • Improve safety for motorists, pedestrians, and bicyclists.
  • Identify structural issues of bridges, roadways, and tunnels.
  • Provide smart lighting and security monitoring for city streets.

Let’s look at some of the use cases of Smart Transportation and how they are implemented.

Fleet Management:
Fleet telematics solutions help businesses, transportation carriers, and governments improve economics, safety, and compliance by intelligently monitoring and controlling their vehicles.

Specific or Generic Smart Applications gather and analyze data from on-board instrumentation and GPS sensors to track vehicle status and location, optimize routing, and monitor driver and equipment performance and productivity.

Connected Cars:

Smart-Transportation-1-Paasmer
In the last few years, connected cars or smart cars have surged in popularity thanks to the IoT. Today, car companies are connecting their vehicles in two manners: embedded and tethered. Embedded cars employ a built-in antenna and chipset, while tethered connections make use of hardware to let drivers connect to their cars through their smartphones.

On top of this, app integration is becoming more and more standard in the car of today. Google Maps and other navigation systems have started to replace built-in GPS systems in dashboards.

Apps such as GasBuddy show the driver where he or she can locate the cheapest fuel in their area. And music apps such as Spotify have started to away the need for traditional and satellite radio.

Transport Logistics:

Smart-Transportation-2-Paasmer

Intelligent transport logistics solutions help long-haul cargo operators and last-mile delivery providers efficiently manage the transportation and distribution of freight and merchandise.

Smart applications gather and analyze data from onboard sensors to track containers and packages, and to monitor environmental conditions, ensuring goods arrive on time, at the right place, intact.

Traffic and Parking Management:

Smart-Transportation-3-min

Smart-Transportation-Paasmer

Integrated Traffic and Parking Management Systems can reduce congestion and save fuel in Business Districts and City Centers. Sensors built into Parking Meters can indicate to a server when a parking slot becomes available. A car User with a Smart Phone App can request to find a parking space within a designated radius based on the GPS location and the server responds with the available parking spaces. This saves fuel and congestion caused by Simply using visual parking search methods.

Traffic Management systems can use sensors, cameras, to find out intersection that has become congested and Use smart algorithms to determine which direction the traffic needs to be moving too quickly clear congestion. It can also act as an Emergency response systems in case of accidents or emergencies.

PAASMER:
Paasmer is an IoT Platform As A Service which can connect any of your IoT devices to the the Paasmer Platform allow for control, visualization and Analytics of Data that are received from the Sensors.

What can PAASMER do for Smart Transportation:
PAASMER is a flexible, economical and easy way to connect your IoT devices and it works on a various range of Hardware devices that are available off the shelf. Using Paasmer Building POC for Smart Transportation would be most reliable, fast and economical. Please do visit us at paasmer.co for more details.

Paasmer_platform_sdk

Build Your IoT Solution using PAASMER SDK

ManagementTeamMouli1

Srinidhi Murthy

An IOT device is a hardware that connects with various sensors in the enterprises or industries, collects data, preprocess, send them to cloud hosted IOT platform or an IOT application for further analysis and interpretation to present them for decision making or feed them for process efficiency and production improvement. The IOT devices should be developed with the support for IOT communication standards to communicate with different kinds of sensors in the industry and IOT devices should be communicating with each other.

An industry who wants to implement the IOT solution in their company may need to develop different kinds of IOT devices to collect data from various sensors from various locations. It is a time consuming for any IOT solution provider or IOT device developers to develop a new IOT device/solution quickly with support for various kinds of connectivity standards from the scratch.

Once the devices are developed and deployed, the IOT solution should provide a management console to view their devices, the sensors connected to devices and the data collected from them in an easily understandable format. The user who has the authority to manage the IOT devices to view the data and control the devices should be provided with easy to use user interfaces in web UI or smartphone Apps to control the devices. Developing such a management console from the scratch is time-consuming.

An IOT development platform with software development kits to provide APIs to develop IOT devices using commonly used open source IOT hardware can enable IOT solution developers, IOT device developers, and IOT consultants to quickly develop and implement IOT solutions with different kinds of IOT devices.

The IOT platform can also provide a management console to manage all the IOT devices, sensors and their data presented in a user editable formats with control options. The platform can be hosted in in-premises and(or) in the cloud and can connect with the various IOT applications analytical and management applications. This can enable developers to develop value-added IOT solutions quickly.

The software development kits provided in IOT development platform can also provide APIs to quickly develop security layer of IOT solution like TOR and Blockchain.

PAASMER SDK
It enables you to do Design, Connect and Analyze your data using PAASMER’s IOT platform.

Design:
PAASMER’s SDK allows you to connect any sensors to existing IOT boards in the market like Raspberry Pi, Node MCU, and many other IOT boards. The PAASMER platform is hardware agnostic. The trial build will provide support for connecting sensors to RPi and Node MCU and supports languages like C and Python.

Connect:
PAASMER SDK enables easy connectivity of your IOT devices to PAASMER cloud. The SDK allows communication of all the IOT devices with the PAASMER cloud. It works with all the popular platforms and supports multiple communication protocols. The trial version will support the Wi-Fi method of communication using MQTT protocol and RESTFUL APIs. The SDK allows managing all the devices connected to the PAASMER platform.

Analyze:
The PAASMER Developer Login enables the users to Analyze the data that is being sent from the devices and draw a meaningful conclusion out of it. There is also an option for Manual control of sensors based on inputs received.

Paasmer_sdk_platform

Overview of PAASMER IOT platform

SDK:
The PAASMER SDK for Embedded C, Python and ESP Open RTOS is a collection of source files that enables you to connect to the PAASMER IOT Platform. It includes the transport client for MQTT with TLS support. It is distributed in source form and intended to be built into customer firmware along with application code, other libraries, and RTOS.

Features:
The SDK’s simplifies access to the Pub/Sub functionality of the PAASMER IOT broker via MQTT. The SDK has been tested to work on the Raspberry Pi 3 running Raspbian Jessie and NodeMCU / Adafruit Huzzah. Support for Other SBC’s running any flavors of Linux would be available shortly. The SBC-SDK provides functionality to create and maintain a mutually authenticated TLS connection over which it runs MQTT. This connection is used for any further publish operations and allow for subscribing to MQTT topics which will call a configurable callback function when these topics are received. More information is available about the SDK’s at https://github.com/PAASMERIOT/

Developer Login:
The PAASMER Developer Login provides the ability for the User to register, Login, View devices, sensor data and the ability to send control messages to the Edge hardware.

Features:
The PAASMER developer Login is available at http://developers.paasmer.co. Here the user can register for the free trial and upon verification of the credentials is allowed to Login.

After login, the user is directed to the various available SDK’s that he can download and edit the same to enable his devices to be connected to the PAASMER IOT platform.

Once the SDK’s are downloaded onto the devices and his credentials entered and the program is running, the device is connected the PAASMER IOT platform and starts sending sensor information.

This sensor information is available on the PAASMER Developer Login for viewing and base on the sensor information the User can take actions using the control feeds to control actuators.

Home automation and HVAC control_paasmer platform

Home Automation and HVAC Control

ManagementTeamMouli1

Srinidhi Murthy

The Internet of Things is set to disrupt the way we live and work, but for now, let’s focus on the “live” portion of that statement. Smart homes filled with connected products are loaded with possibilities to make our lives easier, more convenient, and more comfortable.

Imagine that you’re driving home on a hot summer day. But rather than turning the air conditioner on when you get home and wait for your house to cool, you simply use your smartphone when you leave your office to tell your smart thermostat to lower the temperature.

Or imagine that you’re cooking dinner, and you ask the voice assistant to read you today’s biggest news stories so that you can focus on making your kid’s favorite lasagne. There is no shortage of possibilities for smart home IoT devices, and home automation seems to be the wave of the future.

Experts estimate that the number of smart home devices shipped will grow from 83 million in 2015 to 193 million in 2020. This includes all smart appliances (washers, dryers, refrigerators, etc.), smart home safety and security systems (sensors, monitors, cameras, and alarm systems), and smart home energy equipment, like smart thermostats and smart lighting.

There are many benefits of home/building Automation which are listed below.

  • Security: Motion sensors
  • Efficiency: Automatic switch off when not in use.
  • Convenience: Control everything from your fingertips.
  • Savings: You save money with an efficient Home automation system.

The first and most obvious benefit to smart homes is a convenience, as more connected devices can handle more operations (lighting, temperature, etc.) and free up the resident to perform other tasks.

As with all shifts in technology, changes will happen in the ways we live and do business. With the actions being taken for more energy efficiency in construction and managing of buildings there is a big potential through Internet of Things. HVAC systems that can make their own intelligent decisions based on presence, weather and lots of other indicators have a great potential to cut energy use and cost.

We are also certain that new business models will emerge. HVAC systems using IoT will be able to predict situations from collected data and have automated alarms for service and maintenance that can facilitate new services.

Paasmer:

Mobodexter’s PAASMER provided the complete set of components to build this solution from End to End satisfying all the needs of the client in the shortest possible time frame.

Here we explain how PAASMER has been used to connect a traditional HVAC system using a custom built IR blaster to the Paasmer IoT platform and how to control the same remotely.

Paasmer_HVAC

The solution has 4 modules, the Hardware, the Misty OS, the Paasmer IoT Platform and the App. We shall look at each of them below.

Gateway Hardware:
The Gateway Hardware consists of Network MCU boards with an IR Receiver and an IR transmitter connected to it. The Firmware that runs on the Network MCU is responsible for connecting to the Paasmer IoT Platform and ability to send and receive data from the Paasmer IoT platform.

It is also responsible for decoding the correct pattern to be sent via the IR transmitter and recording the correct pattern from the IR receiver.

Misty OS:

Misty OS is designed to be flexible, modular and gateway platform agnostic. The core functionality of the OS, Connectivity, H/W interface and middleware component are built into Misty OS. The gateway has interfaces for IR Transmitter and an IR receiver

It operates in two modes, Learning, and Transmits.

In Learning mode, the Hardware learns all the new IR codes that are needed for a particular device and stores the data on the Paasmer IoT Platform specific to the user. The learning mode can be enabled from the App and has options to choose the device type and device subtype. Once all the buttons of the remote have been learned it is ready to work.

In Transmit mode, messages are received from the App via the Paasmer IoT platform inform the Hardware to blast out the appropriate IR signature for the button pressed in the App. This IR signal is blasted across and very wide range using duplicate IR transmitters to cover an almost 360-degree range to control the HVAC system.

Paasmer IoT Platform:

Paasmer is a one stop shop for connecting all your devices to the internet and read data from them as well as control them. The Paasmer IoT Platform hosts the message broker, the necessary business logic, data store and all the necessary interconnections between them. It provides a platform onto which all Gateway HW devices, mobile phones, websites can be interconnected.

App:

The App connects to the Paasmer IoT Platform and based on the user login details and displays the data of the devices that are available for control. The user can select the appropriate device and control the device using the buttons on his screen. These button clicks are translated to the respective messages which are published by the Paasmer IoT Platform.

Paasmer_HVAC_1

In the current scenario a user wants to switch off the HVAC, so he selects the HVAC and then switches it off. These switches off messages are published to the broker on a particular topic. The Gateway Hardware is subscribed to this particular topic and hence receives the message.

The Gateway Hardware then decodes the message and immediately blasts the respective IR signature to turn off the AC.

raspberry-pi_connect to Paasmer IoT Platform copy-min

How to Connect Raspberry Pi 3 to the PAASMER IoT Platform

ManagementTeamMouli1

Srinidhi Murthy

In this blog series we look at how to connect a Raspberry PI 3 to the PAASMER IoT Platform.

The PAASMER IoT Platform makes it simple for Internet of Things companies to build and launch IoT-enabled hardware. PAASMER currently provides an SDK which can be installed on the hardware.

Modifying a few lines of code to provide the correct credentials and sensor information, it is ready to be connected to the PAASMER IoT Platform. The sensor data is then available on the PAASMER Developer Login, which can be utilized and actions taken by using the control fields to control various other sensors connected to the Hardware.

A pre-requisite for using the SBC-SDK is available of the Raspberry Pi 3 hardware running Raspbian Jessie OS. More hardware and software support would be added shortly.

An account created in http://developers.paasmer.co allows for a 30 day trial period to explore the PAASMER IoT platform. After creating and activating the account, the SDK for the appropriate hardware can be downloaded.

Given below are the detailed steps to be followed after downloading the SBC-SDK.

PAASMER IoT SDK for Single Board Computers Running Linux

Overview

The PAASMER SDK for Single Board Computers (SBC) like Raspberry-PI, Intel Edison, Beagle Bone is a collection of source files that enables you to connect to the PAASMER IoT Platform. It includes the transport client for MQTT with TLS support. It is distributed in source form and intended to be built into customer firmware along with application code, other libraries, and RTOS.

Features

The SBC-SDK simplifies access to the Pub/Sub functionality of the PAASMER IoT broker via MQTT. The SDK has been tested to work on the Raspberry Pi 3 running Raspbian Jessie. Support for Other SBC’s running any flavors of Linux would be available shortly.

MQTT Connection

The SBC-SDK provides functionality to create and maintain a mutually authenticated TLS connection over which it runs MQTT. This connection is used for any further publish operations and allow for subscribing to MQTT topics which will call a configurable callback function when these topics are received.

Pre-Requisites

Registration on the portal http://developers.paasmer.co is necessary to connect the devices to the PAASMER IoT Platform.The SDK has been tested on the Raspberry PI 3 with Raspbian Jessie (https://downloads.raspberrypi.org/raspbian_latest)

Installation

  • Download the SDK or clone it using the command below.
    • $ git clone github.com/PaasmerIoT/SBC-SDK.git
    • $ cd SBC-SDK
  • To connect the device to Paasmer IoT Platform, the following steps need to be performed.
    • $ cd external_libs/mbedTLS/
    • $ make
    • $ cd ../../
    • $ sudo ./install.sh
  • Upon successful completion of the above command, the following commands need to be executed.
    • $ sudo su
    • $ source ~/.bashrc
    • $ PAASMER
    • $ sed -i ‘s/alias PAASMER/#alias PAASMER/g’ ~/.bashrc
    • $ exit
  • Go to the directory below.
    • $ cd samples/linux/subscribe_publish_sample/
  • Edit the config.h file to include the username(Email), device name, feed names and GPIO pin details.
    #define UserName "Email Address" //your user name used in developer.paasmer.co for registration
    #define DeviceName "" //your device name
    #define feedname1 "feed1" //feed name used for display in the developer.paasmer.co
    #define sensorpin1 gpio-pin-no-for-sensor-1 //modify with the pin number which you connected the sensor, eg 6 or 7 or 22
    #define feedname2 "feed2" //feed name used for display in the developer.paasmer.co
    #define sensorpin2 gpio-pin-no-for-sensor-2 //modify with the pin number which you connected the sensor, eg 6 or 7 or 22
    #define feedname3 "feed3" //feed name used for display in the developer.paasmer.co
    #define sensorpin3 gpio-pin-no-for-sensor-3 //modify with the pin number which you connected the sensor, eg 6 or 7 or 22
    #define feedname4 "feed4" //feed name used for display in the developer.paasmer.co
    #define sensorpin4 gpio-pin-no-for-sensor-4 //modify with the pin number which you connected the sensor, eg 6 or 7 or 22
    #define controlfeedname1 "controlfeed1" //feed name used for display in the developer.paasmer.co
    #define controlpin1 3 //modify with the pin number which you connected the control device (eg.: motor)
    #define controlfeedname2 "controlfeed2" //feed name used for display in the developer.paasmer.co
    #define controlpin2 4 //modify with the pin number which you connected the control device (eg.: fan)
    #define timePeriod 15000 //change the time delay as you required for sending sensor values to paasmer cloud
  • Compile the code and generate the output file.
    • $ sudo make
  • Run the code using the command below.
    • $ sudo ./subscribe_publish_sample
  • The device would now be connected to the Paasmer IoT Platform and publishing sensor values are specified intervals.

Support

The support forum is hosted on the GitHub, issues can be identified by users and the Team from Paasmer would be taking up requests and resolving them. You could also send a mail to support@paasmer.co with the issue details for a quick resolution.

Stream_Analytics_1

How to setup Stream Analytics for IoT

ManagementTeamMouli1

Srinidhi Murthy

What is Stream Analytics
Stream analytics or Streaming analytics typically means making analytically informed decisions in milliseconds, while examining many thousands of events per second, generated from many millions of devices which can also be enriched by many other disparate sources of data.

Stream analytics is important for institutions and individuals alike. We need to know what is happening now and not miss out on anything important. An event with a particular machine at my productions plant or someone breaking and entering my home is of importance to me now and not later as this helps me in immediately initiating remedial actions based on events.

IoT is a typical use case for Stream Analytics as we have millions of things generating many million events which need to analyze on the fly and make informed choices either automatically or by human intervention.

Stream_Analytics_paasmer

A Streaming analytics platform has the following features:-

  • Data or events are analyzed in almost real time.
    • They may be routine monitoring, counting, alerting and reporting of data.
    • They may also include this filtered data or enriched data to be fed into complex decision-making systems for training and predictive analytics.
  • Every incoming event is distinctly processed.
  • Events may be stored for future usage.
  • Immediate actions are possible after processing of events, albeit simple actions like sending alerts, emails, streaming etc.

Advantages of Streaming Analytics:-

  • Business value of data diminishes with age. With streaming analytics, an immediate action based on data is possible.
  • Immediate threats to life, infrastructure is drastically reduced.
  • Predictive maintenance to cut future losses.

Conclusion: We have options from all three major IoT platform providers AWS, Azure and Google to do stream Analytics. A detailed study on each of this platform will be published as the whitepaper, watch our resource page for this whitepaper click here.

nodemcu1

How to Series Blogs: Connect ESP 8266 / NodeMCU to AWS IoT

ManagementTeamMouli1

Srinidhi Murthy

In this Blog we talk about connecting the simple ESP 8266 / NodeMCU to AWS IoT. Traditionally the simple and easily available ESP 8266 based boards could not connect to AWS IoT. There are two issues that prevent the use of AWS IoT for ESP8266 Arduino and pretty much every other 8-bit microcontroller-based device.

One is the requirement to either support certificates or uses a crypto library to create “signatures”.

The other is TLS 1.2 or higher. If they allowed TLS 1.1 and added a “pre-shared key” authentication system, similar to the rest of the IoT providers’ de-facto standard for devices like these, there would already be another billion devices on the net.
AWS IoT supports web-sockets with MQTT now, which works on ESP 8266 / NodeMCU but not guaranteed.
This is all about to change … Enter the ESP-OPEN-RTOS ….

The ESP-OPEN-RTOS, a community developed the open source FreeRTOS-based framework for ESP8266 WiFi-enabled microcontrollers. This RTOS is intended for use in both commercial and open source projects. Using the ESP-OPEN-RTOS, we have the ability to create a simple event driven RTOS for controlling all Things in the near field via Wifi and also has the support needed to create signatures and supports TLS 1.2 … which means connection to AWS IoT is possible.

ESP-OPEN-RTOS can be installed on any Linux based server like Ubuntu, RHL, SuSE and using the Xtensa tool chain can be cross compiled for ESP 8266 based boards like NodeMCU / Adafruit HUZZAH etc.

The procedure for installing the ESP-OPEN-RTOS, the pre-requisites, necessary SDK’s, toolchain etc is given in detail in the link.

We are not going to delve here on installing the RSP-OPEN-RTOS or the necessary software / SDK. We are going to concentrate on the RTOS Itself and its ability to connect to AWS IoT.

Let’s quickly move to the examples section of the ESP-OPEN-RTOS where we find the AWS IoT example.

Connection to AWS IoT needs the AWS command line Interface to be installed to create policies to allow the Thing (ESP 8266 / NodeMCU) to connect and an ECC based Certificate and private key .pem file to be generated. The detailed procedure is highlighted below.

  • Modify client_config.c to provide your own account-specific AWS IoT endpoint, ECC-based client certificate, and private key.
    1. Your endpoint is in the form of <prefix>.iot.<region>.amazonaws.com. It can be retrieved using the following command:
      1. $ aws iot describe-endpoint
    2. Your ECC-based certificate and private key can be generated by using the following commands:
      1. $ openssl ecparam -out ecckey.key -name prime256v1 -genkey
      2. $ openssl req -new -sha256 -key ecckey.key -nodes -out eccCsr.csr
      3. $ aws iot create-certificate-from-csr –certificate-signing-request file://eccCsr.csr –certificate-pem-outfile eccCert.crt –set-as-active
    3. To convert the certificate or key file into C string, you could try the following example:
      1. $ cat ecckey.key | sed -e ‘s/^/”/g’ | sed -e ‘s/$/\\r\\n”/g’
        Note, more information about using ECC-based certificate with AWS IoT can be found in the following blog
        https://aws.amazon.com/blogs/iot/elliptic-curve-cryptography-and-forward-secrecy-support-in-aws-iot-3/
  • Create and attach AWS IoT access policy to the certificate
    1. $ aws iot create-policy –policy-name test-thing-policy –policy-document ‘{ “Version”: “2012-10-17”, “Statement”: [{“Action”: [“iot:*”], “Resource”: [“*”], “Effect”: “Allow” }] }’
    2. $ aws iot attach-principal-policy –policy-name test-thing-policy –principal “arn:aws:iot:eu-west-1:892804553548:cert/2d9c2da32a95b5e95a277c3b8f7af40869727f5259dc2e907fc8aba916c857e”
      Note, the ‘principal’ argument is the certificate ARN generated from the previous command ‘aws iot create-certificate-from-csr’.
  • Modify include/ssid_config.h with your Wifi access Id and credential.
  • Build and flash the example firmware to the device using the command below:
    1. $ make flash -C examples/aws_iot ESPPORT=/dev/ttyUSB0
      Note, it assumes your ESP8266 is connected through USB and exposed under your Linux host as /dev/ttyUSB0.
  • Once the ESP8266 is connected to AWS IoT, you can use the MQTT client on the AWS IoT console to receive the messages published by the ESP8266 to topic ‘esp8266/status’. You could also publish ‘on’ or ‘off’ message to topic ‘esp8266/control’ to toggle the GPIO/LED (GPIO2 is used by the example).