Ryan’s Status Report for 4/16

This week, I spent my time in two areas. First, I put together a bill of materials and ordered components for three more hardware nodes for the final demo, as well as for fuller system testing. Fortunately, most of the parts (all of them but the thermal sensor) came in the day after I ordered them, so I was able to assemble the rest of the hardware nodes, including soldering male-to-male headers on the battery converter boards and level shifter boards. The thermal sensor is pretty trivial to wire up, so I’m not worried about having to integrate those in a timely fashion.

The other thing I worked on was integrating the thermal sensor into the hardware design. I first went through hardware specs to figure out how it wires up, and realized that the pull-up resistors built into our level shifter board were sufficient enough in creating a voltage difference between the data and clock lines for the thermal sensor I2C and no additional resistors were needed. Most recently, I have spent time writing code to actually turn on and obtain readings from the thermal sensor. I am currently working on that now, and expect to have that up and running by class on Monday, which is within my planned schedule.

Next week, I plan on finishing up the thermal sensor integration, hopefully assembling the rest of the hardware nodes once the thermal sensors get in, and then I will run battery and power consumption tests to make sure our hardware is in spec with our use case requirements. If this is not the case, the risk mitigation plan is to increase the power efficiency of the code, either by using lower power libraries/using resting states more effectively or by limiting the uptime of the PIR sensor, which according to my calculations (and pending unit testing) should be the heaviest power consumer of any individual component.

Angela’s Status Report 4/16

This week, I was in direct contact with someone who tested positive, so I was not able to make it to class, as well as still feeling extremely sick. However, I was able to get frontend work done. The main feature I was able to get working was the zoom on the map. This includes being able to zoom out enough to see different sections in the full map as well as zoom in to individual tables.

Next week, I hope to finish all features of the frontend as well as helping out with hardware testing and load/stress testing. The features would include having different tabs for different sections and refining the proportions so that the website would look as planned on all phones.

Right now, I want the web app displayed on a desktop/laptop to look like this:

while the mobile app looks the same. Currently, I’m using responsive web design (responding to different screen sizes/media) in order to accomplish this.

Jake’s Status Report 4/16

This week I focused on completing a few of the remaining things from my schedule. The first of these was to convert the EC2 database to run MySQL. For the demo we were just running sqlLite as a proof of concept but to ensure we are optimizing for our design requirements a change to MySQL was preferred. I also worked on updating some of Angela’s old front end html and django code and implemented that on the ec2 so that it runs on our website. I think this upcoming week I am going to create seperate versions of both this front end and our esp8266 code so that we can have the compartmentalized demos that we discussed with Tamal this week. The webapp code for some of the demos will be able to display info on exact latency and capacity.

I additionally developed two of the tests/validations our team initially had planned to do. The first of these is tracking the aws -> website capacity and loading times. I’m utilizing GTMmetrix which is a pretty standard speed test tool that performs multiple tests across various browsers, locations, and connections. I have yet to run this as Angela is finishing up her finalized front end which is the element of our pipeline this seeks to stress test. The Second of these tests is a fleet of node mcu’s that all are publishing json packets. This stress tests the device node -> aws capacity. This is more of a verification/validation than a test as there isn’t a solid metric for this other than delay and packet loss.

Last week I mentioned that we needed to  convert all devices to access CMU-SECURE through a wifi access point as CMU-DEVICE was blocking certain things we were trying to do with NTP. Now that we have confirmed our final demo location as Wiegland Gym we have concluded an ethernet based wifi access point is not viable as there isn’t accessible ethernet access for our team. I spent a lot of time researching wifi repeaters as a circumnavigation and we found several possible options that would work for our final demo. We are going to test one of these options, using a Samsung Phone as a wifi repeater this upcoming week. This is probably our greatest issue for risk mitigation at the moment. Our initial demo proved that we can still have a working project without this solution however to realize the full vision of our project this will need to be solved.

In terms of our updated schedule I am right on pace.

Team Status Report 4/10

This week was super busy in terms of preparing for demos, because of this we are going to break down progress and issues by platform

