DotNet-BlueZ icon indicating copy to clipboard operation
DotNet-BlueZ copied to clipboard

Missing Services

Open Fungusware opened this issue 5 years ago • 5 comments
trafficstars

Hi,

When running my application that uses this excellent on a standard Ubuntu linux box, I can see all 6 of my BLE services and the characteristics. I can also grab data from them.

When I run the same application on the Raspberry Pi, I can see only one service, and not the ones I need. I have added the 'pi' user to the lp and bluetooth groups.

I'm guessing 'dotnet run' might need to run with sudo but I'm not sure.

Any help is greatly appriciated.

Fungusware avatar Nov 20 '20 07:11 Fungusware

Did you do a discovery scan before accessing the devices. I noticed that in some cases the Bluetooth adapter needs to get some time to fully discover devices. Maybe that helps. If there is need to run as sudo you will get exceptions from the dbus stating that you are not allowed to perform an action. So I think sudo won't help.

gvheertum avatar Nov 20 '20 07:11 gvheertum

Ok, I will try this and report back.

Much appreciated.

On Fri, Nov 20, 2020 at 3:54 PM Gertjan van Heertum < [email protected]> wrote:

Did you do a discovery scan before accessing the devices. I noticed that in some cases the Bluetooth adapter needs to get some time to fully discover devices. Maybe that helps. If there is need to run as sudo you will get exceptions from the dbus stating that you are not allowed to perform an action. So I think sudo won't help.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hashtagchris/DotNet-BlueZ/issues/12#issuecomment-730983563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYHB5EUWJVUFSXCRT7ZWSTSQYOB5ANCNFSM4T4NQNMA .

--

John Anderson Fungusware http://fungusware.com http://www.xenserver-backup.com

Fungusware avatar Nov 20 '20 09:11 Fungusware

@Fungusware did you find the cause of your issue?

hansmbakker avatar Jan 30 '21 22:01 hansmbakker

Unfortunately time restraints meant I had to abandon my testing, and I ended up just using Linux command line and pipe it back into the C# code. Not pretty but its effective.

Fungusware avatar Jan 31 '21 05:01 Fungusware

I found out the hard way that the Battery service is hidden / inaccessible as a GATT service (#3) - you need to access it via the org.Bluez.Battery1 interface but it is not clear to me how to do that (#19)

hansmbakker avatar Feb 01 '21 22:02 hansmbakker