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

pc-ble-driver-py driver.open() fails?

pc-ble-driver-py.git/python/pc_ble_driver_py/examples $ python advertising.py /dev/dongle 
Serial port used: /dev/dongle
Traceback (most recent call last):
  File "advertising.py", line 74, in <module>
    main(sys.argv[1])
  File "advertising.py", line 63, in main
    driver.open()
  File "/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/ble_driver.py", line 112, in wrapper
    raise NordicSemiException('Failed to {}. Error code: {}'.format(wrapped.__name__, err_code))
pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: 13

Error code 13 means #define EACCES 13 /* Permission denied */ but the device is read/write accessible to all:

Where is the permission problem?

/dev/dongle points to the DK J-Link:

ls -ald /dev/dongle 
lrwxrwxrwx 1 root root 7 Jun 29 22:55 /dev/dongle -> ttyACM0

and opens/scans/discovers fine with the C examples.

(I used 115200 baud.)

edit: I just noticed there are two different connectivity firmwares with pc-ble-driver-linux and pc-ble-driver-py package:

nrf51-ble-driver_linux_0.5.0/firmware/connectivity_115k2_with_s130_1.0.0.hex
/usr/local/lib/python2.7/dist-packages/pc_ble_driver_py/hex/connectivity_115k2_with_s130_2.0.1.hex

Does the python driver need 2.0.1 and the Linux/C driver need 1.0.0?

I would like to use C and python applications.

Related