opendroneid / opendroneid-core-c

Open Drone ID Core C Library
Apache License 2.0
178 stars 64 forks source link

Add Wi-Fi Beacon Transport Method #47

Closed cedric-papon closed 2 years ago

cedric-papon commented 3 years ago

Implements the "Wi-Fi Beacon" transport method as specified by the latest F3411-19 version, while retaining compatibility with the latest EU rule.

The wifi beacon frame contains a MAC header as specified by 802.11-2016, followed by mandatory "SSID" and "Supported Rates" elements and a "Vendor Specific" element containing the ODID Message Pack.

This PR also embeds opportunistic factoring and small fixes.

friissoren commented 3 years ago

Thanks. This is a very valuable contribution. I will try to find the time soon to check the changes in details so it can be merged in but just a few questions now.

Are you able to tell on what exact HW and SW you have been able to use this code and verify that valid beacon frames are transmitted and can be picked up by (I guess) the Android receiver app?

The reason I ask, is that at least on an Ubuntu PC, I have myself never been able to get the Wi-Fi NaN code to properly send out NaN drone ID data and I haven't been able to figure out what I am doing wrong (or whether it is even possible on that SW environment).

Since you didn't update the sender.c code (or provide something similar), I assume you have your own test implementation for these code changes? https://github.com/opendroneid/opendroneid-core-c/blob/master/wifi/sender/main.c

BTW: I guess you already saw that I have recently posted some code example for transmitting Wi-Fi Beacon data using the hostapd interface. That would not be of any real use in a non-Linux embedded transmitter though, so your code is definitely good to get included: https://github.com/opendroneid/transmitter-linux

cedric-papon commented 2 years ago

Hi Søren,

The HW used to transmit the Beacon frames is a senseFly eBeeX UAS, reception was tested on a Samsung S10 and Google Pixel 4 (both Android 11 with ODID Android receiver 3.0.0), as well as a Ubuntu 20.04 PC running Wireshark with the ODID dissector. We also ensured we didn't break the Wifi Aware transport.

The Unit Tests were ran in the library integrating odid core, we can put in some effort to merge them here if needed.

I tested your Linux transmitter app (beacon) successfully on a HP EliteBook 820 G2 running Ubuntu 16.04 with internal Wifi hardware. I have no idea why the NAN transport mode wouldn't work with hostapd. From a 802.11 point of view, it seems that to be considered valid, the NAN Action Frame must be sent in a timing window that shouldn't exceed 16 TUs (16.384 ms) after the NAN Sync Beacon frame was sent.