LibMiletus IoT Framework on DragonBoard

by jeferrb in Circuits > Tools

251 Views, 0 Favorites, 0 Comments

LibMiletus IoT Framework on DragonBoard

logo.png

LibMiletus is an open-source interoperability framework that allows IoT devices to identify themselves on a network and thus be controlled by other devices on this network.

Install Dependencies

IMG_20170504_095036312.jpg

We are assuming that you are already running the Debian distro on your board.
Otherwise, you can install it following this guide .

The /etc/apt/sources.list file contains the information needed to install additional software packages.

Open a terminal (Menu -> System Tools -> LXTerminal) and execute the following command to add the Raspibian sources.

$ sudo cat >> /etc/apt/sources.list <<- "EOF"

deb  http://archive.raspbian.org/raspbian  wheezy main contrib non-free
deb-src  http://archive.raspbian.org/raspbian  wheezy main contrib non-free
EOF

If needed, the Raspbian public key can be stored into your apt-get keyring using the command:

$ wget  https://archive.raspbian.org/raspbian.public.key  -O - | sudo apt-key add -

Update the package manager and install the dependencies using the commands:

$ sudo apt-get update

$ sudo apt-get install -y avahi-daemon cmake libmraa-dev libupm-dev

Clone the Repository and Build

Screenshot from 2017-05-04 11:11:30.png

Clone the repository, where you prefer, using the command:

$ git clone https://github.com/MotorolaMobilityLLC/LibMiletus.git

Navigate to the Linux sub-directory and configure the mDNS using the commands:

$ cd LibMiletus/linux
$ chmod +x configure.sh
$ sudo ./configure.sh --ignore_install=yes

To build, just run the builder script

$ ./build.sh

Now, reboot the board and you can execute the standard Linux Example

$ sudo ./bin/linux_example_wifi

Modify the Example

IMG_20170504_092024705.jpg

Make a copy from a similar example for Intel Edison version

$ cp example_libMiletus_edison_wifi.cpp example_libMiletus_dragonboard_wifi.cpp

Connect a LED on some digital pin, open the file example_libMiletus_dragonboard_wifi.cpp and change the BUILT_IN_LED macro to reflect the pin that you just connect.
I am using a Linker mezzanine card starter kit for 96Boards and it maps the digital pin 1 to the DragonBoard pin 23, so, for me ti is:

#define BUILT_IN_LED 23

Now, compile it and execute using the command lines:

$ cd bin
$ g++ -g ../example_libMiletus_dragonboard_wifi.cpp libMiletus.o linux_wifi.o linux_wrapper.o linux_provider.o -o example_dragonboard_wifi -std=c++11 -lmraa
$ sudo ./example_dragonboard_wifi

Now you can control your IoT device through the MiletusApp

You can take a look at the overview page and improve this example adding more sensor and actuators.

Controll Your Device by the MiletusApp

Screenshot_20170504-113758.png
Screenshot_20170504-113809.png
Screenshot_20170504-113813.png

You can use the MiletusApp in your Android smartphone to control your smart devices.

Download the least App release at the download page.

Based on your traits the control interface will be dynamically generated in the App