ble tracking (feature support)

Ketil4 years ago

Hey again, im back :)

The EV-07B has a feature that docks it with its docking station, and it is then possible to enable a ble location service on the ev-07 which will then start a ble scan for the dock (and if it is found) will send the preprogrammed lat/long coordinates from the dock.

It is then sent to the server, as described in the ev-07b protocol document under around section 3.1.1.0 (as far as i understand)
https://drive.google.com/file/d/12Gwm1vpThhBFze65LiqgJdT4YrXX1WpN/view

is this implemented and for some reason not working for me or would it be something we could pay for to have implemented?

The basic idea of the feature is to have fixed sets of coordinates that can be used when the user is inside and the GPS tracker might have a hard time getting good readings.

Have a great day and stay safe.
Ketil

Anton Tananaev4 years ago

It is supported, as far as I can tell.

Ketil4 years ago

ok, i will try and have a look into it then, we experience a odd behaviour where we see the json ble package, come in, but it shows the unix 1970 start time, without any lat long.
I will see if i can find out what is going on.
Thanks for the help.

Han Wer4 years ago

I think that is not supported.

Anton Tananaev4 years ago

Han Wer, what makes you think that? It is clearly handled in the code.

Han Wer4 years ago

Where on earth do you setup a "preprogrammed lat/long coordinates from the dock on traccar to process the distance to the docking station?

Ketil4 years ago

Hey Han, first of all, I have to be honest and say that I am not at 100% "brain-power" right now, so I will try and get some JSON dumps here during the weekend.

You can connect to the dock with a ble connectivity tool(if you don't have it, dm me, I'm not sure if it is partner thing only) and define a whitelist where you set the mac of your EV-0X device after they pair and enable ble location services. You should be able to set the lat / long + a name.

The location sequence of the firmware running on most of these devices is BLE-GPS-WiFi-LBS (if the features is enabled) Ble will check for nearby devices based on ble mac address, if multiple is found, the one with the highest SNR(signal to noise ratio) will be the one picked and then it will send the JSON package with the ble object which will include the lat long.

As far as I understand, the ble object containing the lat long will be a separate part of the JSON string, compared to the part that sends the GPS coordinates. I believe it is an underlying object/array called ble with the lat long and name (instead of the GPS object)

Regarding the "wifi" location service, it basically takes the surrounding wifi access points and pushes it to a URL, the URL can be formatted depending on the service, etc, whatever lat-long is returned, is then sent to the backend system. So you need some sort of wifi positioning service api which will allow you to do HTTP PUT (This might not be 100% correct) But that is what I have figured out so far. I would love this also to be a feature supported by traccar, along with the ble if it ends up not being supported, as of now.

I still haven't had time to load up the firmware to ghidra, but I have identified the library which i believe to be used in a lot of these devices, both the versions which a basically a sparse mobile phone and the ones which i think might be some sort of embedded system. (that being said, I don't want to burn bridges with vendors) but I do think the transparency it could bring would make implementation a lot easier for a lot of saas vendors.

I have not

Ketil4 years ago

-- i have not
++ Have a nice evening.

Ketil4 years ago

I noticed your commit here, i am not super strong in development but did it sure seems you have added support for the 0x23, which should be the protocol supported by them for a while now. Apparently they added the 0x26 sometime in 2019 .
https://github.com/traccar/traccar/commit/2d5a5e600e576cd4e31046be104cc98f799ad091

Command: 0x01 LocationData Key: 0x23 BLE location

{
    "data_ble":{
        "lng":0.0,
        "mac":"",
        "lat":0.0
    }
}

Command: 0x01 LocationData Key: 0x26 BLE Location2 <--- i believe that might be the issue here.

{
    "data_ble2":{
        "lng":0.0,
        "radius":100,
        "mac":"",
        "lat":0.0,
        "height":0
    }
}

I have to ask a question about the test case, for the 0x23 already in there.

ab1024009b3f9742011001383635323039303336333430303235113154cfc95d0a00000080d0c95d0a000000

when I take it and decode it, I see no reference to the data_ble and the mac/lng/lat fields, is this not suppose to be in the file? As I said, I don't know much about test cases and even less about java, unfortunately.

Anton Tananaev4 years ago

Yes, looks like 0x26 is not supported.

For 0x23 MAC is not decoded, but coordinates should be.

Ketil4 years ago

i will give it a try with one of the older devices which should support 0x23 then.