Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most advertisements are missed #444

Open
ygoe opened this issue Nov 29, 2024 · 1 comment
Open

Most advertisements are missed #444

ygoe opened this issue Nov 29, 2024 · 1 comment

Comments

@ygoe
Copy link

ygoe commented Nov 29, 2024

I'm building a temporary solution to send acquired sensor data to a Windows or Android device via Bluetooth LE. I have two options here: Sending the data in the advertisements, or going on to connect and polling a characteristic for the data. I couldn't manage to do the sender part with BlueZ/D-Bus/.NET on a Raspberry Pi, and even the incomplete advertisements were sent out too slow. But on an ESP32 microcontroller the advertisements are sent out smoothly every 100 miliseconds (that's the interval of the sensor data).

Now on the app side, I want to receive the data. While I can confirm the advertisements interval with the nRF Connect Android app, I see very irregular events in the Windows app. The advertisements are received every 1 to 2 seconds, and sometimes in quick batches, but mostly with long pauses.

Here's the relevant code:

Bluetooth.AdvertisementReceived += Bluetooth_AdvertisementReceived;
var scan = await Bluetooth.RequestLEScanAsync();

I don't understand where the issue is. Does this library limit the number of advertisements, or does Windows 11 drop most of them, or is my PC hardware just bad (mainboard with external WLAN/BT antenna, WLAN disabled)?

I'd also test this on Android but the whole app doesn't work there yet, so I don't know if Android would run better.

@ygoe
Copy link
Author

ygoe commented Nov 30, 2024

Same on Android. I get 2 advertisements at the same time, then nothing for around a second. Then it repeats.

Considering that nRF Connect can receive every single advertisement on the same device, I believe that this library is causing the issue. This makes using it to receive broadcast data unusable for me. I'll have to invest in the added complexity of actually connecting to the device and poll the data. Let's see if that even works or I'll need something completely different than this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant