Logic for Unknown device

jing3 years ago

Hi Anton,
Noticed some weird location points of one device. When I review the log files, I noticed all weird location points were from an "unknown device".
Is there any special logic to attach an unknown device to an existing one? Thanks.

Anton Tananaev3 years ago

Logs? Locations from unknown devices are not stored anywhere.

jing3 years ago

4XXXXXX595 - registered device
5XXXXXX705 - Unknown device

...
2021-03-25 21:10:00  INFO: [700045ba: calamp < 111.XXX.XXX.114] HEX: 83054XXXXXX595010101021025605cfc27605cfc27200b1a4cbcc3930f0000f8480000000000ad0e020262ffb94f07c0002a65090000000000000033e400004bfc0000000000000000000003710000005500000ae700000000
2021-03-25 21:10:00  INFO: [700045ba: calamp > 111.XXX.XXX.114] HEX: 02011025020000000000
2021-03-25 21:10:00  INFO: [700045ba] id: 4XXXXXX595, time: 2021-03-25 21:09:59, lat: X3.75985, lon: -X2.80335, course: 173.0
...
2021-03-25 22:16:07  INFO: [700045ba: calamp < 111.XXX.XXX.138] HEX: 83055XXXXXX705010101020001605d12a400000000000000000000000000000000000000000000002c02b2ff968f00ff0850100900000000000000000000000000000000000000000000000000000000000000000000000000
2021-03-25 22:16:07  WARN: Unknown device - 5XXXXXX705 (111.XXX.XXX.138)
2021-03-25 22:16:07  INFO: [700045ba: calamp > 111.XXX.XXX.138] HEX: 02010001020000000000
2021-03-25 22:16:07  INFO: Position filtered by Invalid Zero filters from device: 4XXXXXX595
2021-03-25 22:16:07  INFO: [700045ba: calamp < 111.XXX.XXX.138] HEX: 83055XXXXXX705010101020001605d0ba700000000000000000000000000000000000000000000002c02b2ff938f00ff082e640900000000000000000000000000000000000000000000000000000000000000000000000000
2021-03-25 22:16:07  WARN: Unknown device - 5XXXXXX705 (111.XXX.XXX.138)
2021-03-25 22:16:07  INFO: [700045ba: calamp > 111.XXX.XXX.138] HEX: 02010001020000000000
2021-03-25 22:16:07  INFO: Position filtered by Invalid Zero filters from device: 4XXXXXX595
...
2021-03-25 22:21:08  INFO: [700045ba: calamp < 111.XXX.XXX.138] HEX: 83055XXXXXX705010101020002605d0cd0605d0cd01e6ebf4dbbfe7c8a0001929e000000000000060102b2ff958f0dff0032c90900000000000000353500000000000000000000000000000124000001220000002400000000
2021-03-25 22:21:08  WARN: Unknown device - 5XXXXXX705 (111.XXX.XXX.138)
2021-03-25 22:21:08  INFO: [700045ba: calamp > 111.XXX.XXX.138] HEX: 02010002020000000000
2021-03-25 22:21:08  INFO: [700045ba] id: 4XXXXXX595, time: 2021-03-25 22:21:04, lat: X1.05744, lon: -X4.09499, course: 0.0
Anton Tananaev3 years ago

The issue is that it's all coming from the same IP address, so for server there is no way to distinguish.

Anton Tananaev3 years ago

Never mind... looks like IP is different.

jing3 years ago

Hi Anton,

Is it related to this line,

https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/handler/FilterHandler.java#L189

line 189            message.append(Context.getIdentityManager().getById(position.getDeviceId()).getUniqueId());

When it implicitly get the UniqueId, the application set the uniqueId as well (this.uniqueId = uniqueId)?

Thanks,

Anton Tananaev3 years ago

When it implicitly get the UniqueId, the application set the uniqueId as well (this.uniqueId = uniqueId)?

Where do you see this part?

jing3 years ago

No, I haven't found it directly.
Might be somewhere in the "Device.java"? If the uniqueId is null, not sure how the Construction method works. Thanks.