This is a duplicate of this issue of pc-ble-driver-py repository.
While using pc-ble-driver-py on MacBook without problem, I face Error 13 when opening device on Raspberry Pi.
[OS]
latest stock RASPBIAN STRETCH LITE Version:June 2018
setup wifi & ssh
[DK]
PCA10028 V 1.1.0
PCA10040 V 0.9.0
[Command Line History]
--- on PC ---
scp -pr ~/Downloads/JLink_Linux_V632h_arm/ [email protected]:/home/pi
--- on Raspberry Pi ---
sudo cp /home/pi/JLink_Linux_V632h_arm/99-jlink.rules /etc/udev/rules.d/
sudo apt-get update
sudo apt-get dist-upgrade
mkdir /home/pi/boost
cd /home/pi/boost
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.bz2
tar jxvf boost_1_65_1.tar.bz2
sudo apt install cmake swig git make gcc g++ libudev-dev python python-dev python-pip
export BOOST_ROOT=/home/pi/boost/boost_1_65_1/
cd $BOOST_ROOT
./bootstrap.sh
./b2 toolset=gcc cxxflags=-fPIC cflags=-fPIC address-model=32 link=static --with-thread --with-system --with-regex --with-date_time --with-chrono
cd /home/pi
git clone https://github.com/NordicSemiconductor/pc-ble-driver-py.git
cd pc-ble-driver-py/
git submodule init
git submodule update
cd build/
cmake -G "Unix Makefiles" ..
make
pip install wrapt
cd ../python/
cp pc_ble_driver_py/examples/advertising.py .
nano advertising.py # turn off auto flasher
python ./advertising.py NRF52 /dev/ttyACM0
[Result]
pi@raspberrypi:~/pc-ble-driver-py/python $ python ./advertising.py NRF52 /dev/ttyACM0
Serial port used: /dev/ttyACM0
Traceback (most recent call last):
File "./advertising.py", line 79, in
main(sys.argv[2])
File "./advertising.py", line 55, in main
driver.open()
File "/home/pi/pc-ble-driver-py/python/pc_ble_driver_py/ble_driver.py", line 127, 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