Headband Helper Log
- 1 Links
- 2 Week of January 27th - February 2nd
- 3 Week of February 3rd - February 9th
- 4 Week of February 10th - February 16th
- 5 Week of February 17th - February 23rd
- 6 Week of February 24th - March 2nd
- 7 Week of March 3rd - March 9th
- 8 Week of March 10th-16th
- 9 Week of March 17th-23rd
- 10 Week of March 24th-March 30th
- 11 Week of March 31st-April 6th
- 12 Week of April 7th-April 13th
- 13 Week of April 14th-April 20th
- 14 Week of April 21st-April 28th
Week of January 27th - February 2nd
- Met with Professor Feher and Ethan Shry (TA) to discuss which direction to take our project. In the end, we settled on doing a wearable headband that has a Rasberry Pi and accelerometer that can collect impact data and transmit it to a web platform for interpretation (Jarrod, Katy, 30 min).
- Researched causes of concussions and CTE. Determined that tracking many minor collisions with the purpose of developing a conclusion about an individual's risk for CTE would be challenging because there is limited research in that area. Decided instead to continue forward with tracking concussions, which occur when an individual sustains 95g's to the head (Jarrod, Katy, 30 min)
- 3rd class meeting and discussed our next steps for project development (Jarrod, Katy, 1 hour)
- Updated our Wiki page (finalized name "Headband Helper")
- Assigned the nightlight project and the blackjack project.
- Jarrod will focus on the nightlight project
- Katy will focus on blackjack
- Katy was briefed after class on the blackjack project, while Jarrod continued formatting the Wiki page and updated the weekly log. We will likely meet over the weekend before our Monday meeting to finalize project proposal and discuss scheduling.
- Started blackjack project (downloaded Node, set up MySQL database- unsure of step about creating project directory) (Katy, 2 hours)
- Reformatted wiki page, with updates including: reworked Gantt Chart, updated budget, challenges, and minor format changes (Jarrod, 30 minutes)
- Researched parts necessary to build network, and settled on an accelerometer (see link on main page) (Jarrod, 45 minutes)
- Learning how to add an image to the wiki took a long time (Jarrod, 45 minutes).
Week of February 3rd - February 9th
- Worked on blackjack tutorial- configured & built API using Node.js (Katy, 1.5 hours)
- Worked on nightlight tutorial- built circuit in breadboard, flashed the Rasberry pi, and started pi on a monitor (Jarrod, 2 hours).
- Entire team (including professor and TA) met to discuss what to do moving forward, namely: what type of communications our project would use, what our final design will look like, and possible stretch objectives. (Jarrod, Katy, 30 minutes)
- Continued to research our accelerometer system and how to implement it with respect to our system. Also discussed system design and what final product will look like/steps it will take to get there. (Jarrod, Katy, 1 hour)
- Had weekly meeting in Cupples II. Discussed what we needed to have by our Monday meeting with TA and Professor, as well as what parts we should order (Jarrod, Katy, 45 minutes)
- Created presentation for Friday (Katy, 1 hour)
- Continued working on blackjack tutorial- created API routes, client webpage, researched asynchronous HTTP calls (Katy, 1 hour).
Week of February 10th - February 16th
- Entire team met to discuss project. Discussed accelerometers and batteries to order, need to improve Gantt chart, wiki page, and presentation (Jarrod, Katy, 30 minutes)
- Updated Gantt chart (Jarrod, Katy, 30 minutes)
- Researched batteries (Jarrod, Katy, 30 minutes)
- Determined 1000mAh battery is sufficient (based on research from this website) (Katy, 15 minutes)
- Updated Wiki (Katy, 15 minutes)
- Began SSHing with the raspberry pi; got to the point where I can send a test email from the pi to my email address (Jarrod, 1 hour)
- Had weekly meeting in Cupples II, watched presentations by other groups. Also discussed ordering parts, determined we will start by using a larger battery for simplicity and then miniaturize later if possible (Jarrod, Katy, 1 hour)
- Finished Blackjack tutorial, however when attempting to test it using npm start command, received an error saying "Cannot find module 'mysql'" Attempted to debug this error and noticed that my package.json file does not have a section titled requirements which contains the four packages (axios, mysql, express, & body-parser) although it does contain a node_modules folder with hundreds of subfolders. There are four files in the node_modules folder titled axios, mysql, express, & body-parser, but I'm not sure they are the same as the ones I am missing in my package.json folder. (Katy, 1 hour).
- Created rough draft of database schema (Katy, 30 minutes)
- Finished SSHing tutorial for the Raspberry Pi. Troubleshooting took the majority of time, with problems including: inability to launch certain command functions; failing to transmit actual IP address in reboot email; and getting the device to connect to Wi-Fi. However, all debugging was successfull, and pi performs as expected. (Jarrod, 1 hour and 30 minutes).
- Updated Gantt Chart with post-Spring Break goals, and worked on presentation. (Jarrod, 30 minutes).
- Created rough draft of API routes (Katy, 30 minutes)
Week of February 17th - February 23rd
- Entire team met to discuss project. Discussed strategies for communication from Pi to the internet. We are considering adding a WiFi dongle to the Pi to allow it to simultaneously receive data from the helmets and broadcast this data to the server. Also discussed preliminary strategies for filtering data, as well as goals for upcoming week. (Jarrod, Katy, 30 minutes)
- Walked through API routes and database structure with Ethan following the meeting. Will attach picture of updated database structure and post link to updated API routes. (Jarrod, Katy, 30 minutes)
- Link to API route
- Worked on AWS Lightsail tutorial. Got through spinning up a server instance, configuring the static IP, and installing the server software (nodejs/pm2) (Katy, 1 hour).
- Worked on Pi/LED function. First step was to build a circuit and write code that would turn the LED on from the Pi, which was successfully done. Next, worked on adding input/output functionality to circuit (using a button). Ideally, want the light to turn on when button is pressed, off when released. This took a while, and I was unsuccessful on my first attempt: plan on returning another time during this week. All coding was done with python directly through the Pi's terminal. Two files created: LED.py and button.py. Wired circuit to GPIO pins on pi, and learned what they all do (via google search of pi 3 B+ pinout). One fun troubleshooting mishap: was trying to use male-male wire to connect to GPIO pins, and didn't realize why it was so hard. After asking TA, learned they had male-female wires, which were infinitely more effective. (Jarrod, 1 hour 30 minutes).
- Continued work on input/output via GPIO pins on pi. Scrapped code button.py and found a different website, made new file called button2.py (clever) and wired the system. See picture of wired system. LED turns on when button is pressed, and off when released. Additionally, on/off appears in command window. Next Steps will likely be to add a blink code, that makes LED blink when button is pressed. (Jarrod, 1 Hour 15 minutes).
- Worked on presentation, rehearsed (Jarrod, Katy, 45 minutes)
- Class meeting- presented proposal (Jarrod, Katy, 45 minutes)
- Accelerometers arrived!
- updated database schema diagram (Katy, 30 minutes)
- worked on AWS Lightsail tutorial- finished except encountered a problem specifying the name SERVER_SCRIPT_PORT for the Port range in my new firewall rule (Katy, 1 hour)
- created FSM (wireframe) diagram for web interface (Katy, 1 hour)
Goals for next week:
- accelerometer arrived so Jarrod will be focusing on testing and getting it working with the pi
- Katy will be working on implementing API routes
Week of February 24th - March 2nd
- Met with TA and professor. Discussed goals for the coming week, and what needs to be accomplished before Spring Break. Jarrod needs to get the accelerometer working with the pi (able to get readings with input). Additionally, a case needs to be built for the night light, and need to SSH into the Pi Zero W. Katy needs to focus on getting the Pis talking before the break. This will be challenging, especially given the number of midterms coming up before the break, so time management will play a huge role. (Jarrod, Katy, 1 hour)
- After meeting, worked with Ethan on updating web interface structure and trying to get one final element of the AWS Lightsail tutorial to work. We were unable to troubleshoot the error because a specific command kept causing the server to fail (?). Will keep trying later this week and potentially spin down this server instance and spin up a new one. (Katy, 30 minutes)
- Time Spent: (Jarrod, 1 hour) (Katy, 1.5 hours)
- Researched Raspberry Pi ad hoc IP network, what an ad hoc network even entails. Will start trying to things this weekend. (Katy, 1.5 hours)
- Main links:
- What is an ad hoc IP network? https://en.wikipedia.org/wiki/Wireless_ad_hoc_network
- How to configure on raspberry pi? https://wiki.debian.org/WiFi/AdHoc
- Other helpful links
- Main links:
- Time spent: Katy, 1.5 hours
- Spent an hour and a half trying to SSH into Pi zero (flashing SD, getting parts, realizing I was missing a cable, finding the missing cable, etc.). After I had everything needed, realized that I had no HDMI converter, and so couldn't connect to a monitor to configure the Pi. Finally decided to move on and try and hook up accelerometer to the pi 3. Then spent 30 minutes researching how to create acceleremoter system, including the wiring of the circuit, if there was any existing code I could use/modify to run the system, and electrical requirements and other details about the interface. Attempted to modify code to fit my specific accelerometer, but need to verify I did it correctly before I'm ready to run the system.
- Worked on getting ad hoc IP network set up (Katy, 2 hours)
- I will primarily be following this tutorial: https://wiki.debian.org/WiFi/AdHoc
- not sure whether I should be modifying the /etc/network/interfaces.d file or /etc/dhcpcd.conf file
- I ended up trying to write my changes to /etc/network/interfaces.d but when I tried to save them I received an error message saying "Can't open file to write"
- I also tried to go through command line following this tutorial https://classes.engineering.wustl.edu/ese205/core/index.php?title=Ad-Hoc_Network_%2B_Raspberry_Pi but when I did I received an error saying "Error for wireless request "Set Mode": SET failed on device wlan0; Device or resource busy"
- Time Spent: (Jarrod, 2 hours 30 minutes, Katy 2 hours)
Goals for next week:
- finish ad hoc IP network (Katy)
- get it set up on the pi 0W, test communications
- conduct testing on accelerometer (Jarrod and Katy)
Week of March 3rd - March 9th
- Successfully wrote to etc/network/interfaces file on the pi 3 using nano command (Katy, 30 minutes)
- tried setting up configurations on pi 0W but I was unable to get the pi to connect to the monitor station (despite having the microHDMI and microUSB converters)
- Total Time: Katy 30 minutes
- Met with TA and Professor. Discussed goals for upcoming week and spring break. (Jarrod, Katy, 30 minutes)
- establish pi to pi communication
- webpage hosted on AWS that says "hello world" (static output)
- webpage hosted on AWS that displays a number which is incremented every time a button on the pi is pushed
- master pi communicating with AWS and headband pi simultaneously
- wireframe diagram
- Enabled SSH on pi 0W (Katy, 30 minutes)
- attempted to finish ad-hoc set up on pi 0W- however, ran into an error I couldn't resolve so I decide to follow a tutorial suggested by Ethan in which the master pi essentially becomes a router (Katy, 1 hour)
- Total Time: Jarrod 30 minutes, Katy 2 hours
- Attempted to get accelerometer working. Could not find tutorial for my specific part, so used a similar tutorial and hoped to modify to work for my part. After wiring and coding, ran the program, but couldn't get it to work. Pi is on, but doesn't record any types of hits. Didn't have headers, so just touched wires to part, which I think is my primary problem. Need to troubleshoot. (Jarrod, 2 hours).
- Found headers, learned how to solder, and soldered both accelerometer and pi 0 (Jarrod, 30 minutes).
Week of March 10th-16th
SPRING BREAK Friday 3/15
- attempted to reverse actions from previous networking tutorial and complete the new tutorial where the pi 3 acts as an access point/router in the network. First challenge I ran into was getting the pi3 to connect to the internet because I had disabled the connection to wustl guest through my first tutorial so I had to debug that. Then after completing the new tutorial I was unable to get hostapd to start. As a result, I'm going to reflash the SD card tomorrow (I have saved Jarrod's files to an SD card) (Katy, 2.5 hours)
- rebooted AWS lightsail instance and got server running via pm2 commands. Also made changes to index.html so output is a static "Hello World" displayed on localhost port 4000. However, when I tried to pull these changes on the lightsail server, I ran into the same issue where the "page could not be found" (Katy, 45 minutes)
- Total time: Katy 3 hours 15 minutes
- Created wireframe diagram (Katy 1 hour)
- while I was doing this I also downloaded Raspian and Etcher to reflash SD card on the pi 3
- Researched wifi dongle (Katy 30 minutes)
- reconfigured pi3, moved jarrod's files back over (Katy, 30 minutes)
- didn't have time to redo the tutorial today, I will come in tomorrow morning and do that so I can ask for help Monday if needed
- Total time: Katy 2 hours
Goals for next week
- once wifi dongle arrives, have master pi communicating to the helmet pi and AWS simultaneously
- configure server so webpage displays data sent from master pi
- start working on API routes? or configure database? I just feel like we need to start working towards getting the webpage working
Week of March 17th-23rd
- redid tutorial to establish pi 3 as an access point/router. I was able to connect to the network on my laptop so I believe it was successful. Interesting note (mostly for Ethan), I ran into the same hostapd is masked problem again when trying to start hostapd. To troubleshoot, I did the following commands: sudo systemctl unmask hostapd, sudo systemctl enable hostapd,sudo systemctl start hostapd, and it worked! Found that advice from https://github.com/raspberrypi/documentation/issues/1018
- also moved Jarrod's files back over to the pi3
Total time: Katy, 30 minutes
- Discussed goals for week, including network setup and accelerometer configuration. (Katy, Jarrod, 30 minutes)
- Worked on SSHing the Pi 0, and attempted to troubleshoot accelerometer again with little luck. (Jarrod, 1 hour)
Total time: Jarrod, 1.5 hours, Katy, 30 minutes
- Got accelerometer code working, and fleshed out next steps for communicating data to server. Additionally, googled a lot of info about python in general. (Jarrod, 2 hours)
Total time: Jarrod, 2 hours
- got express server running on pi3 with simple api route "greeting" (Katy, 1.5 hours)
- wifi dongle arrived so sideline pi now can simultaneously communicate with helmet pi and AWS
- created another express server running on pi3 through a different port, sent data from one node to the other (Katy, 30 minutes)
Total time: Katy, 2 hours
- got database instance spun up (Katy, 1 hour)
- got data from database displayed on pi (Katy, 30 minutes)
Total time: Katy, 1.5 hours
Goals for next week:
- Flesh out API routes so all the API routes specified early this semester are complete
- work on html so data is presented on webpage
- get actual readings from helmet pi to sideline pi and then from sideline pi to web interface
Week of March 24th-March 30th
- Weekly meeting with TA and professor; discussed steps moving forward, beginning final report, etc.
- Spent time researching python code to alter current acc.py script to send data in desired format; Saved webpage for reference, will implement the following Monday, 4/1 (Jarrod, 1 hour 30 min)
- Researched Headbands to put buy for prototype (Jarrod, 15 min)
- Began a rough draft of Final Report (Jarrod, 30 min)
Goals For Next Week
- Get Pi 0 to talk to Pi 3
- Design Case for accelerometer
- Finish Rough Draft of Design and Solutions Wiki
Week of March 31st-April 6th
- Group Meeting. Next steps and what to do moving forward discussed. Nothing major. (Jarrod, Katy, 30 min)
- Jarrod and Katy met to discuss how to send data from pi zero to pi 3. Could not figure it out, will meet with TA tomorrow to work towards a solution. (Jarrod, Katy 1 hour).
- Worked on Designs and Solutions portion of Wiki, specifically, Module 1: Building the Accelerometer. Will continue to work on before Friday. (Jarrod, 1 hour 30 min)
- Read through the log to get a better understanding of Katy's part, googling as I went and following links in the log to get as clear a picture as possible. Also made minor grammatical and format edits to both log and main page. Additionally, uploaded several images onto main wiki page for use when creating the Design and Solution rough draft. (Jarrod, 1 hour).
- class meeting to discuss final deadlines, etc. (Jarrod, Katy, 30minutes)
- configured API route on pi 0 to post data to pi 3 in packets of 50 (Katy, Jarrod, 2 hours)
- worked on function for routing data from pi 0 to pi 3 to mysql database (Katy, 1 hour)
- still need to test but I couldn't get the pi zero script to run when I tried
- I attempted to link all of these, however I'm having a hard time figuring out how to actually get the data to display on the webpage (I'm pretty sure the database query is being executed and the results are being returned but I just dont' know how to display them)
Week of April 7th-April 13th
- Met with TA and professor (Katy, Jarrod, 30 minutes)
- Worked on web interface and API routes. Now, when you type a team a team number and click the search button, the data from mysql is displayed in a table. (Katy, 1.5 hours)
- Worked on function to transmit data from 0 to 3 to database. The error I am currently running into is that when I try to insert a new hit data point into the hits table, mysql says the player_id column must be unique, and when I try to drop that column and make it again but not unique, I'm not allowed to drop it because "it is needed for a foreign key constraint" (Katy, 1 hour)
- Researched CAD for building case for pi 0/accelerometer. Created OnShape account and watched several tutorial videos, and imported a previously created pi 0 case into workbook for manipulation. Problem now is manipulating it to include accelerometer/battery pack, and have it done (ideally) by Wednesday. (Jarrod, 1 hour)
TOTAL TIME: Katy 3 hours, Jarrod 1.5 hours
- Made Case for pi/accelerometer, learning OnShape CAD as I went. (Jarrod, 3 hours)
- solved primary key issue so data is now being relayed from pi 0 to pi 3 to database (Katy, 1.5hours)
- made api route to fetch all hits a player has sustained (Katy, 1.5 hours)
- I noticed the response is only the first 99 datapoints which makes me wonder whether we should only store the collisions over a certain number of G's in the database because otherwise I'm not sure we'll be able to fetch all the collisions
- I am also wondering what we're going to do about distinguishing one hit from the next because we're sampling at a high rate but those are likely gonna be the same hit if they're really close in time?
- todo next time: get web interface running on AWS lightsail so I can link it here
TOTAL TIME: Katy 3 hours, Jarrod 3 hours
Week of April 14th-April 20th
- Weekly meeting; discussed making poster, doing tutorial, and disseminating data at pi zero before sending to main pi. Additionally, made some small tweaks to pi zero case, file has been exported and is currently queued up for printing. The majority of this week will be spent testing our system and interpreting the data we receive, in order to define threshold values for data dissemination (collected data and interpretation will be demonstrated on poster). (Katy 45 min, Jarrod 1 hour)
- Began testing our accelerometer to determine threshold values that pi zero sends to main pi on the sideline. Tests included: running and agility, dropping the accelerometer while inside a helmet, and hitting the helmet with a hammer.
- Began creating our poster.(Jarrod, Katy 2 hours)
- Began implementing algorithm to disseminate data based on values found during Wednesday experiments. (Katy, 2 hours)
- Worked on Poster and Wiki (Jarrod, 1 hour 30 min)
- finished simple algorithm to filter data (Katy, 1 hour)
- implemented simple chart display using Chart.js (Katy, 2 hours)
- I still need to figure out how to convert the x axis values from the unix representation of timestamps (bigints) to actual dates (since scatter plots require the data points are two integers)
- added API routes to filter by max threshold (so the max value of a hit must be greater than the threshold) and filter by date (so the timestamp must be greater than the timestamp associated with a certain date)
- created UI to allow filter inputs and linked those to API routes so filtering is working now (Katy, 1 hour)
- spun down AWS instance and spun up a new one to try to debug whatever issue we were having on Monday/Friday but to no avail- I run into the same error where navigating to the static ip + port leads to a page that won't load but the pm2 log says "Server running on port 2000"
Todo next week
- still need to flesh out logic to handle cases where there are no hits that match the request
- get lightsail to work
- convert x axis of charts to dates instead of unix timestamps - DONE
- check with Ethan and Professor Feher about data filtering - DONE
- finalize and print poster
- one last round of testing with pi in case in helmet on head
- testing in Lopata
Week of April 21st-April 28th
- worked on poster (Katy, 2 hours)
- Created tutorial Accelerometer + Pi zero (Jarrod, 1 hour 30 min)
- Tested Completed system in lopata, troubleshooting, creating poster, tweaking threshold values, etc. (Jarrod, Katy, 2 hours 30 min)
- DEMO DAY. Last minute tweaks, set up in Lopata and presented our project from 2:30-4:00. (Jarrod, Katy, 2 hours 30 min)
- Finishing touches on final report, tutorial, log, etc. Updating Wiki and wrapping everything up (Jarrod, Katy, 1 hour 30 min)