I recently ran into the same problem, here's what I managed to find out.
The first thing you should check is that you have sufficient rights to access the tty * interface.
First, make sure your user is in a group dialout
. If not, do
sudo adduser phil dialout
and then grant yourself read and write permissions to the exact port.
sudo chmod 666 /dev/ttyS0
After that I SerialPortList.getPortNames()
must returnttyS0
source
share