At the Intersection of Empathy & AI

Intel Maker IOT Boiler Plate

Not an internet-controlled hot plate. A boilerplate setup for getting started with Intel Maker IoT projects.

Hi, If you have stumbled upon this link, it would be because of two possible reasons: 1. You want to build an internet controlled plate(?). 2. You saw/heard about one of my repositories somewhere and want to get the bare bones of code to build scale-able, real world application. Well if you are here for the first reason, let me assure you, I will write a tutorial on that too, but this one is strictly for second reason.

I am guessing you already know what IOT means. What it stands for. From and industry point of view, a prototype is not going to suffice. It is not going to be scaleable, affordable and sustainable. My aim here is to give out the bares bones of what is needed to build something that addresses all of the above 3 catch words. A typical IOT project consists of 3 parts: 1. Sensors which are read by a processor. 2. A server which handles/stores/manipulates/makes sense of all the data coming in from sensors. 3. A application web/mobile which could show you what is really happening in the sensor systems.

So let's start with 1. How do you interface sensors with an IOT capable board like Intel Edison? How do you read data, how do you make I/O functions work? How do you ultimately send the data to the servers? We are going to address all these problems here. My choice of programming language here is Python. First import the library we are going to use: import mraa. This is how we declare pins. Analog Reading, Digital Pin Declaration. Almost all your projects will require the above basic setup for the sensors you integrate. Grove sensor kit is great way to start your projects.

Connecting Intel Edison to the server/cloud. So to connect your Edison to the server, you first need to have a server running. Usually there will be two main things you would do with a server, from your board: 1. POST some values to the server. 2. GET some values from the server to act on it. Both POST and GET are HTTP request which we are going to make using an amazing python module called Requests. First of all you will need python package manger called pip to be installed on your Edison. Now that you have your board ready with the core modules, look through the codes to see how to Send GPIO values to the cloud, Send Images to the cloud, Test the cloud for its working.

Servers. So the next thing to do is to write servers. Servers are a very important part of your project. It is the place where all the communication between your mobile app and the board happens. The servers written here are the very basic sketch on how you can use NodeJs with your IOT application. Intially you will host a server on your work computer/laptop. This will create something called the local host. To access this you will have to go to your browser and type localhost:3000/routeName. routeName is the link you direct your requests to for accepting GET or POST requests. Install NodeJs on your system. I use Heroku to test all my applications. If you have installed NodeJs on your system, it won't be hard for you to install it on Heroku at all! Run the servers using: node serverName.js. I will be using various examples to show the same.

Member discussion