Modified readSerial to also log to couchdb