Sophie Sacks’s Status Report for April 16th

This week, Dina and I were able to successfully set up the second RPi for our system. We need two since we will have two scanners, so we need one RPi each in order to connect back to our web application. After the long setup process (since our RPi Zero W is pretty slow), I was able to add in logic in our software backend that handles a second scan of the same ID number. Now, when someone scans their ID on either of the scanners (since our web app can’t tell the difference), our backend checks if the ID number is a part of the Entry model table. If it is, then the entry time and exit time are added to the WaitTime model table and the old Entry object is deleted. If not, then the ID number and entry time are added to the Entry model table. In addition, I migrated our database backend to SQL instead of SQLite because this will better handle our data as well as concurrency issues of multiple people using the web app at once. Finally, I also added logic to use a live wait time at the top of the website if it is available within two minutes of the current time. Otherwise, the predicted value from the ML neural network will be used. A code snippet of this logic is shown below.

# use live wait time, otherwise use prediction
if (WaitTime.objects.filter(id=1).exists() and (datetime.now(utc) - WaitTime.objects.latest('exit').exit) <= timedelta(minutes=2)):
wait = WaitTime.objects.latest('exit')
wait_time = int((wait.exit - wait.entry) / 
timedelta(minutes=1))
else:
wait_time = ml.predict([datetime.now(eastern)]).pop(0)

My progress is currently on schedule. Next week, I hope to get our web application encrypted with SSL so it is more secure. I also hope to finalize getting Sam’s circuit connected to the rest of our system so we can have a final working product with all of the components connected!

Leave a Reply

Your email address will not be published. Required fields are marked *

*