Skip to main content

Posts

Showing posts from 2016

[IoT Home Project] Part 5 - Send data to Azure IoT Hub, control time interval and refac the configuration information

In this post we will discover how we can:
Send all device sensor data that are read from GrovePI to Azure IoT HubRead sensor data at a specific time intervalExtract all configuration data in a separate file Previous post: http://vunvulearadu.blogspot.ro/2016/12/iot-home-project-part-4-sending.html GitHub source code: https://github.com/vunvulear/IoTHomeProject/tree/master/nodejs-grovepi-azureiot
Send all device sensor data that are read from GrovePI to Azure IoT Hub This is a simple task. The function that reads sensor data from GrovePI already returns all the sensor data. The only thing that we need to do is to put this information in the message that is send to Azure IoT Hub. In the future it is pretty clear that we will have different type of messages that we send over IoT Hub. Because of this we shall add a property to the message that is send to IoT Hub that specifies the message type - in our case we'll call the message that contains sensor data 'sensorData'. var dataTo…

[IoT Home Project] Part 4 - Sending temperature data from Raspberry PI to Azure IoT Hub

Previous post: http://vunvulearadu.blogspot.ro/2016/12/iot-home-project-part-3-nodejs-module.html
GitHub source code: https://github.com/vunvulear/IoTHomeProject/tree/master/nodejs-grovepi-azureiot

This post focus on the communication between Raspberry PI and Azure IoT Hub. Until now we developed the Raspberry PI application that is able to read sensors data from GrovePI using Node.JS libraries. Now is the moment to write the Node.JS module that sends temperature data from Raspberry PI to Azure IoT Hub.

Creating Azure IoT Hub instance
The first step is to create a new instance of Azure IoT Hub. Don't worry about Azure costs. There is a free tire of Azure IoT Hub that allows us to send 8.000 messages per day for free. For testing and home use scenarios, I think that this is more than enough.
A nice tutorial on how you can create a new instance of Azure IoT Hub can be found here. Once you create the instace, you'll need the access tokens that can be taken from 'Shared Access …

[IoT Home Project] Part 3 - Node.JS Module that reads sensor data

Previous post: http://vunvulearadu.blogspot.ro/2016/12/iot-home-project-part-2-visual-studio.html
GitHub source code: https://github.com/vunvulear/IoTHomeProject/tree/master/nodejs-grovepi-azureiot

In this post we will continue developing the IoT Home Project, by creating a module for Node.JS that reads the sensor data.

Why we create a Node.JS module?
We want to group all the logic that reads sensor data under the same roof. We design the module in a such a way that it will allow us to initialize an instance of an object that can read all sensors data.

GrovePiSensors Module
The module was is called GrovePISensors and expose 5 functions:
getSoundData - Gets Sounds datagetTempAndHumData - Gets Temp and Humidity datagetDistanceData - Get Distance data from Ultrasonic sensorgetLightData - Get Light datagetAllSensorsData -  Get all sensors data that can be read The getAllSensorsData returns an object, where all this information are available. The sound information are not collected because it…

[IoT Home Project] Part 2 - Visual Studio Code and the first node.js app

Previous post: http://vunvulearadu.blogspot.ro/2016/12/iot-home-project-part-1-initial-setup.html

In this post we will take a look on the initial setup of Raspberry PI, GrovePI and a sample code that helps us to check if node.js and GrovePI works as expected. Before we talk about the initial setup of the device.

Useful tools for Raspberry PI
I recommend to start with a fresh installation of OS. You can download the OS image from https://www.raspberrypi.org/downloads/. I am a big fun of NOOBS, but feel free to use other versions of OS. To write the image on the memory stick you can use Win32 Disk Imager. A basic tools that do his job.

Once you wrote the image on a stick, don't forget to connect it to a monitor and activate SSH. By default SSH is disabled. You can do this from the console, but you can use raspi-config, a nice tools that allow you to do different configurations on your device
sudo raspi-config The SSH options is under 'Advanced Options'. From this tool, you c…

Azure Functions - Things that we need to consider

In the last posts we discussed about how we can write Azure Functions to process images from OneDrive, the support for CI that comes with them and the base functionalities.

In this post we will take a look on things that we shall avoid to do in Azure Functions and what are the differences between Azure Functions and Azure Web Jobs.

