You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stuck battling a multi-device application crash. Found a fix, but it requires running 2 instances of the same application. Not sure where the issue lies. Let me know if I am being too vague / more info needed.
Pseudocode
main starts new thread with a target that performs something like:
adapter=get_one_valid_adapter()
adapter.scan_for(5000)
peripherals=adapter.scan_get_results()
# device_adevice_a, service_uuid_a, characteristic_uuid_a=find_connect_device_a(peripherals)
device_a.notify(service_uuid_a, characteristic_uuid_a, lambdadata: print(f"Notification: {data}"))
# Repeat for a hypothetical device_b
I have also tried:
# device_aadapter=get_one_valid_adapter()
adapter.scan_for(5000)
peripherals=adapter.scan_get_results()
device_a, service_uuid_a, characteristic_uuid_a=find_device_a(peripherals)
device_a.notify(service_uuid_a, characteristic_uuid_a, lambdadata:
print(f"Notification: {data}"))
# Repeat for a hypothetical device_b
Issue
device_a's characteristic notifies at 250Hz and device_b notifies at 1Hz. The data sometimes seems to get jumbled and the python program abruptly exists with no exceptions whatsoever across all main and dummy threads.
By jumbled, I mean I will start getting crc16 check errors where I haven't seen any before with a single device
The only indication that there was an error is in the Windows event logs. I have not tried on Linux, yet.
Working solution
Now, I run 2 separate python programs with identical code but for only one device and that works
I have a single Bluetooth 5.0 adapter on Windows
Questions
Is this the intended behavior?
Could it be an issue with spawning a thread to discover and connect?
The text was updated successfully, but these errors were encountered:
bradmartin333
changed the title
[Python] Application error exit with multiple devices / subscriptions
[Python] Application error exit with multiple devices and subscriptions
Feb 12, 2024
bradmartin333
changed the title
[Python] Application error exit with multiple devices and subscriptions
[Python] Application error with multiple devices and subscriptions
Feb 12, 2024
Stuck battling a multi-device application crash. Found a fix, but it requires running 2 instances of the same application. Not sure where the issue lies. Let me know if I am being too vague / more info needed.
Pseudocode
main
starts new thread with a target that performs something like:I have also tried:
Issue
Working solution
Questions
The text was updated successfully, but these errors were encountered: