Filter zero coordinates but process attribute updates

maxw3ll7 years ago

I am running on the recent master branch build (commit d5db101a) and was trying to filter zero coordinates but handle attribute updates properly.

The tracker is using H02 protocol and when woken up from sleep I want to handle alarms immediately even when no GPS fix yet and tracker sends 0,0 GPS location.

Filtering zero coordinates worked well so far. But after adding skipAttributes to the config, the zero coordinates show up again. I was under the impression that in such a case only the attributes are processed, but the (invalid) location is not updated.

The relevant parts from the configuration file:

    <entry key='filter.enable'>true</entry>
    <entry key='filter.invalid'>true</entry>
    <entry key='filter.duplicate'>true</entry>
    <entry key='filter.zero'>true</entry>
    <entry key='filter.future'>86400</entry>
    <entry key='filter.skipAttributes.enable'>true</entry>
    <entry key='filter.skipAttributes'>alarm,armed,battery,charge,result</entry>

    <entry key='coordinates.filter'>true</entry>
    <entry key='coordinates.minError'>5</entry>
Anton Tananaev7 years ago

Your assumption is incorrect. Filtering doesn't modify anything. It just filters or not each message.

maxw3ll7 years ago

So I would have to modify the code to change this? Is this feasible or does it require a major rewrite?

Anton Tananaev7 years ago

You can modify code and instead of filtering take last known location.

maxw3ll7 years ago

Had a quick look and it looks pretty straightforward to me. In H02ProtocolDecoder I would call getLastLocation(position, null) if the current location is 0,0. Correct?

Thanks for your help!

Anton Tananaev7 years ago

I was thinking filter handler, but decoder should work too.