Things that we need to considerAvoid HTTP communication between Azure Functions
In complex scenarios, we can end-up easily with Azure Functions that needs to communication between each other. In this kind of scenarios, the first things that we could do is to use web hooks or HTTP requests to communicate between them.
This is not the recommended approach for cases like this. If you reach a high volume of data, you might have some problems.
In serve-less systems the communication channel between components shall be messaging system over any kind of queue system. Not only communication over queues is more cheaper, but the reliability and scaling mechanism are …

[IoT Home Project] Part 1 - Initial Setup

I started some time ago to play with Raspberry PI and GrovePI sensors. After playing for a few weeks I said that I need to do something more interesting.

Mission
Why not combine Raspberry PI and GrovePI sensors with Azure IoT Suite and detect if somebody is at the desk, show STOP sign if the given person is busy and so on. I'll start with very basic use-cases, that will evolve in time. The scope of the projects is to learn different technologies that can be used together

Raspberry PI configuration
The code that will run on Raspberry PI will not be to complex, or this is what I expect now (smile). In this context it doesn't make sense to try to use Windows IoT. Also, the support for GrovePI is better for Node.JS in comparison with .NET.
In the context of my past experience with Debian on Raspberry PI that was good I decided that I will use Debian on Raspberry PI.

Development Environment
First thing is to make the initial setup of development environment. For backed, the story is p…

Azure Functions - Features Review

In the last two posts related to Azure Functions we talk about how we can write functions that can process images from OneDrive and the current integration with Visual Studio and Continuous Integration.
In this post we will take a look over the main features, price model.

Pay-per-use
Personally, this is one of the strongest points of Azure Functions. You pay only what you use, when your code is not running or is not called by an external trigger, you don't need to pay. You cannot want more from the hosting perspective.
When you have zero clients, you pay zero. When you have n clients, you pay for each of them. The pricing model will be described later on.

Multiple-languages support
The number of languages that are supported is not 1 or 2. In this moment we have support for C#, F#, JS (by Node.JS), PHP, Python, batch, bash.
Another interesting feature is that you can come with any executable that can run as an Azure Function. In interesting concept, that I promise that I will follow-…

Azure Functions integration with Visual Studio and CI

In one of my latest posts we took a look on Azure Functions and how we can write an Azure Function that extracts the GPS coordinates from a picture and draw them on the picture itself.

In this post we will look on:

How we can create and edit an Azure Function directly from Visual StudioRun Azure Function on you development machineDeploy Azure Function from Visual StudioSetup continuous integration
How we can create and edit an Azure Function directly from Visual Studio
Until a few weeks before, we were able to create and manage Azure Functions only from the portal or using the API (e.g. using Power Shell library). Starting from now, there is a new tool for Visual Studio that allow us to create and write functions directly from Visual Studio.  The tool allow us to run locally our functions and tests them. Pretty cool, especially when you need to write and maintenance more than a dozen of them. The current version is extremely stable. To tell you the truth, is expected to encounter issues…

[Post-Event] ITCamp Winter Community Event (Cluj-Napoca), December 9, 2016

At the end of this month we had the ITCamp Community Event. This was the last event for this year, so we decided to do something special. In comparison with our past events, we tried to focus more on devices and hardware. We even managed to have a session where HoloLences were presented live - such a cool and interesting presentation.
The event was fully sponsored by Endava. A big thank you for them. Without local IT companies, we wouldn't be able to organize this events.

There were more than 80 people that participate at the event. I'm happy to meet people that are interested to find out more about new technologies and trends. Nowadays staying up to date with all the new technologies and trends is hard and time consuming. This is way I'm such a big fun of this kind of meetings.

The community event had 3 speakers that talk about System Development, Raspberry PI and Azure IoT and HoloLences. You can find more about each session below:

Systems Development in a Changing World …

Writing GPS coordinates on an image from OneDrive using Azure Functions

Let's take a look over Azure Functions, from a developer perspective. In this post we will write an Azure Function that adds the GPS coordinates of a picture as watermark.

If you want to jump to the code, without any other explanations, than feel free to check the GitHub repository - https://github.com/vunvulear/Stuff/tree/master/Azure/azure-function-extractgpslocation-onedrive-drawwatermark 

