Similar to: https://www.traccar.org/forums/topic/confusion-with-2-devices/
Similar to this to, but connection ids are different: https://www.traccar.org/forums/topic/coordinates-mixing-in-traccar-41/
I have been tracing it through the android app and over to the server and into the DB.
2 devices with unique ids registered on server in UI, name and identifier are set to same value, let's call them deviceA and deviceB
Both show up in the UI and we can do the route filter show to see the table list
The data is swapping between the two ids, the MAC addresses are swapping between the two devices and they are swapping locations, which is not the case.
Example:
uniqueIdA sends a position update to server with MACofDeviceA
uniqueIdB sends a position update to server with MACofDeviceB
uniqueIdA sends a position update to server with MACofDeviceB
uniqueIdB sends a position update to server with MACofDeviceA
I have tailed the server logs, hit enter a few times and watch device A send data while device B is off and this is what I see
INFO:[dxxxxx] id: uniqueIdA, ...
...
INFO:[cxxxxx] id: uniqueIdB, ...
But device B is off and hasn't sent anything
On the android phone, adb is running and I see
send (deviceId: deviceA...
Server is 4.1, Android app is 5.10
I have narrowed my focus a bit the the API, specifically in the channelRead in MainEventHandler. I am having trouble figuring out how the server actually determines what the deviceId is based on the unique id that the app is sending. It seems like the server is somehow assigning the wrong id to the message that comes in. I'm assuming it uses the tc_devices table, but I am not finding where that query is actually made. Here is the line in question.
String uniqueId = Context.getIdentityManager().getById(position.getDeviceId()).getUniqueId();
I would need to see full log file to check what the problem is.
I just stripped out all of the hex data, this is what the server sees when only 1 phone is sending data:
2018-11-01 03:56:02 INFO: [connID1: 5055 < 0:0:0:0:0:0:0:1] HEX:
2018-11-01 03:56:02 INFO: [connID1: 5055 > 0:0:0:0:0:0:0:1] HEX:
2018-11-01 03:56:02 INFO: [connID1] id: a, time: 2018-11-01 03:02:51...
2018-11-01 03:56:04 INFO: [connID2: 5055 < 0:0:0:0:0:0:0:1] HEX:
2018-11-01 03:56:04 INFO: [connID2: 5055 > 0:0:0:0:0:0:0:1] HEX:
2018-11-01 03:56:04 INFO: [connID2] id: b, time: 2018-11-01 03:02:51...
2018-11-01 03:56:07 INFO: [connID3: 5055 < 0:0:0:0:0:0:0:1] HEX:
2018-11-01 03:56:07 INFO: [connID3: 5055 > 0:0:0:0:0:0:0:1] HEX:
2018-11-01 03:56:07 INFO: [connID3] id: a, time: 2018-11-01 03:56:07...
That's not a full log. I need to see everything starting from "connected" message.
I can see that IP address is localhost, so you are likely using wrong port. You should be using port 5055, not a web port.
Basically the issue is the same as you referenced in the original post.
Ahh, I think there is a proxy setup on this server, so it is being forwarded somehow. Seems like that would break the connection code. I see something about a connectionlessProtocol, is there some setting I could use with the "status.ignoreOffline"?
Use "decoder.ignoreSessionCache" configuration parameter.
That seems to have done the trick. Thanks so much!
Is there a list of config parameters somewhere that I could reference in the future?
That's good to know, thanks!
Similar to: https://www.traccar.org/forums/topic/confusion-with-2-devices/
Similar to this to, but connection ids are different: https://www.traccar.org/forums/topic/coordinates-mixing-in-traccar-41/
I have been tracing it through the android app and over to the server and into the DB.
2 devices with unique ids registered on server in UI, name and identifier are set to same value, let's call them deviceA and deviceB
Both show up in the UI and we can do the route filter show to see the table list
The data is swapping between the two ids, the MAC addresses are swapping between the two devices and they are swapping locations, which is not the case.
Example:
uniqueIdA sends a position update to server with MACofDeviceA
uniqueIdB sends a position update to server with MACofDeviceB
uniqueIdA sends a position update to server with MACofDeviceB
uniqueIdB sends a position update to server with MACofDeviceA
I have tailed the server logs, hit enter a few times and watch device A send data while device B is off and this is what I see
INFO:[dxxxxx] id: uniqueIdA, ...
...
INFO:[cxxxxx] id: uniqueIdB, ...
But device B is off and hasn't sent anything
On the android phone, adb is running and I see
send (deviceId: deviceA...
Server is 4.1, Android app is 5.10
I have narrowed my focus a bit the the API, specifically in the channelRead in MainEventHandler. I am having trouble figuring out how the server actually determines what the deviceId is based on the unique id that the app is sending. It seems like the server is somehow assigning the wrong id to the message that comes in. I'm assuming it uses the tc_devices table, but I am not finding where that query is actually made. Here is the line in question.
String uniqueId = Context.getIdentityManager().getById(position.getDeviceId()).getUniqueId();