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.
Step 1: Basic Setup
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.
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.
Step 2: Package Update
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
Step 3: Install New Packages
The following packages are needed for this demo which you have to install manually:
npm install -g firstname.lastname@example.org express-generator mongoskin emailjs mraa
npm install -g socket.io twilio socket.io-client exec-sync email@example.com
npm install -g firstname.lastname@example.org sleep
opkg install git
Step 4: Install Mongodb
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):
● Untar the tgz file like this:
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
Step 5: Setup Web App With Mongodb
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... .
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:
If everything goes smoothly, you should see similar browser screen as shown in the beginning of this step.
Step 6: Setup the Rest of the Demo
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
git clone https://github.com/intelmakermonitor/daycaremonitor.git
Install some packages
tar -xzf daycaremonitor/tools/edi-cam.tgz
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.
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.
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".
Step 7: Start the Demo
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
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
Step 8: 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!