opendroneid / receiver-android

Example Android receiver application for unmanned aircraft Remote ID
Apache License 2.0
211 stars 64 forks source link

Bug: Not detecting some BT devices. #105

Closed guser210 closed 1 year ago

guser210 commented 1 year ago

in OpenDroneIdDataManager.java at line 54 the offset is hardcoded and assumes the payload always starts with a RemoteID packet, some devices will send additional information offsetting the RemoteID packet.

example packet from RemoteID transmitter: [0x02,0x01,0x06,0x02,0x0A,0x08,0x1E,0x16,0xFA,0xFF,0x0D,0x11,0x12,0x07,0x0F,0x14,0x14,0xF1,0x4B,0x94,0x14,0x1E,0x16,0xBE,0xBD,0x82,0x00,0x82,0x00,0x01,0x00,0x6C,0x11,0x59,0x01,0x01,0x00]

Line54: OpenDroneIdParser.parseData(data, 6, result.getTimestampNanos(), logMessageEntry, receiverLocation);

friissoren commented 1 year ago

What exact transmitter implementation are you using? Is this BT4 or BT5?

I tend to believe that the problem here is on the transmitter side. It is inserting two extra data elements before the actual drone ID data (0x02,0x01,0x06 and 0x02,0x0A,0x08) (Flags and TX power level?). Try to figure out a way to disable those on the transmitter side.

Those extra elements might fit for BT5 but most certainly will not fit for BT4. For BT4, the advertisement data can maximally be 31 bytes. When you subtract the various length and header info, it leaves exactly 25 bytes for the drone ID message. Hence, all messages are exactly 25 bytes. Adding any additional data elements will prevent transmitting full drone ID messages.

guser210 commented 1 year ago

My Apologies, yes you are correct, the issue was that the device I am currently using does send additional header data if the config allows for connections.

This is not a bug.

Thanks, Gil.