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

nrf52832 Serial example - Permission Denied for /dev/tty*

Hi,

Despite knowing a fair bit of the theory of wireless comms (mainly PHY and MAC), I'm brand new to actual hardware configuration/protocol development, so please be gentle :)! I'm working on understanding the BLE Mesh for now.

BACKGROUND: I have 3 RF52832 dev boards, and I use Ubuntu 18.04.1. I have built the toolkit to the point where I could run the mesh light switch example: 1 provisioner, 1 client and one server, able to change the server LED through pressing buttons on the client board (I cannot get using the mobile app as the provisioner to work, if you have any tips that would be great, otherwise I leave it for another question).

I'm now trying to do the serial example. Here I am plugging in the dev board into the computer, and flashing it with the serial example (building and debugging). 

I've set up a python3 virtualenv, and installed all the requirements through the requirements.txt package. I have identified (using dmesg | grep -C SEGGER) that the port for the board is ttyACM0.

ISSUE: After activating the Python3 environment, I run:

(mesh) bisto@bisto-OptiPlex-990:/usr/local/lib/nrf5_SDK_for_Mesh_v2.2.0_src/scripts/interactive_pyaci$ python interactive_pyaci.py -d /dev/ttyACM0

which results in the following error:

   To control your device, use d[x], where x is the device index.
    Devices are indexed based on the order of the COM ports specified by the -d option.
    The first device, d[0], can also be accessed using device.

    Type d[x]. and hit tab to see the available methods.

Traceback (most recent call last):
  File "/home/bisto/virtualenvs/mesh/lib/python3.6/site-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyACM0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "interactive_pyaci.py", line 286, in <module>
    start_ipython(options)
  File "interactive_pyaci.py", line 217, in start_ipython
    device_name=dev_com.split("/")[-1])))
  File "/usr/local/lib/nrf5_SDK_for_Mesh_v2.2.0_src/scripts/interactive_pyaci/aci/aci_uart.py", line 138, in __init__
    self.serial = Serial(port=port, baudrate=_trick_baudrate, rtscts=rtscts, timeout=0.1)
  File "/home/bisto/virtualenvs/mesh/lib/python3.6/site-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/home/bisto/virtualenvs/mesh/lib/python3.6/site-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'

REQUEST: Any advice on how to fix this issue with the permissions being denied? Many thanks in advance.

Parents Reply Children
No Data
Related