AWS IoT – Originally our design had our incoming data going to AWS IoT’s internal time series data base and then the platform’s rules engine would utilize a Lambda Rule to pass this along to a MySQL DB hosted by Amazon RDS. Django would access this directly. We fully implemented this but kept running into errors integrating this pipeline with Django’s models. Django models are intended to be a wrapper that sits over SQL and keeps the programmer completely removed from it, but because we were writing a bunch of SQL by hand as part of the Lambda function Django really didn’t like that. This left us with two options either abandon Django models and go with straight py sql or integrate the DB on the EC2. Because as a team we wanted to go with Django b/c of the abilities of models we made the design pivot to move towards a database with the django MVC on the EC2. This simplified the AWS IoT portion of our project in that we completely cut out the Amazon RDS MySQL server and lambda function and we replaced them with an AWS IoT rule that sent data within a https to a subdomain of our hosted website.

EC2/Django – So this clearly had trickle down effects within the EC2 Django deployment. For one we created a bunch of code that established Django models for tables with all their necessary features i.e. table_id, occupancy status, time of last update, etc.. We didn’t just create the templates as we also created a migration such that whenever the database is reinitialized  or the server reboots the database is pre-populated with instances of tables for all the devices we are currently supporting. In terms of data communication from AWS to Django we talked briefly about how AWS IoT was sending a post request to a specific url, this is specifically a json dictionary that contains all data transfered off the esp8266 as well as a key to match for security so nobody can spoof send data.

Because of the change in overall design we performed some extensive load testing to ensure this could still meet our project requirements. We converted the domain to point to an elastic IP to help with load. For testing We flooded the EC2 with 80 db updates and 100 get requests within a minute and it experienced no issues whatsoever so the change still meets our project requirements.

We additionally worked a bunch on the front end. We built out a basic html file to hold table information (id: status) and then tied this in with a javascript, jquery, and Ajax set of functions that would via a url automatically refresh occupancy data at a set interval of time. This tied into some backend code We wrote in Django that would query the database for all Table model instances, package these in a dictionary and send them off in json as a xml request response to the browser for our Demo. Although it had yet to be synced with the rest of the Django code on the EC2, We also developed a basic front end representations of tables and their occupancies.

hardware/esp8266 – We wrote a script to perform basic pir based occupancy detection for the demo. This consisted of two versions of detection. One that would connect to wifi only when detection had occurred as a preliminary power saving technique and one that would stay connected. This will slot into our final demo idea of having two detection algorithms running. One that will show purely how well we can detect occupancy and another that will show our in practice version designed around saving power through wifi use minimization strategies.  We ran into a new problem using CMU-DEVICE Wifi where we wern’t allowed to use NTP for any accurate time synchronization. In our demo testing we found that there isn’t a reliable delay between detection and when status updates reach our sql. Because of this as well as our desire to ensure we are operating our esp8266’s  during our desired running window, 8am-5pm, we wanted to use NTP for a variety of things on our nodes. Because of this we will be pivoting from CMU-DEVICE to using a wifi access point to connect to CMU-SECURE.

 

Ryan’s Status Report for 4/10

These past two weeks, since I missed a weekly update last week, a lot of work was done. I first identified that our thermal sensor, which had been ordered earlier this semester, can only communicate between I2C and has a specific header that needs purchasing, as well as a logic level converter. I talked to Tamal and made a contingency plan of ordering a breakout cable and level converter needed, with the understanding that the thermal sensor will not be a part of our interim demo.

I then soldered male header rows onto both of the regulator boards and built the hardware for the interim demo. A completed picture of the hardware can be seen below!

The battery runs into a 3.7V to 5V boosting regulator (which doubles as a charging board). That 5V powers both the ESP8266 dev board (which powers the processor and wi-fi module) and the PIR sensor. During the demo, the PIR sensor was taped to the bottom of a table, however the idea is to eventually mount the entire system under a table so it is out of the user’s way. After further testing, I determined that we did not need the 5V to 3.3V buck regulator, since the dev board steps down voltage levels internally.

