Comments (3)
Glad to hear you are making progress.
There's another thing, I can read
adapter.discoverabletimeout
but when I try to write it, I get aDBusException("Invalid signature for 'DiscoverableTimeout'")
. Settingdiscoverable-timeout
manually with bluetoothctl works.
Is there specific information I can provide and should I open another issue for this?
It should be as simple as:
adapter.discoverabletimeout = 180
If that isn't working then open a new issue and we can work on it there.
from python-bluezero.
The target of the Bluezero library is to put a facade to help get started with the BlueZ D-Bus API. To look behind that facade at what is actually going on; For the creation of a BLE Peripheral
, an advertisement and a GATT server needs to be created and published to the Bluetooth daemon (bluetoothd
) running on the Linux machine. The Peripheral
is asynchronous so it will only appear when the event loop (mainloop
) is run. When that is run then bluetoothd
will make them available over the air. bluetoothd
will not advertise when there is a connection to the GATT server.
Advertising will not work without the adapter being discoverable.
There isn't a great deal of information in your text for me to speculate what might be going wrong as there is no code and little debug information. Have your tried running one of the examples in the repo?
If I were to speculate based on what I've seen before, then either the event loop is not being started or your advertisement is too big.
When running your script have separate terminals open with the following running to get more debug information:
-
bluetoothctl
-
journalctl -f -u bluetooth
-
sudo busctl monitor org.bluez
-
sudo btmon
If you do a show
inside bluetoothctl
then it will report how many advertisements are registered and how many are active.
If it looks to be running without error, then use a generic Bluetooth Low Energy scanning and exploration tool, such as nRF Connect, to see what is being advertised and connect to the GATT server.
from python-bluezero.
Thanks for your quick reply! I checked a few other things based on that and believe I understand now what was going on. There are a few factors that confused me:
- When I initially started having connection issues (for whatever other reason), I stopped the application with the GATT server to remove a source of uncertainty, but that made things worse.
- I assumed that I should still be able to see the device and its default characteristics/services in a LEscan even with the application stopped - that's true but then I need to manually start advertising in
btmgmt
. - Even when the device wasn't advertising on BLE, I could still see it in scans with
bluetoothctl
, from what I saw with the tools you mentioned, it showed up on br/edr. In that case, connecting withbluetoothctl
always ended up in aorg.bluez.NotAvailable
error and the device disconnected again after a moment (and when I changed fromdual
tole
mode in/etc/bluetooth/main.conf
, I stopped discovering the device altogether, which makes sense as well).
I was building my application based on the cpu_temperature.py
example, that was easy and worked really well - thank you 👍
There's another thing, I can read adapter.discoverabletimeout
but when I try to write it, I get a DBusException("Invalid signature for 'DiscoverableTimeout'")
. Setting discoverable-timeout
manually with bluetoothctl
works.
Is there specific information I can provide and should I open another issue for this?
from python-bluezero.
Related Issues (20)
- Force disconnect clients from peripheral HOT 2
- How best to get extra information like RSSI and tx_power during scan HOT 2
- Disabling BlueZ request to pair with central on connect. HOT 5
- AttributeError: module 'bluezero.async_tools' has no attribute 'EventLoop' HOT 9
- Tests failing and blocking release HOT 1
- Can't install dbus-python to use bluezero HOT 3
- Error "dbus.exceptions.DBusException: org.bluez.Error.NotAvailable: Operation currently not available" on central HOT 8
- using class methods as callbacks fails for writes HOT 2
- Method to determinate current/negotiated MTU for connection HOT 7
- Documentation about PIN on pairing HOT 6
- Name a service and a characteristic HOT 1
- Method to retrieve remote device path in StartNotify and StopNotify HOT 9
- Unable to set `DiscoverableTimeout` HOT 2
- What is srv_id 0 zero? HOT 1
- Enable services changed on Generic Attribute service HOT 1
- Wait notification functionality feature HOT 2
- Setting Manufacturer data in Advertiser only works if data is less than 3 bytes long HOT 4
- How to show Txpower in advertisement data HOT 12
- How to add Flags inside Advertising Data? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-bluezero.