Tag Archives: IoT

Mongoose OS Operating System for Connected Devices

Another OS for IoT applications called Mongoose OS. Like the other OS’s for IoT, Mongoose OS has some security features like:

  • Microchip ECC508A crypto chip support.
  • Supporting mbedTLS library from ARM.
  • Implementation of file system encryption and full SPI-flash encryption on ESP32.

Mongoose implements the API for: HTTP, WebSocket, MQTT and CoAP; for both client and server and with a rich API and a tiny footprint. Moreover, it integrates with Amazon AWS IoT service, Google IoT Core and Adafruit IO online service.

Talking about the SDK; Mongoose prefers to use native SDKs instead of building them from scratch by extending the original ones. The current supported microcontrollers are ESP32, ESP8266, STM32, TI CC3200. You can develop your code in C or JavaScript using mJS engine (part of Mongoose OS).

For device management and firmware building Mongoose uses a tool called mos. This tool works in Windows and Linux as a command line interface or a web UI.

In the video below there is an example of running a built-in web server using ESP WiFi module.

 

Last but not least, Mongoose supports the following hardware interfaces: Bitbang, GPIO, I2C, NeoPixel, SPI and UART. It can also performs remote management for the device such as: file system (list, get, put and remove), configuration, I2C, GPIO and OTA

An example of upgrading the firmware over the air (OTA) is explained in the video below :

 

SYNTHETIC SENSORS, All-In-One Smart Home Sensor

In the era of Internet of Things, we wanted most of our home appliances to become smart. But currently, smart devices may cost much more than their offline counterparts and they often do not communicate with each other. Trying to overcome these limitations, A Ph.D student invented a way to turn entire rooms into smart with a single low-cost device called “Synthetic Sensors“.

Gierad Laput, is a Ph.D. student of computer-human interaction at Carnegie Mellon University. His research program explores novel sensing technologies for mobile and wearable computing, smart environments, and the Internet of Things.

Synthetic Sensor is a general purpose sensor that is powered directly from a wall socket and tracks ambient environmental data to monitor an entire room. It removes the need to attach additional hardware to each of home appliances.

We explore the notion of general-purpose sensing, wherein a single, highly capable sensor can indirectly monitor a large context, without direct instrumentation of objects. Further, through what we call Synthetic Sensors, we can virtualize raw sensor data into actionable feeds, whilst simultaneously mitigating immediate privacy issues. We use a series of structured, formative studies to inform the development of new sensor hardware and accompanying information architecture. We deployed our system across many months and environments, the results of which show the versatility, accuracy and potential of this approach.

The device uses machine learning to recognize the events that happen in the room, like recognizing a particular sound pattern as taking a paper towel, but it cannot monitor when the roll may need to be changed. However, by using a “second order” sensors, the devices can capture counts and send notifications of the need to replenish. This capability can be scaled to an unlimited degree giving consumers highly specific and applicable feedback.

Developers can use the recognized events as triggers for other IoT applications. For example, one could use “left faucet on” to activate a room’s left paper towel dispenser and automatically schedule a restock when its supply runs low.

The Synthetic Sensor is still in prototyping phase, you can learn more about it by visiting its website and read the research paper. Watch this video to see Synthetic Sensors in action:

Post Tweets With Your Raspberry Pi

Raspberry Pi is famous for its great computing strength and ability to run the Linux operating system. In today’s tutorial, you’ll learn how to make your Raspberry Pi tweet. You can add extra features to this project to post tweets autonomously if any specific event occurs. Let’s get started.

Required Parts

You’ll need following parts to make this project.

  • Raspberry Pi running Raspbian OS (Any model)
  • USB Mouse
  • USB Keyboard
  • HDMI Compatible Monitor
  • HDMI Cable
  • USB power supply for Raspberry (5V 2A)
  • Working Internet Connection

Create App In Twitter

You need to create an app in Twitter so that Raspberry Pi can use to make tweets on your behalf. Go here to make a twitter app. The Raspberry Pi will require following parameters to make tweets:

  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret

You can find all these details from your app.

Creating An App In Twitter
Creating An App In Twitter

Store Keys In Raspberry Pi

In this step, you need to create a python file in your Raspberry Pi and store all the Keys and Tokens there. Create a file named keys.py in your working folder with all information in it.

consumer_key = "Place your consumer key here"
consumer_secret = "Place your consumer secret key here"
access_token = "Place the access token here"
access_token_secret = "place the access token secret here"
Get Access Keys And Access Tokens From App
Get Access Keys And Access Tokens From App

Now, save the file and go the nex step of this tutorial.

Install Twython

Well, what is Twython actually? Twython is the premier Python library providing an easy way to access the Twitter data. It’s been tested by companies, educational institutions and individuals alike. This amazing library will make our job a lot easier and the code much shorter. To install the Twython library, follow the given steps:

 sudo apt-get update sudo apt-get upgrade
 sudo apt-get install python-setuptools
 sudo easy_install pip
 sudo pip install twython
 sudo pip install requests
 sudo pip install requests-oauthlib

pip is required to install Twython, so it’s installed in 3rd step. But if you already have pip installed, just ignore that step.

