Integrated changes from in lab: added local database to log packets when connection is lost to control center. Fixed double logging of bad data