This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pc-ble-driver connection problem

Hello, I am developing with pc-ble-driver using python. I noticed that the Bluetooth connection becomes disconnected when I alt tab out of the gui I made. Is there a solution for this and why is this happening. When this happens nothing appears on the command prompt like ble_disconnect message. When I try to reuse the bluetooth feature like to advertise I get Error code: 12289 from the driver.

I think the the nrf52 board I am using as a central device is not working correctly? Is the softdevice provided for these not enough in order to make a project? and if not how do I need to modify the code.

I am using nrf52 chip and I tested for both 115K and 1M softdevice. I using a pyqt as my gui api.

Thank you ahead,

Parents
  • Hello, I did some test with the examples given(heart_rate_collector.py) as you suggested. I changed the CONNECTIONS to 5 and ran it over night with a youtube video on. There wasn't any connection problems at all Hoverever I found some bugs? that happened with the example.First, my application needs to have 8 ble connected concurrently but the example given only always up to 5 connections and if I try any number higher than 5, it would give this error

    C:\Python27\Lib\site-packages\pc_ble_driver_py\examples>python heart_rate_collector.py NRF52
            0 : COM3: 682160565
    
    Enter your choice: 0
    Serial port used: COM3
    Enabling larger ATT MTUs
    Traceback (most recent call last):
      File "heart_rate_collector.py", line 189, in <module>
        main(serial_port)
      File "heart_rate_collector.py", line 149, in main
        collector.open()
      File "heart_rate_collector.py", line 78, in open
        self.adapter.driver.ble_enable(ble_enable_params)
      File "C:\Python27\lib\site-packages\wrapt\wrappers.py", line 561, in __call__
        args, kwargs)
      File "C:\Python27\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 126, in wrapper
        raise NordicSemiException('Failed to {}. Error code: {}'.format(wrapped.__name__, err_code))
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_enable. Error code: 4
    
Reply
  • Hello, I did some test with the examples given(heart_rate_collector.py) as you suggested. I changed the CONNECTIONS to 5 and ran it over night with a youtube video on. There wasn't any connection problems at all Hoverever I found some bugs? that happened with the example.First, my application needs to have 8 ble connected concurrently but the example given only always up to 5 connections and if I try any number higher than 5, it would give this error

    C:\Python27\Lib\site-packages\pc_ble_driver_py\examples>python heart_rate_collector.py NRF52
            0 : COM3: 682160565
    
    Enter your choice: 0
    Serial port used: COM3
    Enabling larger ATT MTUs
    Traceback (most recent call last):
      File "heart_rate_collector.py", line 189, in <module>
        main(serial_port)
      File "heart_rate_collector.py", line 149, in main
        collector.open()
      File "heart_rate_collector.py", line 78, in open
        self.adapter.driver.ble_enable(ble_enable_params)
      File "C:\Python27\lib\site-packages\wrapt\wrappers.py", line 561, in __call__
        args, kwargs)
      File "C:\Python27\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 126, in wrapper
        raise NordicSemiException('Failed to {}. Error code: {}'.format(wrapped.__name__, err_code))
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_enable. Error code: 4
    
Children
No Data
Related