wjwwood / serial

Cross-platform, Serial Port library written in C++
http://wjwwood.github.com/serial/
MIT License
2.11k stars 1.03k forks source link

Issue running Serial under root in Raspberry PI #227

Closed xianrecords2015 closed 3 years ago

xianrecords2015 commented 4 years ago

I am having a strange issue. When I run my compiled c++ program under my user, the serial communication works fine.

But when I include the program in a rc.local or if I run the program under sudo (root), then the serial communication no longer works.

I am running on a Raspberry PI 4, Raspian.

wjwwood commented 3 years ago

I don't know why that would be an issue (especially as root), but if it were in fact running under a user and that user wasn't in the correct groups that might be the issue. I'm going to close this for now, since I cannot easily reproduce it.