heedy / connectordb-android

The ConnectorDB android app
Apache License 2.0
8 stars 2 forks source link

Heartrate message does not appear to be formatted correctly in TEST version of app #8

Closed proffalken closed 7 years ago

proffalken commented 7 years ago

When using the test version of the app (as discussed at https://github.com/connectordb/connectordb-android/issues/3#issuecomment-284966266 ) and manually syncing to a server running git1118 by pushing the "sync now", the following shows up in the logs on the server:

{"addr":"<IP>:54450","dev":"username/phone","level":"debug","msg":"5.997ms","op":"ReadStream","time":"2017-03-08T22:42:57Z","uri":"/api/v1/crud/username/phone/heartrate"}
{"addr":"<IP>:54450","dev":"username/phone","level":"debug","msg":"irange [-1,0) - 6.347ms","op":"StreamRange","time":"2017-03-08T22:42:57Z","uri":"/api/v1/crud/username/phone/heartrate/data"}
{"addr":"<IP>:54450","code":400,"dev":"username/phone","level":"warning","msg":"invalid character '}' looking for beginning of value","op":"WriteStream","ref":"8ea87613-431c-4f3a-6e5b-cdb268028c36","time":"2017-03-08T22:42:58Z","uri":"/api/v1/crud/username/phone/heartrate/data"}
{"addr":"<IP>:54450","dev":"username/phone","level":"info","msg":"554.242ms","op":"WriteStream","time":"2017-03-08T22:42:58Z","uri":"/api/v1/crud/username/phone/heartrate/data"}
{"active":0,"authfails":0,"errors":1,"inserts":0,"level":"info","msg":"0.07 queries/s","rest":4,"time":"2017-03-08T22:43:43Z","web":0}

Is there an additional "DEBUG" flag I can add to the server config to see the raw message and work out where the problem lies?

dkumor commented 7 years ago

I do not have a heart rate tracker, so I am unable to debug heart rate data. The format of the data was based on google's documentation (and educated guessing).

I have added verbose logging to ConnectorDB in the latest commit. To enable, you add --vvv to the command line starting the server:

connectordb start mydatabase -l=DEBUG --vvv

This logs all the requests and responses, so it is meant only for debugging.

If you post the request and response logs, I might be able to see what is going on.

Sorry to keep making you recompile! (PS: fast shortcut to recompile only the server: make bin/connectordb Should only take a couple seconds.)

dkumor commented 7 years ago

An update to the testing app was submitted. After installing, re-enable heart rate logging, and see if that fixes the issue.

proffalken commented 7 years ago

Can confirm this is now working, HR appearing in interface as well as sleep data, thanks :)