MostHated
Posts: 13
Joined: Mon Mar 28, 2016 6:00 pm

What all packages are needed for JSSC?

Tue Mar 29, 2016 5:57 pm

Hello all, I am having issues on the "Minibian" (stripped down version of Raspbian) on my Pi 3. I am trying to use a Java application that uses serial over usb via JSSC, but I keep getting the errors of :

"AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class jssc.SerialPortList"

"Exception in thread "PortScanB" java.lang.NoClassDefFoundError: Could not initialize class jssc.SerialPortList"

and ":Debug: Port not valid: No Controller Interface."

Those are in my applications error log.
I made sure libjssc-java was installed, on Minibian I typed things such as systemctl start [email protected], I see that I have this in my cmdline.txt "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 elevator=deadline root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait"

I see ttyAMA0 in my /dev/ folder as well.

Is there something I else I am missing?

I have a list of the packages installed on the Minibian - http://hastebin.com/qugofikuqe.cmake
As well as Raspbian - http://hastebin.com/kayeloriyu.cmake but do not know nearly enough to be able to recognize what ones I need installed to make JSSC work on the Minibian.

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: What all packages are needed for JSSC?

Tue Mar 29, 2016 6:22 pm

MostHated wrote: I see ttyAMA0 in my /dev/ folder as well.

Is there something I else I am missing?
Yes, serial USB devices tend to be called /dev/ttyUSB (except some Arduino models), and /ttyAMA0 is the UART (variously attached to GPIO or BT).

MostHated
Posts: 13
Joined: Mon Mar 28, 2016 6:00 pm

Re: What all packages are needed for JSSC?

Tue Mar 29, 2016 8:26 pm

Ok, thank you much for this info. I do not have the device currently plugged in, but when I get home, what might I have to try to do to make sure that the USB is configured or recognized as /dev/ttyUSB?

I know when I got my Raspbian working with Bluetooth I had to do something along the lines of rfcomm bind rfcomm0, might I have to do something similar with the USB for it to work in this case on the Minibian? Could it be missing specific parts of the USB functionality packages? I did have to manually install usbutils in order to see lsusb, perhaps I am missing some other packages?

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: What all packages are needed for JSSC?

Tue Mar 29, 2016 10:04 pm

MostHated wrote:Ok, thank you much for this info. I do not have the device currently plugged in, but when I get home, what might I have to try to do to make sure that the USB is configured or recognized as /dev/ttyUSB?
Here are a couple of ways to identify the device.

Using dmesg:
1. Type dmesg at the prompt and note the timestamp of the last message

Code: Select all

[email protected]:~ $ dmesg
------ snip ------
[   14.042957] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   14.042968] Bluetooth: BNEP filters: protocol multicast
[   14.042982] Bluetooth: BNEP socket layer initialized
[email protected]:~ $
2. Plug the deivce in and repeat

Code: Select all

[email protected]:~ $ dmesg
------ snip ------
[   14.042982] Bluetooth: BNEP socket layer initialized
[  369.718596] usb 1-1.4: new full-speed USB device number 4 using dwc_otg
[  369.846136] usb 1-1.4: New USB device found, idVendor=0403, idProduct=6001
[  369.846157] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  369.846170] usb 1-1.4: Product: FT232R USB UART
[  369.846182] usb 1-1.4: Manufacturer: FTDI
[  369.846194] usb 1-1.4: SerialNumber: A603RSFW
[  369.881431] usbcore: registered new interface driver usbserial
[  369.881529] usbcore: registered new interface driver usbserial_generic
[  369.881615] usbserial: USB Serial support registered for generic
[  369.894464] usbcore: registered new interface driver ftdi_sio
[  369.894581] usbserial: USB Serial support registered for FTDI USB Serial Device
[  369.894880] ftdi_sio 1-1.4:1.0: FTDI USB Serial Device converter detected
[  369.895024] usb 1-1.4: Detected FT232RL
[  369.896003] usb 1-1.4: FTDI USB Serial Device converter now attached to ttyUSB0
[email protected]:~ $
As you can see from the last line, the device is called ttyUSB0 (and it will be defined in /dev)

Another method is to look at /dev before and after plugging in the device
1. Unplug the device
2. Type

Code: Select all

[email protected]:~ $ ls -l /dev | awk '{ print $10 }' > /tmp/dev1
3. Plug in device and type

Code: Select all

[email protected]:~ $ ls -l /dev | awk '{ print $10 }' > /tmp/dev2
4. Compare

Code: Select all

[email protected]:~ $ diff /tmp/dev1 /tmp/dev2 | grep tty
> ttyUSB0
MostHated wrote:I know when I got my Raspbian working with Bluetooth I had to do something along the lines of rfcomm bind rfcomm0, might I have to do something similar with the USB for it to work in this case on the Minibian? Could it be missing specific parts of the USB functionality packages? I did have to manually install usbutils in order to see lsusb, perhaps I am missing some other packages?
Everything is a file to unix systems, so if you're device is recognised as a serial device, you shouldn't have to muck about too much as it is a pretty standard device.

MostHated
Posts: 13
Joined: Mon Mar 28, 2016 6:00 pm

Re: What all packages are needed for JSSC?

Tue Mar 29, 2016 10:46 pm

Thank you for the detailed reply. I created and ran a script as seen below and called it portcheck (for lack of a better name at the time) :

Code: Select all

#!/bin/bash

for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
    (
        syspath="${sysdevpath%/dev}"
        devname="$(udevadm info -q name -p $syspath)"
        [[ "$devname" == "bus/"* ]] && continue
        eval "$(udevadm info -q property --export -p $syspath)"
        [[ -z "$ID_SERIAL" ]] && continue
        echo "/dev/$devname - $ID_SERIAL"
    )
done
Which displayed the line : /dev/ttyUSB0 - FTDI_FT232R_USB_UART_AH01JV3S

So looking at this, the fact that my Minibian has JSSC, and also even has librxtxSerial drivers installed, etc (I cant seem to use either), what in the world else could be wrong? I am running as root, and I know I need to be part of the "uccp" and "dialout" groups as per information I read about the app, but still keep getting errors. Might it have anything to do with logging in and running as root? I manually added myself to those groups by going to /etc/group and adding root at the end of the lines for each.
uucp:x:10:root
dialout:x:20:root

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: What all packages are needed for JSSC?

Tue Mar 29, 2016 11:44 pm

Editing system config files isn't recommended as other files may also need to changed that you are not aware of (such as the relationship between /etc/passwd and /etc/shadow).

Code: Select all

useradd -G {group-name} username
As for your java code, please run it again and post the output

singh361
Posts: 1
Joined: Sat May 04, 2019 2:11 pm

Re: What all packages are needed for JSSC?

Sat May 04, 2019 2:21 pm

A hidden folder is created in the HOME directory named .jssc/Linux
place libjSSC-2.6-armhf.so and libjSSC-2.6-armsf.so into it
reboot........
you can get the .so files from code folder of the library.
it has .so file for every architecture
Also ensure jdk on the development machine is same as the one on minibian
it should work now

Return to “Java”