Daycare Monitoring and Tracking System Using Intel Edison Development Kit

by akz002 in Circuits > Wearables

3302 Views, 12 Favorites, 0 Comments

Daycare Monitoring and Tracking System Using Intel Edison Development Kit

intro.png

We have built a daycare monitoring and tracking system using Intel Edison board along with Bluetooth Low Energy (BLE) devices and a USB camera. It is a demonstration of how easy the Intel Edison DevKit can be used to build a solution along with other IOT/wearable technologies to address some real world problems.

The idea is for each child in a daycare to carry a BLE wearable device like a bracelet or a pin attached to the kid’s backpack or cloth such that when a kid is dropped off at the daycare center, an Intel Edison board is able to scan and detect the kid’s BLE unique ID and then do a database lookup and if there is a match, it will send out a “your kid has arrived” email to the kid’s parents informing them that their kid has arrived. Once a kid leaves the daycare, the Intel’s Edison board is able to detect the event and send a “your kid has left” email to the parents. A webcam is also connected to the Intel Edison to allow parents to see their kids’ activities via web browser.

Here is the list of the hardware components for this tutorial:

● One Intel Edison board with USB cables for the serial output and external power supply.

● An UVC supported webcam (we test it with Logitech HD Webcam C270).

● Bluetooth BLE devices (we test it with Estimode BLE sensors).

Here are the major software components for this tutorial:

● Yocto Linux distribution for Edison from Intel.

● Node.js with many packages such as bluetooth scan, email, database, webserver, etc.

Here are the things that you need to prepare before running the demo:

● Two email addresses: one for sending out email notification and the other to receive notification emails when a kid arrives or leaves. It is fine to use one email address for both send and receive for the demo purpose. For example, we tested it with one gmail account.

● One or more BLE devices with their UUIDs.

● The RSSI value associated with those BLE devices to indicate a kid has arrived or not.

● The IP address of the Edison board’s wifi interface.

The following instructions are based on the Intel Edison’s Linux Yocto released image on 2015ww05.

Basic Setup

step1.png

You first need to log into Edison terminal using "root" as the user name. No password is needed. Note that all the following commands should be issued under Edison terminal prompt.

Setup wifi

This is the first and most important step before you can continue with the rest. Use:

    root@edison:~# configure_edison --wifi

Then follow the prompted instructions as shown in the 1st screenshot.

To verify the wifi is setup properly, you should be able to see a similar entry when issue "ifconfig wlan". As can be seen from the 2nd screenshot, the wifi IP address is 192.168.123.112.

Update the /etc/profile file

Issue the following commands so that you don’t need to do this every time the board reboots:

    echo "rfkill unblock bluetooth" >> /etc/profile  
    echo "export PATH=/home/root/bin/mongodb-linux-i686-2.6.8/bin:$PATH" >> /etc/profile

Reboot the Edison board

Type “reboot” to reboot the Edison board. See the 3rd screenshot.

Package Update

step2.png

