DNSed: A simple useable internet name for large scale IoT

Intent

When there is a city wide Wireless Sensor Network (WSN), this has to be resolved with anything meaningful, say name of where it is located. then this has to be the name that it should be resolved to.

to creat DNSed, as in past tense in English for DNS. To DNS the shit out of the IoT. To create an amazing network and to overload the DNS servers. To create everything out in the open, so everything in the Hollywood movies can come true.

Scenario

  • When a water tank level indicator at place called “Meereen”.
  • There is a number for the water tank which is 256.

then, this can be described in the internet nomenclature as

  • domain name: meereen.got
  • object: water tank
  • number: 256
  • sensor type: level indicator

this would translate to an internet name of “level.256.water.meereen.got”

usually, there is only a sensor in a an area and they are organised in cluster.

in that case, Meereen’s water tank is being referenced, and the sensor 256 is being addressed where the level is being asked for, https://256.water.meereen.got/level where level is a service provided by the sensor

 

Possibility:

It is possible to use BIND9 to build a DNS server, then create the zone records to point to the different sensors. the tutorial gives a good insight on deploying a BIND9 DNS server [3]. There are very good python libraries available in such an instance to build an DNS server and then work with their API. The following are some interesting DNS APIs for python to process DNS records on server.

[1] http://www.dnspython.org

[2] https://pypi.python.org/pypi/easyzone/1.2.1

Implementation:

In this effort, the implementation takes advantage of the REST API provided by DigitalOcean to make the DNS. as the idea is to create a very dynamic name resolution for IoT devices and this does not involve building a DNS server from scratch. The DNSed will be a library that will used in the IoT devices as well to communicate to the central server which will be further proxied to the DNS Server of DigitalOcean. This architecture would provide a method to have a better security by not distributing the API keys throughout the network on every device.

The functional block diagram below tries to describes this exact architecture

drawit-diagram-2

References:

[1] http://www.dnspython.org

[2] https://pypi.python.org/pypi/easyzone/1.2.1

[3] https://www.digitalocean.com/community/tutorials/how-to-configure-bind-as-a-private-network-dns-server-on-ubuntu-14-04

[4] https://developers.digitalocean.com/documentation/v2/#domain-records

[5]
drawit-diagram-1

Raspberry Pi NFC reader driver installation ACR122u

First add the following dependencies for the NFC driver and other modules

sudo apt-get install pcscd libusb-dev libpcsclite1 libpcsclite-dev dh-autoreconf

I also installed the drivers from the official website for my device.

it can be found here (disclaimer: I do not still not know if this step is required)

then install the python package with pip

sudo pip install nfcpy

 

now use the documentation http://nfcpy.readthedocs.io for using the nfc card with python. The python interface doesn’t use the LED notifications on the device, I have to find out how it works with the lights!

3 step procedure for installing raspian SD card image on Mac osX : CLI based

Yup, just like always open the terminal and put in the following to find the dev path of the SD card.

diskutil list

Screen Shot 2015-09-23 at 18.43.33
NO NAME with ID disk5 is what we will have to unmount

diskutil unmountDisk /dev/disk5

Screen Shot 2015-09-23 at 18.47.46
Now, copy the data to the SD card using the dd command on the terminal after to cd into the folder where you have downloaded the image. Usually its in the downloads folder when you do it with safari.
sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=/dev/rdisk5

After sometime the terminal cursor blinks, it will look like the following image when it is successful. I didn’t come across the error from the actual source page, but when it does, look it up here -> Official Documentation (which is also my source)

Screen Shot 2015-09-23 at 18.55.05

as the title says, lets hit the raspberryPi with the new card and kick on with some electrons!