Archive for the 'IoT' Category

15th May 2015

Raspberry Pi and Docker

May 14, 2015

I decided to checkout Docker on Raspberry Pi.

There is an image available for Raspberry Pi with Docker.  I started with that.

http://blog.hypriot.com/getting-started-with-docker-and-mac-on-the-raspberry-pi/

The procedure was quite simple.  I downloaded the zip file, unzip-ed it and used a Mac to save the image to a SD Card.

A test program – simple httpd server (mentioned in the above website) also worked great

docker run -d -p 80:80 hypriot/rpi-busybox-httpd

 

Posted in IoT | No Comments »

17th Apr 2015

Node.js and hapi

I have been using and enjoying Node.js, especially the part about asynchronous programming.  For a hardware trained person, node should be a thrill.

 

https://nodejs.org/

From their website – “Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.”

Also express was my choice of framework to use node and just came across hapi – a newer and more interesting framework.  hapi – Human Application Programming Interface

http://hapijs.com/

From their website – “A rich framework for building applications and services. hapi enables developers to focus on writing reusable application logic instead of spending time building infrastructure

A nice comparison of express and hapi framework written by  Jonathan Glock  and is available here:

https://www.airpair.com/node.js/posts/nodejs-framework-comparison-express-koa-hapi

I built some simple http server for Internet Of Things applications and so far it looks very simple and easy to use.

Posted in IoT | No Comments »

14th Apr 2015

IoT Experiments – geo-data to cloud (MQTT)

In continuing with my experiments with IoT,

I was googling for ways to send mobile phone data (battery level, GPS location) to a centralized server using MQTT.   The nice thing about a MQTT broker is that it is light weight (compared to other message bus and is well tuned for sensor data; further, it also has some QOS as part of the protocol).

 

Step 1:

I setup a Mosquitto based MQTT broker  (on an Ubuntu 12.04 laptop)

http://mqtt.org/

sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients

su /etc/init.d/mosquitto start
su /etc/init.d/mosquitto stop

Testing:

to subscribe – mosquitto_sub -d -t hello/world

to publish – mosquitto_pub -d -t hello/world -m “hello”

Step 2:

I looked for a mobile app – fortunately OwnTracks (http://owntracks.org/  and https://github.com/owntracks/ios seem to be the best choice).  It is a small app (also available for Android) that sends geo-location to a MQTT server (set up above – all this would be inside a private network).

I downloaded the owntracks app from Apple store and configured it to send data to the server above.

Note:

The MQTT server does not store any information.

On the laptop – mosquitto_sub d -t owntracks/chandra/iphone

On the iphone owntracks app – choose Host ip address (laptop address), default port (1883) and Topic owntracks/chandra/iphone

A quick way to test is to press the square blue button on top (Location Monitoring Mode) and click on ‘Public Now’ button – this will send out a MQTT packet to the MQTT broker (you will see it on the laptop window that is running mosquitto_sub program)

Posted in IoT | No Comments »

14th Apr 2015

IoT experiments – IBM’s IoTF and Rapberry Pi

April 13, 2015

I did some experimental setup for playing with sensor data streaming to the cloud – Internet Of Things.

One that seems quite interesting is IBM’s IoT Foundation - A fully managed, cloud-hosted service that is designed to simplify and derive the value from your IoT devices.

https://internetofthings.ibmcloud.com/

IBM offers a 30 day trial and it offers Device registration, Device and application connective, Secure receiving of data, secure sending of commands to devices and Storage and access to historic data.   The 30 day trial is for their IBM Bluemix cloud services.

It is possible to validate their backend with some simple experiments using their Quickstart - https://quickstart.internetofthings.ibmcloud.com/#/

Here is what I tried with Raspberry Pi (B+) - https://developer.ibm.com/iot/recipes/raspberry-pi/

Step 1: Install the software
curl -LO https://github.com/ibm-messaging/iot-raspberrypi/releases/download/1.0.2/iot_1.0-1_armhf.deb

sudo dpkg -i iot_1.0-1_armhf.deb

make sure the service is running – service iot status

to stop the service – sudo service iot stop

to uninstall the package – sudo dpkg -P iot

Step 2:  To visualize the data

Find the MAC address of Raspberry Pi
service iot getdeviceid

This will return something like this:

pi@SensorTag ~ $ service iot getdeviceid
The device ID is b827eba5b0aa
For Real-time visualization of the data, visit http://quickstart.internetofthings.ibmcloud.com/?deviceId=b827eba5b0aa

By going to the quickstart.internetofthings.ibmcloud.com you can see the data send from the raspberry pi.  This works nice.

——–

 

The data is sent from raspberry pi using MQTT PROTOCOL.

More information is available at the above web site on how to register to IBM’s IoTF organization and register various devices.  It states that once we follow this path, we can send commands to a registered device  (reboot raspberry pi)

Posted in IoT | No Comments »

grupa LGBT