What is Azure Functions?
The best explanation that I can give is Azure Functions are the AWS Lambda in Azure world. They allow us to execute code in a serverless way, without thinking about where you host the code, you just write the code and run it as Azure Functions.
There are many things that we can say about Azure Functions, the most important things for me are:
You can write code in different languages (C#, Node.JS, PHP, Python, Bash, Batch, PowerShell)Multiple connectors and triggers, from queues to Blob Storage and Google Drive, all of them are supportedFlexible and transparent charging …

ITCamp Winter Community Event (Cluj-Napoca), December 7

Only for Romanian fellows.
În luna Decembrie, ITCamp organizează un nou eveniment pentru profesioniștii IT din Cluj-Napoca. Evenimentul urmează să aibă loc pe data de 07 Decembrie, la sediul Endava (United Business Center, lângă Iulius Mall).
Participarea la eveniment este gratuită. Mulțumim Endava pentru găzduire. Te poți înregistra folosind oricare din următoarele site-ur: Meetup: https://www.meetup.com/ITCamp-Community/events/235877883/Eventbrite: http://itcamp-community-2016-12.eventbrite.comFacebook: https://www.facebook.com/events/681826641995539/
Program: 17:45 – 18:15 – Welcoming & Registration 
18:15 – 19:00 – Systems Development in a Changing World – Eoin Woods
19:00 – 19:15 – Coffe Break
19:15 – 20:00 – Empower your Raspberry PI using Azure IoT Suite – Radu Vunvulea
20:00 – 21:00 – Augmented Reality in Industrial Predictive Maintenance, including HoloLens – Tibor Molnar
21:00 – 22:00 – Networking
Descrierea sesiunilor: Systems Development in a Changing World (Eoin Woods)
The way we b…

Why Device Twins from Azure IoT Hub are important for us

This post is focusing on Device Twins that are available on Azure IoT Hub.
If it is your first time when you hear about Azure IoT Hub, than you should know that Azure IoT Hub is a powerfull serviced offered by Azure that can connect, manage and monitor your devices. More information about it can be found on Azure site

Why Device Twins?
When we are working with devices, we will find all the time information that is specific to individual device. Information like device serial number, customer information, location, device configuration is part of this type of information.
In an ideal world, we should have a unique location where all this data is stored. No custom code of functionality should be developed by us. Azure IoT Hub is offering this to us through Device Twins.

What are Device Twins?
It’s a collection of properties that specific for each individual device. Device twins contains 3 types of structure (where the last two are similar, but have different roles)

Tags: Device specific in…

Initial RDP connection on a remote machine over Relay Hybrid Connection and Web Sockets - Azure Relay

In one of my latest post I presented how we can establish a PuTTy connection between two different machines through Azure Relay Hybrid Connection using web sockets.
Today, we will take a look over a Node.JS sample that initiate the tunnel that can be used for an RDP connection between two machines over Azure Relay.

Context
Before jumping to the solution let's take a look on RDP Connection Sequence (https://msdn.microsoft.com/en-us/library/cc240452.aspx?f=255&MSPPError=-2147217396).
As we can see in the connection sequence flow, there are multiple connections that are open during a RDP session. The initial session that is open between client and server is used for the initial handshake and credentials validation. Once the credential are validated, the current connection is closed and other socket connection are open automatically.
In the current sample, we will update the original one that was written for Telnet. The first 5 steps from the flow will be supported, until in the mo…

[Post-Event] ITDays, Cluj-Napoca - Nov. 18-19, 2016

Durring 18th and 19th of November, another edition of ITDays took place in Cluj-Napoca. This was the 4th edition of ITDays. In comparison with other years, this edition was not only bigger, but the quality of speakers and the content was much better. I would even say that ITDays evolved in a good conference where you can find good quality content.
I had a great time and I hope that we will meet next year to. I was invited at ITDays to talk about Docker on Windows. The most funny thing was that I prepared the slides 3 weeks before the event. During this period Docker team together with Microsoft released some new features for Windows and I had to update my slides and demos.
Title: Docker + .NET Core Demos Abstract: Come to join a 30 minutes demo, where we will discover how we can work with Docker and .NET Core, how we can run Docker on Linux and Windows and what are the most important commands that we shall know. At the end of the session we identify 3 cases when Docker can be our best f…