Android Question Serial in Linux

Discussion in 'Android Questions' started by Pedro Caldeira, Oct 6, 2017.

  1. Pedro Caldeira

    Pedro Caldeira Active Member Licensed User

    Hello All,
    I am trying to use the JSerial lib in ubuntu with no success.
    Anyone knows if I can use this Lib in Linux ?
    I get an exception error when i try to open the com1 (its working and reported in system) /dev/ttyS0
    And even a simple application to list all ports serial.listports returns a empty list. (works in Windows)
    I have a RSR232 CardReader that I need to use, so any suggestions would be welcome.
  2. OliverA

    OliverA Well-Known Member Licensed User

    It's most likely a permission issue. Try running your application using sudo. In my case the jar is called serialtest.jar, so I use the command
    If you want to run the application without using sudo constantly, you have to add your user to the correct group. In my case it is the dialout group (Ubuntu Server 16.04 LTS). To see what group your port belongs to you can issue
    Example (in my case)
    Now I just add myself to the group dialout with
    Then I log out and back in and voila, I can run the application without sudo.

    Erel and udg like this.
  3. Pedro Caldeira

    Pedro Caldeira Active Member Licensed User

    You were Right OliverA , it was a permission problem. Thanks.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice