Eugene Marinelli 5/10/08 How to set up and run Healthnet. Parts PC with bluetooth Gumstix board Gumstix battery power supply or wall power source GPS unit with serial connector Xbee breakout board with serial connector 0-2 Telos motes Accelerometer with connector Pulseox sensor EKG pads EKG circuit Setting up the gumstix 1) Power the gumstix and wait about a minute for it to boot. 2) Establish a bluetooth connection to the gumstix from a PC by any means necessary. You might need to connect to it via serial first and try some of the commands in arm/startup_script.sh. 3) Go to the arm directory and run ./install.sh. This install script assumes that the IP address of the gumstix is 192.168.50.3. This can be changed by modifying the first line of install.sh. 4) Disable getty on the gumstix by any means necessary (remove getty from /etc/inittab). This must be done so that we can use ttyS0. 5) Connect the XBee breakout board to the main serial port (ttyS0). 6) Connect the GPS unit to the other gumstix serial port (ttyS2). Setting up an XBee. 1) Open up a serial console with it. 2) Enter "+++" and wait for the OK. 3) Enter "ATMM2" "ATID14" "ATCHC" and "ATAP1". 4) The XBee should now be in the right mode. Setting up the Telos motes. 1) Download and install tinyos on your computer. 2) Go to one of "telos/ekgnode" (for EKG) or "telos/othernode" (for pulse oximeter and pedometer) and run "make telosb" 3) Install the software to a mote by plugging a mote into a usb port and running "make telosb reinstall bsl," (like with any tinyos program). 4) Plug in the EKG board or the other board (without and with accelerometers, respectively). The red wire goes to pin 1 on the 10-pin plug. For the pulse ox board, the white and black go to pins 2 and 5 (it doesn't really matter, but you should probably swap them until you get a red light from the pulse oximeter as soon as you press the user button, which turns it on). 5) Hook up the wires. Swap them around until you get data. 5) You can test if it's working by hooking up an XBee to the computer and running either telos/sensserve.py (for both boards) or telos/ekgnode.py (to visualize ekg data). Testing the system 1) ssh into the gumstix and run ./run_all.sh in a new screen. Detach the screen and log out. 2) Do some activity. If you want GPS data, you will probably need to go outside. The blinking of the red light on the GPS device indicates that it has a "lock" i.e. it is getting valid position information. 3) When the activity is complete, you can upload the data. Sqlite3 and the sqlite3 python library must be installed on your system. The command sequence should go like this: cd common/db ./create_db.sh ../../pc/data/healthnet_test.db # Create empty database. cd ../../pc/uploader ./cp_uploader.py -d ../data/healthnet_test.db # Upload the data (note that gumstix ip can also be set using # -i option -- it is 192.168.50.3 by default.) 4) Upload pc/data/healthnet_test.db to the healthnet website by going to http://www.the5threvolution.com/healthnet, "Upload new data", and selecting the pc/data/healthnet_test.db file. A new exercise should show up on the page on the left. Following this link will take you to a page with your exercise data. Shutting down the system 1) Unplug gumstix. 2) Take batteries out of telos motes.