Write The Python Script & Run It

Open a file in your working directory in your Raspberry Pi and rename it to twitter.py. Make sure that it is in the same directory wit previously created keys.py file. Now, copy-paste the following code using any editor or IDE:

import sys

from twython import Twython
from keys import (
 consumer_key,
 consumer_secret,
 access_token,
 access_token_secret
)
twitter = Twython(
 consumer_key,
 consumer_secret,
 access_token,
 access_token_secret
)
message = "My first tweet using Rapberry Pi! Yeh!"
twitter.update_status(status=message)
print("Raspberry Pi successfully tweeted: %s " % message)

Pretty simple, isn’t it? Actually, the Twython library performs lots of tasks behind the screen keeping the code surprisingly small.

Now, save the file and open terminal in your raspberry pi. Write the following command and hit the Enter key to run this Python script:

python twitter.py

That’s all. Now you can see that is your Raspberry Pi is tweeting successfully.

Getting started with Python and Arduino MKR1000 for secure IoT projects

A getting start guide to program Arduino MKR1000 in Python:

The MKR1000 is described as a powerful board that combines the functionality of an Arduino Zero (already supported by Zerynth) and the connectivity of a Wi-Fi Shield, with a Cryptochip for secure communication. The design also includes a Li-Po charging circuit that allows the Arduino MKR1000 to run on battery power or external 5V, charging the Li-Po battery while running on external power.

Getting started with Python and Arduino MKR1000 for secure IoT projects – [Link]

SubPos – Wifi enabled Positioning System

A “dataless” Wi-Fi positioning system that can be used anywhere GPS can’t. Blecky @ hackaday.io writes:

The SubPos Wi-Fi Positioning System is an indoor positioning system that can be used in various environments such as metro lines, shopping malls, carparks, art galleries or even conference centers; essentially anywhere GPS doesn’t penetrate. It could also be integrated into an array of IoT enabled devices, from access points to Wi-Fi enabled light-bulbs.

SubPos – Wifi enabled Positioning System – [Link]

See What Technologies 700 IoT Developers are Using in 2017

Taking a look at what other people do in a certain aspect can give you an insight and an indicator in your own journey. Maybe IoT is one of the cutting edge technologies with rapid changes year after year, if not month after month.

About 700 developers answered Eclipse foundation IoT developer survey. The survey covers a lot of topics:

  • Key IoT concerns.
  • Top IoT programming languages.
  • Top IoT Operating Systems and Distros.
  • Cloud platforms for IoT.
  • Growth of new connectivity technologies.
  • Key Trends.

According the the survey, security is the main concern for IoT developers in terms of data encryption and communication security.

Middleware, home automation, industrial automation, smart cities, energy management, building automation, agriculture, healthcare, automotive and transportation are the top 10 in IoT industry.

Regarding the language used by the majority of developers to build IoT solutions, C is still dominant in constrained devices followed by C++, and Java for gateway devices followed by Python.

according to the survey, constrained devices mostly have ARM Cortex M3 or M0 while Intel X86_64 and ARM Cortex v7-A are for gateway devices.

When it comes to IoT web platforms, Java, Javascript, Node.js, Python and PHP are the top five languages.

Speaking about operating systems, some of the developers use bare-metal approach; they don’t use any OS or RTOS, while most of the others use Linux. It worth to mention that the new RTOS Zephyr seems to be adopted by some developers.

Last but not least, IoT messaging protocols is an important part of IoT development and it seems that HTTP, MQTT, CoAP, in-house (proprietary) and HTTP/2 are the top 5 messaging protocols in the survey.

The full version of the survey is available on Sildshare. Similar survey was made in 2015 and 2016.

Source: cnx-software

Embedded Cryptography For Internet Of Things Security

As Internet of Things (IoT) devices are optimized for lower power consumption and affordability, most of them have poor computing resources. As consequence, these devices are more vulnerable to hacking attacks. The good news is there are several options for using cryptography to make it difficult for hackers to gain access to IoT devices of your smart connected home.

Cheap IoT devices that have little protection or no protection at all can be hacked to flood websites with high traffic and shut the servers down. As “things” are increasingly getting connected to the “internet”, chances are that hackers may have the water or electricity shut off, security system disabled, and even worse – they can cause loss of human life by attacking medical devices.

So, what is the solution? Well, the answer is, “Authentication and Encryption using embedded cryptography”. Now we shall discuss these methods of securing IoT devices from cyber attacks.

Secured Internet Of Things
Secured Internet Of Things

Authentication

For the IoT, authentication works in both directions. An IoT device ensures that it is interacting with an authorized gateway and cloud service, and the cloud service (remote server), in turn, verifies it is working with an authentic IoT node. Only when both the sender and the receiver are sure that they’re dealing with “real” client/server, they proceed further and exchange confidential information. This authentication is done by using a hashing algorithm and shared secret keys to generate a tag known as a message authentication code (MAC). This MAC address is compared with a locally stored address.

