-
Notifications
You must be signed in to change notification settings - Fork 37
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
GATT Server example request #8
Comments
I'm looking for the same info please. I want the RPi to be discoverable as a serial port service. |
Hi, Chris. First of all, Thank you for your library. It seems useful and great. |
I recently came across this sample code, it works very well. Its a simple generic GATT server implemented for Linux in C#/.Net, using D-Bus and Tmds.Dbus. https://github.com/phylomeno/dotnet-ble-server Do not use the provided Nuget, just add all the DotnetBleServer code to your project and see the examples provided for guidance I compiled it for .Net Core 3.1 and it works fine |
Thanks for your info. But it cannot work here. How you pass this exception? |
Are you running it from the source code (as I mentioned above), not the Nuget library? The Nuget version (I think) is an older version than the source. |
Thanks for your reply. I use the code from the github directly. Only reference in the example is the main project, which is a project code reference. And the only nuget package used by the main project is tmds.dbus. I've created an issue there. Would you like to check it and upload your running code? Thanks again. |
I have attached the code I'm using to create my GATT server. Hope it helps. Please ignore some the app specific code not removed. |
In your code, required AddCharacteristic is missing from GattServiceBuilder. Should I use WithCharacteristic instead? After running StartServer().Wait() from your code with the changing above, messages printed on screen: That's all. Nothing detected from my LightBlue app. Didn't see "GattServer successfully started", nor error message. |
Not sure what you mean by "In your code, required AddCharacteristic is missing from GattServiceBuilder"? My code in RegisterGattApplication(..) : |
AddCharacteristic is not shipped with the original code (GattServiceBuilder). |
Sorry, you're so right! I completely forgot. I did add a function to GattServiceBuilder (even marked it) which simply encapsulates ||WithCharacteristic||: // Added by HRB Insofar not seeing "GattServer successfully started"... Can you maybe debug into ||RegisterGattApplication|| to see which instruction hangs? |
It hangs at: |
Might sound like a stupid question but: Are you running it on PI 3 or 4, or other? |
Last test is on my computer with Ubuntu server x64. The test before is on my RPI4 with Ubuntu server arm64. |
I'm for now running it on Pi3, because I had problems with BLE on Pi4 (but its been a while and for the life of me I cannot remember why I temporarily gave up on the Pi4). Long shot but just give it a try on PI3? |
Hi have you solved this problem? |
Who're you asking...? But I don't think there is anyone solved this yet. |
this one in the ubuntu server. I was running it on my Vmware with ubuntu installed. I was using other library - python-bluezero but got the same error as yours
|
Ok!! Could be th OS'es. I've got it working it on Raspbian |
I found the reason why I cannot use BLE on my Pi4. Before testing code, make sure that bluetooth device can be listed by |
I had some issues getting BLE servers to work on my Raspberry Pi as well, so I forked CirrusResearch's notification branch (big thanks to them!), and made a couple of commented examples that should hopefully help other people: I've got a couple of issues to work out though, namely how "write (with response)" actually works, since my Windows machine as a client doesn't put "request" in the options. Or "command", for a "write-without-response". If you have a client that does add options, you'll (as I understand it!) find them in the dictionary here: My Windows client just does what seems to be the basic stuff, "link", "device", "mtu". Edit: |
Not an issue but a example request.
Would it be possible to give us an example on how to do a simple GATT server using this library? I've tried to match up some Python based D-Bus examples with what your library provides, but could not make any sense.
In the end I'd like to have some Xamarin app access data on a PI via BLE.
It shall be much appreciated.
The text was updated successfully, but these errors were encountered: