Incorrect datetime value

stallione4 years ago

Hi, I am using OSMand+ to send tracking information to my server and I get the following error. Trying to figure out what I need to do to fix this.

2015-09-12 07:37:48 DEBUG: [62975540: 5055 > 166.175.60.219] HEX: 485454502f312e3120323030204f4b0d0a0d0a
2015-09-12 07:37:48  INFO: [62975540] disconnected
2015-09-12 07:37:48  WARN: Data truncation: Incorrect datetime value: '47667-05-03 10:30:13' for column 'deviceTime' at row 1 - MysqlDataTruncation (... < QueryBuilder.java:412 < DataManager.java:329 < DefaultDataHandler.java:27 < ...)
2015-09-12 07:37:48  INFO: [62975540] id: 3, time: Tue May 03 10:30:13 PDT 47667, lat: 42.06288, lon: -88.23412, speed: 0.0, course: 0.0
2015-09-12 07:37:54  INFO: [069A1B4B] connected
2015-09-12 07:37:54 DEBUG: [069A1B4B: 5055 < 166.175.60.219] HEX: 474554202f3f69643d393032303634266c61743d34322e3036323838266c6f6e3d2d38382e32333431322674696d657374616d703d313434323036383638363537392668646f703d362e3026616c7469747564653d3232342e302673706565643d302e3020485454502f312e310d0a486f73743a20636861636b6f732e636f6d3a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a0d0a
2015-09-12 07:37:54 DEBUG: [069A1B4B: 5055 > 166.175.60.219] HEX: 485454502f312e3120323030204f4b0d0a0d0a
2015-09-12 07:37:54  INFO: [069A1B4B] disconnected
2015-09-12 07:37:54  WARN: Data truncation: Incorrect datetime value: '47667-05-03 12:09:39' for column 'deviceTime' at row 1 - MysqlDataTruncation (... < QueryBuilder.java:412 < DataManager.java:329 < DefaultDataHandler.java:27 < ...)
2015-09-12 07:37:54  INFO: [069A1B4B] id: 3, time: Tue May 03 12:09:39 PDT 47667, lat: 42.06288, lon: -88.23412, speed: 0.0, course: 0.0
2015-09-12 07:38:00  INFO: [610763DD] connected
2015-09-12 07:38:00 DEBUG: [610763DD: 5055 < 166.175.60.219] HEX: 474554202f3f69643d393032303634266c61743d34322e3036323838266c6f6e3d2d38382e32333431322674696d657374616d703d313434323036383639323537322668646f703d31302e3026616c7469747564653d3232342e302673706565643d302e3020485454502f312e310d0a486f73743a20636861636b6f732e636f6d3a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a0d0a
2015-09-12 07:38:00 DEBUG: [610763DD: 5055 > 166.175.60.219] HEX: 485454502f312e3120323030204f4b0d0a0d0a
2015-09-12 07:38:00  INFO: [610763DD] disconnected
2015-09-12 07:38:00  WARN: Data truncation: Incorrect datetime value: '47667-05-03 13:49:32' for column 'deviceTime' at row 1 - MysqlDataTruncation (... < QueryBuilder.java:412 < DataManager.java:329 < DefaultDataHandler.java:27 < ...)
2015-09-12 07:38:00  INFO: [610763DD] id: 3, time: Tue May 03 13:49:32 PDT 47667, lat: 42.06288, lon: -88.23412, speed: 0.0, course: 0.0
^C
stallione4 years ago

Ha, so looking at the conf file, I realize that we are using server time and we could completely ignore the timestamp sent by the device. So I modified
http://myserver:5055/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5}
to
http://myserver:5055/?id=123456&lat={0}&lon={1}&hdop={3}&altitude={4}&speed={5}
and now it is logging into the database and timestamps are working!

Anton Tananaev4 years ago

I have fixed the timestamp issue. Looks like OsmAnd+ sends value in milliseconds instead of seconds.