Now, it’s clear that effectiveness of the authentication process depends on the strength of the MAC, and the MAC address itself depends on the strength of the hashing algorithm, the length of the key used, and whether the key is shared secretly and stored securely. The current state-of-the-art hashing algorithm for cryptographic purposes is SHA-256 with 256-bit keys. That means if the key is unknown, it will take 2^256 attempts to crack it.

The generated key must be shared over a secure channel to prohibit hackers from cracking it by sniffing the packets. The key can also be shared over an insecure channel using Diffie–Hellman key exchange method. Another important task is to store the key securely. It’s highly recommended not to store the key in the same place along with other application data.

Encryption

AES is the accepted encryption method to encrypt and decrypt messages using digital keys. Symmetric key cryptography uses the same key to encrypt and decrypt the message. So it’s vital to keep the key secret. Asymmetric key cryptography uses the combination of a shared, public key and a private key which is kept secret locally. Asymmetric key cryptography is more useful and safer to use over insecure channels. But, this method is too much computationally expensive. That means it requires more computing resources to deal with asymmetric key cryptography.

Symmetric key encryption
Symmetric key encryption

A typical IoT device may not have enough computational strength to encrypt and decrypt all the data with asymmetric key cryptography. Rather this method can be used to create a secure channel only for sharing symmetric keys that encrypt/decrypt all messages.

To make the data exchange more secure, dedicated authentication chips and cryptographic co-processors can be used. This technique makes embedded systems more power efficient and in the long run, it’s the best thing to do.

Household Power Consumption IoT Meter with Anti-theft Feature

BSP Embed published a video demonstrating a new project to build a connected device to measure the power consumption of household instruments.

The presenter relied in his project on the feature of having a blinking led in modern power meters where each blink means that 1 KWh is consumed.

The device features the following:

HLK-PM01
HLK-PM01

The concept behind this project is straightforward. A wire from the blinking LED of the power meter is connected to an interrupt pin from ESP8266 to count blinks (KWh) and then upload it to ThingsSpeak IoT platform to present data live online and to analyze it later.

To detect tampering, he used ACS712 AC current sensor module and connected its output (analog output) to an ADC input from ESP8266; If data from the sensor shows power consumption while no blinking form the LED is detected then a theft warning status will be issued.

The firmware, written in Arduino C, can be downloaded from Github.

Source: Embedded Lab

Open-Q™ 212 Single Board Computer for your IoT Device

Intrinsyc released it’s Open-Q™ 212 SBC, a full-featured, low-cost IoT computer based on a powerful quad-core ARM Cortex A7 (32-bit) 1.267GHz processor, with integrated GPU and DSP. This single board computer has some nice features such as Wifi, Bluetooth, LCD 720p support, HDMI 720p H.264/H.265 playback, an 8MP camera, four microphone inputs and amplified stereo outputs. It also features 4x USB ports, ethernet, serial interface, RTC clock and Li-Ion battery support. The board is ideal for creating voice controlled devices with noise cancellation technology and other internet enabled projects. The board can be used as a development kit or be embedded on final product. On the software side it supports Android 7 and there is a call for Linux support. This board packs some great features and looks promising in the IoT world.  [via]

“We expect our Clients to use the board first as a development kit and then subsequently as an embedded SBC in their final product. It’s also likely that some Clients would want to de-feature or de-populate the SBC to lower the cost or to fit in a particular enclosure. Our team has the experience in hardware, software and mechanical engineering, we can quickly take the SBC’s core technology as is, and adjust the peripheral set. It’s our Client’s choice on how to proceed.” Said Intrinsyc.

Open-Q™ 212 SBC Specifications:

Processor
• Quad-Core ARM Cortex A7 (32-bit) 1.267GHz, GPU, DSP
Memory/Storage
• 1GB LPDDR3 RAM
• 8GB eMCP Flash
• MicroSD card socket
Wireless
• Pre-scanned Wi-Fi 802.11n 2.4Ghz, with chip antenna and U.FL antenna connector
• Bluetooth 4.1 + BLE
LCD/Display
• Up to 720p LCD or up to 720p HDMI Type A
Camera
• Up to 8MP over 2-lane MIPI CSI
Video
• 720p@30fps playback
• Up to 720p playback with H.264 (AVC) and H.265 (HEVC)
• Up to 720p H.264 (AVC) capture
Audio
• 4x microphone inputs
• 2x amplified speaker outputs
• 2x stereo line outputs
Power
• PMIC and Li-Ion battery support
I/O
• 4x USB 2.0 Type A host mode, Ethernet, Serial, RTC, I2S, GPIO, sensor header
OS Support
• Android 7 Nougat, Call for Linux
Operating Environment
• Input 12V/3A or single-cell Li-Ion battery
• Operating Temperature 0° C to +70°C
• Nano-ITX 120mm x 120mm

Open-Q™ 212 Single Board Computer for your IoT Device – [Link]

LoRa IOT Home Environment Monitoring System

RodNewHampshire @ instructables.com writes:

The LoRa IOT Home Environmental Monitoring System consists of an Arduino Mega based IOT-to-Internet gateway and Arduino Feather based remote stations with environmental sensors. The remote stations communicate wirelessly with the gateway using LoRa radios.

LoRa IOT Home Environment Monitoring System – [Link]