0

I have a C program that opens a serial port. The code is not the issue here. When I run the program as sudo it works fine and opens the port. When I run it as myself (normal user) it fails to open the serial port.

The serial port is:

crw-rw-rw-  1 root  wheel   18,   5 Dec 26 17:34 /dev/cu.usbmodem1421

I am running Mac OSX 10.11.6 (El Capitan). I have added myself to the 'wheel' group, and that did not help. So I am wondering why I cannot open it if I am a member of the 'wheel' group? Is there something else that I am missing.

<

Xofo
  • 174

1 Answers1

6

Since I am a Mac OS X user, I added myself to the 'wheel' group based on this answer:

sudo dseditgroup -o edit -a $username_to_add -t user admin
sudo dseditgroup -o edit -a $username_to_add -t user wheel

Following the advice of @Tonny, I restarted the system and I was able to access the serial port. Logging out and logging back in did not seem to be enough, I had to restart. Then I could access the serial port as myself.

Xofo
  • 174