Finally, we completed our interim demo! I think that it went well overall, and we were able to take a reading from the PIR sensor and send it all the way to a mocked up version of the web app. My major next steps involve integrating the thermal sensor into the rest of the design both hardware- and software-wise, now that the parts have come in, and finally doing some battery testing and work on power saving to round out the end of the semester, and I am currently on schedule to finish that out.

Jake’s Status Report for 4/10

This week was super busy in terms of preparing for demos. Due to Ryan’s illness and Angela being busy I had to do a lot more work than initially anticipated. Because of this I am going to break down all my progress and issues by platform

AWS IoT – Originally our design had our incoming data going to AWS IoT’s internal time series data base and then the platform’s rules engine would utilize a Lambda Rule to pass this along to a MySQL DB hosted by Amazon RDS. Django would access this directly. I fully implemented this but kept running into errors integrating this pipeline with Django’s models. Django models are intended to be a wrapper that sits over SQL and keeps the programmer completely removed from it, but because I was writing a bunch of SQL myself as part of the Lambda function Django really didn’t like that. This left me with two options either abandon Django models and go with straight py sql or integrate the DB on the EC2. Because as a team we wanted to go with Django b/c of the abilities of models I made the design pivot to move towards a database with the django MVC on the EC2. This simplified the AWS IoT portion of our project in that I completely cut out the Amazon RDS MySQL server and lambda function and I replaced them with an AWS IoT rule that sent data within a https post to a subdomain of our hosted website.

EC2/Django – So this clearly had trickle down effects within the EC2 Django deployment. For one I created a bunch of code that established Django models for tables with all their necessary features i.e. table_id, occupancy status, time of last update, etc.. I didn’t just create the templates as I also created a migration such that whenever the database is reinitialized  or the server boots up the database is prepopulated with instances of tables for all the devices we are currently supporting. In terms of data communication from AWS to django I talked briefly about how AWS IoT was sending a post request to a specific url, this is specifically a json dictionary that contains all data transfered off the esp8266 as well as a key to match for security so nobody can spoof send data.

Because of the change in overall design I performed some extensive load testing to ensure this could still meet our project requirements. I converted the domain to point not an the original server instance but rather an elastic IP to help with load. For testing I flooded the EC2 with 80 db updates and 100 get requests within a minute and it experienced no issues whatsoever so the change still meets our project requirements.

I additionally worked a bunch on the front end as nothing really existed for it yet. I built out a basic html file to hold table information (id: status) and then tied this in with a javascript, jquery, and Ajax set of functions that would via a url automatically refresh occupancy data at a set interval of time. This tied into some backend code I wrote in Django that would query the database for all Table model instances, package these in a dictionary and send them off in json as a xml request response to the browser.

hardware/esp8266 – Ryan hasn’t been able to do any programming on the esp8266 yet so I wrote a script to perform basic pir based occupancy detection for the demo. This consisted of two versions of detection. One that would connect to wifi only when detection had occurred as a preliminary power saving technique and one that would stay connected. This will slot into our final demo idea of having two detection algorithms running. One that will show purely how well we can detect occupancy and another that will show our in practice version designed around saving power through wifi use minimization strategies.  We ran into a new problem using CMU-DEVICE Wifi where we wern’t allowed to use NTP for any accurate time synchronization. In our demo testing we found that there isn’t a reliable delay between detection and when status updates reach our sql. Because of this as well as our desire to ensure we are operating our esp8266’s  during our desired running window, 8am-5pm, we wanted to use NTP for a variety of things on our nodes. Because of this we will be pivoting from CMU-DEVICE to using a wifi access point to connect to CMU-SECURE.

 

Jake’s Status report 4/2

This week has been primarily focused on getting everything in order for the demo. I purchased the domain occupancymonkey.com. I started a new Ec2 as Angela was having difficulty and cloned our project there. The django development server is not an acceptable way to run our program as it doesn’t handle high loads /service restarts  so I pursued using apache2 to run our program via a wsgi mod. I successfully completed this and then using ip forwarding I tied this to our domain at occupancymonkey.com. From here I utilized ssl to allow for https inbound and outbound traffic. This serves two purposes one it will allow aws iot to send messages safely via https which will greatly simplify data matriculation. Secondly it will help keep data more secure following the ethics discussion realizations are team had.

