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

Issues with CLI over BLE Example

Hi!

I am trying to test the CLI over BLE example. I want to use it in another application for logging data to a laptop console over BLE. 

However, I am having trouble following the steps in the example documentation. I can compile and run the application just fine, but I'm having trouble starting the ble_serial.py script. Here's the command I'm running:

python ble_serial.py --snr 680834186 --name Nordic_CLI --com COM115 --family NRF52

And here's the output:

Traceback (most recent call last):

  File "ble_serial.py", line 64, in <module>

    ble_driver_init(args.family[0])

  File "ble_serial.py", line 61, in ble_driver_init

    from pc_ble_driver_py import config

ImportError: No module named pc_ble_driver_py

I tried "pip3 uninstall nrfutil" and then "pip3 install nrfutil", as well as "pip3 uninstall pc_ble_driver_py" and then "pip3 install pc_ble_driver_py".

However, this does not fix the issue. Can anyone provide some guidance on what I should try? And how do I connect to the board via its destination address (step 4) on a Mac?

  • Hi Jared,

    I'm running Python 3.9.0. When I run the command using python3, I get a new error:

    python3 ble_serial.py --snr 680834186 --name Nordic_CLI --com COM115 --family NRF52

    Traceback (most recent call last):

      File "/Users/kylemassa/Downloads/nRF5_SDK_16/examples/ble_peripheral/experimental/ble_app_cli/ble_serial.py", line 38, in <module>

        import Queue

  • Hi,

    Is the correct COM port really 115? Have you typed in the correct serial number of the board that you're using? It seems that you're using the example values from the doc. 

    I just tested the example and noted that the script included in the SDK works with python2.7 but did not with python3. So the script is most likely written with python 2.7. Sorry for the contraction in my previous reply. That is the latest version of pc-ble-driver-py requires python 3.6 but the python script is written for python2.7

    regards

    Jared 

  • Hi,

    Sorry how do I determine the correct COM port? Thank you for the advice!

    Ok, so then what do you recommend I do with regards to pc-ble-driver-py? If I run it with just the "python" command (2.7), it still fails and can't find the module.

    Thanks!

    UPDATE: I got ble_serial.py working, I had to uninstall nrfutil and reinstall using pip instead of pip3. The problem was, on my mac, pip was never installed along with Python 2.7.x, so I had to do that first. Once I reinstalled nrfutil, I had to change the line importing dfu_transport_ble.py (it was located inside nordicsemi/dfu/ , so I had to add those directories to the import path). 

    So now I still need help with step 4:

    "Open a terminal, for example PuTTY. Set the Connection Type to Raw and the Destination Address to 127.0.0.1:8889."

    How do I do this on a mac without using PuTTY? Is there a PuTTY equivalent that will do this for me? In the meantime, I will look for a mac solution and get back to you if I discover anything on my own. 

    Thanks!

  • Hi,

    kmassa5 said:
    Sorry how do I determine the correct COM port? Thank you for the advice!

    The serial port will appear as /dev/tty.usbmodemXXXX.

    kmassa5 said:
    How do I do this on a mac without using PuTTY? Is there a PuTTY equivalent that will do this for me? In the meantime, I will look for a mac solution and get back to you if I discover anything on my own. 

    Try using the default terminal in Mac OS. 

    Note that there is some limitations of using Mac OS X with J-link

    regards

    Jared

Related