ESPgoesoffline,itisoftenverydifficulttofigureoutwhyanditwouldalsonotreconnect.In
ordertosolvethisproblem,wewrotecodeforthemodulesthatimmediatelydetectswhenit
isnotconnectedtointernet.Afteritdetectsaproblemwithinternet,theESPscansforall
availablewirelessnetworksandsequentiallytriestoconnecttoanunsecurednetwork.Ifthe
connectionissuccessful,theinternetistested,andifitfails,ittriesthenextunsecured
network.Usingthisstrategy,evenifaESPlosesconnectiontointernet,itisabletoreconnect
quicklyandkeepsendingdatatotheserver.
3. Batterylife:Anotherissuewehadwaswithlimitedbatterylife.Withthe1200mAHlipo
batteries,theESPlastedabout8hours.EachESPneedsacurrentofabout150mAbecause
theESPsneedtoactasawifirouteraswellaspostproberequestswhenthebatchnumberis
reached(5proberequestssentatatime).Becausewewantedlongcontinuoussetsofdata,
wehadonlyacoupleoptionsinordertomakeourESPslastlonger.Wecouldplaywiththe
batchsize(discussedinenergysection),wecouldgetbiggerbatteries,orwecouldsimply
plugthemdirectlyinwalls.Aftertryingthethreeoptions,weendedupdecidingtoplugthe
ESPsdirectlyinwallstogetcontinuoussetsofdata.
4. MultipleHTTPrequests:Achallengethatwehadontheserversideisthatwithnumerous
ESPsdoingpostrequeststotheserveratthesametime.Afterweincreasedthenumberof
ESPsinourtestsetfrom4to8,wenoticedthattheservergetsbackedupandsometimes
crashesduetothenumberofpostrequests.Inordertofixthisissue,wemadetheFlaskApp
thathandlesallpostrequestsandinsertsthemintotheSQLdatabasemultithreaded.
5. MACAddressRandomization:Oneissuewehavethatwespendsignificanteffortstotryand
solveistherandomizationofMACaddresses.IniOS7,Appleintroducedsoftwarethat
randomizestheMACaddressusedtosendproberequestseverysooften.Becauseofthis,
peoplewithiPhonesthatwalkbyESPsmaynotbepickedupinmultiplelocations,astheir
MACaddresscouldchangeinbetweenthoselocations.Inordertodealwiththis,weonly
considertheproberequeststobevalidifthesameMACaddressappearsinmorethanone
location,signifyingthattheMACaddresswasprobablynotarandomizedspoofedMAC
address.ThisaddedanotherleveltoourSQLquerieswhichsignificantlyslowedsomeofour
graphing.
6. LocationAnimations:WiththecurrentSQLdatabasestructure,itisverydifficulttoforma
querytocreateanimations.Ouroriginalgoalforanimationswastobeabletoanimatea
singularMACaddressasitwalksacrosscampusbetweenthedifferentESPs.Inordertofilter
MACaddressandtheirproberequests,wehadtocreateincrediblycomplicatedqueries,
sometimesfilteringmanytables.Weendedupusingqueriesthatfilterthedatabaseand
requerywithtablesuptofourtimesinordertogetgoodusabledata.Thisendeduptakinga
significanthitinourendpoint’sresponsetime.Forsomeendpoints,itrequiresover10
secondstofullyquerythedata.
7. Scalability:Anissuewearecurrentlyhavingwithourprojectisscalabilityforthefuture.Asof
now,wearestoringabout1millionproberequestrowsstoredinourdatabaseevery3days.
Withsuchalargedatabase,ourcomplexqueriesaregettingslowerandslower.Thequeries
neededtodoanimationsonthedatabasehavestartedtakingalongtime,sowearelooking
foramoreoptimalsolution.
14