We hit a slight schedule snag in that our esp8266s are no longer behaving with cmu-device. Whereas in the past we were able to connect to EC2 cmu-device is now refusing us the ability to use pub sub client. Our mitigation strategy that I’m working on before the demo is converting a raspberry pi to a router/wifi access point

 

Jake’s status report for 3/26

This week I and the team worked primarily on the ethics side of the project. We participated in a very productive in class discussion over the potential ethical implications of our project and as a team we had the opportunity to discuss potential solutions/mitigation factors. Some of the potential implications were as follows:

  • Currently we have no features that limit who can see the real time data on occupancy in the UC. The multiple problems people found with this ethically were that it displaying when there is a high concentration of people within the UC allows potentially nefarious actors to come in and abuse this concentration in a multitude of ways ranging from solicitation and advertising to potentially things more harmful. To address this as a time we are going to require an andrewid to access the data. As CMU students and faculty are the target users we don’t see this restriction harming our use case however it is important to note that Chartwells employees do use the tables and this change will discriminate against them but as team we decided this trade off vs the original ethical concern was worth it to secure the safety of CMU students.
  • The second ethical concern raised was that people have no way of opting into having theirselves tracked. This was something our team hadn’t really considered the ethical implications of. However we concluded that ethically already having security cameras in the UC supercede the table occupancy tracking. That being said we also wanted to spread flyers notifying people of the occupancy trackers, just saying what they are, the way the hardware works and that no personally-identifiable data is being gathered as we advertise the app.

In terms of the hardware software integration I had hoped to finish the data transfer pipeline last week I still have not finished yet but I made some good progress. In terms of our schedule this all needs to be done for our demo so I will work to finish it up this week. Additionally this week, I plan to integrate my data transfer pipeline with Angela’s EC2 django instance.

Team Status Report 3/27

Our team had to focus more on the ethics assignment that was released to be due on Monday as well as the lecture on Wednesday. As a team, we’ve been trying to integrate our individual work, which didn’t happen last week as we had hoped. Because of this pushback, we will have to focus much more on connecting the pipelines between software and hardware as well as make sure our individual products still work as intended.

With the ethics assignment, we were also presented with other topics to think about in regards to our project, which would be more on the user side of this project. How would we prevent people from using our data for ill-intent (aka knowing the number of students in the UC at a time)? What would we do about people who don’t want their data collected in terms of occupancy? These are definitely problems we should confront.

Since we are behind schedule, we hope to catch up a lot more in class the following week as well as make sure software and hardware form a pipeline.

Ryan’s Status Report for 3/26

This week, I mostly focused on the ethics side of the project. This involved participating in a very interesting discussion between many groups about the ethics in both our projects and others, and we got some very interesting feedback that I considered and thought of solutions for. Specifically, two main points of concern were addressed:

  1. Anybody can access the data through the web app, and this data can be used for many purposes besides finding a free seat in the UC. To address this, we are going to restrict web app access to those with Andrew logins. While this may restrict access to a minority of the use case members, as some Chartwells employees use the tables as well and the UC is technically open to all people on the weekdays, we believe that this is a necessary step to secure the safety of the data of the remaining users.
  2. If this system is set up in the UC, people do not have the option of not having their occupancy tracked or opting out. Although this is definitely of concern, there are cameras in the UC that can be used to track someone’s location. More importantly, though, we would intentionally spread flyers notifying people of the way the hardware works and that no personally-identifiable data is being gathered as we advertise the app. We believe that the vast majority of the users, once informed, would not have concerns with the system; conversely, there is no easy solution to implement for the edge case of users that still do have concerns.

Unfortunately, since the rest of the hardware arrived very late in the week and due to some personal issues, I was not able to put forth much work on the project design this week, which has pushed me a bit back on schedule. Since I have a lighter schedule this upcoming week, I am hoping to be able to make up for the lost time. This week, I plan to assemble all of the hardware together, and I intend to at least get started on writing code to initialize all systems and get the sensors talking to the processor, in preparation for the interim demo coming up.