Step 18: Final Product
The composite code for the unit can be found here: https://github.com/pretsb/838fproject/blob/final/ins_and_outs/ins_and_outs.ino
On the server side, we get a set of samples and each sample contains a unique identifier to identify the person whose data is being synced, GPS reading and temperature readings. The algorithm parses the GPS reading to determine whether its a valid GPS reading (fixQuality>0) or invalid GPS reading. For valid GPS data, we obtain the lat long and reverse geocode it. We also use meta data like # satellites, location Error and the temperature reading as features in a decision tree to classify the location as indoor/outdoor. For invalid GPS readings, we just use the last known lat/long values for reverse geocoding.
The server side code can be found here: https://github.com/pretsb/838fproject/tree/master/MACServer