Nathan’s Status Report for Oct 30 2021

What did you personally accomplish this week on the project?

This week, I finished the CRUD operations of the backend server. It interacts with MongoDB Atlas as discussed last status report. Now, the backend server is able to handle post requests of create_hub, create_seats, update_seats, delete_hub, delete_seats and the important get request of get_free_seats.

A major change that I implemented was in the database schema. The updated one is as follows:

const Seat = new Schema({
_id:String,
occupied:Boolean,
}
)
const Hub = new Schema({
_id:String,
seats: {
type:Map,
of:Seat
}
}
)
The most significant change here is that the seats are in a Map, rather than an Array. This needed to be done to increase efficiency of indexing / getting a given seat. The Map allows for id-based retrieval in O(1), while the Array is limited to a find of O(n), where n is the number of seats in a datahub.

I ran into many challenges during this stage, as there is a lot to implement and get working with the cloud database. Specifically, I had errors with the routing and retrieving parameters from the request correctly, as well pushing well-formed data to the cloud database. All these errors were solved this week.

Is your progress on schedule or behind?

I am on schedule with my parts and feel confident moving forward. I expect that as we move further into the implementation part, we will have a lot more roadblocks, so I will be working hard in the weeks to come. We are gradually receiving our ordered products, and so far they all seem to be on schedule!

What deliverables do you hope to complete in the next week?

This week, my task it to continue working on the web application. The main task is to get a public endpoint up and running so that the datahubs can act as the clients interfacing with the server. Additionally, I aim to get 25% progress on the frontend of the website. I can’t wait!

 

Jonathan Cheng’s Status Report for Oct 30 2021

This week was a productive week for the myself and for the team. I spent the earlier half of the week drafting the Data Hub project code, making sure to focus on readability and modularity. The end result should be something that is portable and easy to maintain. In addition, I wrote unit tests for the python functions that I drafted, and ran them with PyTest.

I also was in charge of creating the data schemas that our components will interface with each other through. I used a protocol called Json Schema to define the chair-to-hub schema, as well as the hub-to-backend schema. Furthermore, I wrote validators for the schemas, which will take a json object and validate the data structure against the schema definition. I also tested these validators with PyTest.

Towards the end of the week, I paired up with Will Foy to get the chair sensor up and running. This was not part of the plan, but we saw that the sensor was the top priority of the week, and needed to be fabricated as soon as possible. As such, I helped Will in any way I could, but I was mindful to defer to his instruction, as this was his project component. Fortunately, together we got the chair sensor up and running on an actual chair, and initial testing shows that it can indeed detect a human sitting on the chair, which is promising.

Next week, I hope to set up a raspberry pi with the python code that I wrote, and wire up an XBee to it, and see if communication between the chair module and data hub is possible. While this is a simple task, I predict that uploading the code to the RPi, with properly managed dependencies, as well as making reliable hardware connections, will be easier said than done.