The default filesystem contains various packages that should be updated by using the following commands (see http://alextgalileo.altervista.org/edison-package... for more details.):

echo "src/gz all  http://repo.opkg.net/edison/repo/all" >> /etc/opkg/base-feeds.conf 
echo "src/gz edison  http://repo.opkg.net/edison/repo/edison" >> /etc/opkg/base-feeds.conf
echo "src/gz core2-32  http://repo.opkg.net/edison/repo/core2-32" >> /etc/opkg/base-feeds.conf
opkg update

Install New Packages

The following packages are needed for this demo which you have to install manually:

npm install -g express@4.12.3 express-generator mongoskin emailjs mraa       
npm install -g socket.io twilio socket.io-client exec-sync noble@0.3.9
npm install -g async@0.9.0 sleep
opkg install git

Install Mongodb

Install mongodb.png

Note that opkg can’t install the mongodb package. So need to do the following on your Edison board:

● Download mongo linux package: (only 32-bit works on Edison):

cd ~
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.8.tgz 

● Untar the tgz file like this:

mkdir ~/bin
cd ~/bin
tar -xvzf ../mongodb-linux-i686-2.6.8.tgz

● Check the installation

Now when you do “ls ~/bin/mongodb-linux-i686-2.6.8/”, you should see the following output:

            GNU-AGPL-3.0         README               THIRD-PARTY-NOTICES  bin

Setup Web App With Mongodb

mongodb-test.png

Note: make sure you have at least ~200MB of free disk space in your home folder before continue!

Our web application with database capability is based on an excellent tutorial by Christopher Buecheler published at: http://cwbuecheler.com/web/tutorials/2014/restful... .

Installation

Here are the steps to set this up:

1.  cd ~
2.  git clone   https://github.com/intelmakermonitor/packages.git

3. mkdir ~/node-ex4. cd ~/node-ex

5. tar zxf ~/packages/node-tutorial-2-restful-app.tgz

6. cd node-tutorial-2-restful-app

7. git apply ~/packages/restful-patches/0001-one-patch-for-ammf-demo-on-2015-05-16.patch

8. mkdir data

9. npm install

Start mongodb daemon

To start the daemon and run in background, do:

rm -rf /home/root/node-ex/node-tutorial-2-restful-app/data/*

mongod --dbpath /home/root/node-ex/node-tutorial-2-restful-app/data &

Test the database web interface

Issue these two commands to start the web server:

cd ~/node-ex/node-tutorial-2-restful-app
node ./bin/www &

To see the database via web interface, just find your Edison’s IP from step 1 and from the browser visit it with the port 3000. In the above example, since the IP address is 192.168.123.112, can do:

http://192.168.123.112:3000/

If everything goes smoothly, you should see similar browser screen as shown in the beginning of this step.

Setup the Rest of the Demo

step6.png

Because everyone has different RSSI values for their BLE devices, different IP address for the Edison board and different email addresses for sending out email notifications, there are some modifications a user has to make based on his/her own setup. That's why this is the last but also very tedious step to setup the rest of the demo.

Clone the demo repo

cd ~ 

git clone https://github.com/intelmakermonitor/daycaremonitor.git

Install some packages

cd ~/daycaremonitor/tools/noble-ble
npm install
cd ~ 
tar -xzf daycaremonitor/tools/edi-cam.tgz

Modify email_demo.js

This file is in the ~/daycaremonitor/tools/noble-ble folder. Replace those fields starting with YOUR_... with the proper values. 1st screenshot is an example of a working email_demo.js file.

Modify bluetoothscan.js

This file is in the ~/daycaremonitor/tools/noble-ble folder. Replace those fields starting with CHILD_... with the proper values. 2nd screenshot is an example of a working bluetoothscan.js file.

Setup webcam

Make the following two changes related to the IP address of your Edison board:

● Modify the ~/edi-cam/web/client/index.html. Search “192.168.1.12” and replace it with your Edison board’s IP address.

● Modify the ~/daycaremonitor/tools/do_ffmpeg.sh with your board's IP address.

● Reboot the board by typing "reboot".

Start the Demo

pic 7.1 - arrived.png
pic 7.2 - RSSI.png
pic 7.3 - offsite.png
pic 7.4 - email notification.png
pic 7.5 - webcam.png
pic 7.6 - last.png

Once the board is rebooted, executing the test scripts for the Bluetooth demo and the live video streaming as below:

cd ~/daycaremonitor/tools/noble-ble 
./test.sh 
cd .. 
./do_ffmpeg.sh

http://192.168.123.112:3000/ will show the web interface of database.

  • The 1st screenshot shows that Danny is in the daycare already since the “Status” is “arrived”.
  • It is actually based on the RSSI absolute values less than our threshold value of 85 (for our demo based on Estimode BLE devices) as shown in the debug screen (2nd screenshot).
  • When moving the BLE device away from the Intel Edison board, you can see the status changed to “off site” from 3rd screenshot.
  • 4th screenshot shows that one has received two email notifications already.
  • http://192.168.123.112:8080/ will show the live video streaming as shown on the next screenshot.
  • The last screenshot is the terminal screen output

Future Extensions

This demo shows how to build a daycare monitoring and tracking system using Intel’s Edison board along with Bluetooth low energy devices and an usb webcam. Most of the challenges to build the system, as you can see already, are around the software side. And thanks for the readily available demo code/online articles around Intel Edison board, we were able to make this demo to work. Hope our work can contribute to the fast growing Intel’s Maker community by bringing people’s interests to try it out and even extend it to real product from where we are today!