CommPortIdentifier.getPortIdentifiers with zero ports on Linux

前端 未结 3 687
一生所求
一生所求 2021-01-15 13:29

i am trying to connect serial port on ubuntu. However, It doesn\'t work for me. I succesfully run the same project on Windows just with different drivers. The problem is tha

相关标签:
3条回答
  • 2021-01-15 13:58

    It was just becouse low priviligies. I had to add myself to a group which is supposed to work with ttyS0.

    0 讨论(0)
  • 2021-01-15 14:10

    I used this command

    sudo chmod 666 /dev/ttyUSB0

    I had the same problem and it worked the moment after I used this command. Like Smolda said, it is a permission problem.

    0 讨论(0)
  • 2021-01-15 14:15

    if nothing helps, you should consider to add this line to your java code:

    System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/yourtty");
    

    did it for me. (Only if you work with the RXTX library)

    0 讨论(0)
提交回复
热议问题