Go Down

Topic: Cannot print to serial using Serial.print (Read 409 times) previous topic - next topic

Lkola

While running a simple sketch with output to screen:

Serial.begin(9600);
and
Serial.print("smth");

I get the error message:

java.lang.UnsatisfiedLinkError: jssc.SerialNativeInterface.openPort(Ljava/lang/String;Z)J
        at jssc.SerialNativeInterface.openPort(Native Method)
        at jssc.SerialPort.openPort(SerialPort.java:158)


I run openSuse Leap 42.3, fully updated, and Arduino 1.8.5.
My board is Ardiono Uno.

I installed the package rxtx.java.

I think that the Arduino compiler does not see a needed package installed.

robtillaart

Could it be that you need to restart the computer (or at least the java interpreter) after installation?

(disclaimer: no experience on OpenSuse)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

pert

When exactly do you get this error message? I'm guessing it would be either while uploading the sketch or when trying to open Serial Monitor.

Lkola

Could it be that you need to restart the computer (or at least the java interpreter) after installation?

(disclaimer: no experience on OpenSuse)
I have rebooted, but nothing changed.
I still get the same Java error

Lkola

When exactly do you get this error message? I'm guessing it would be either while uploading the sketch or when trying to open Serial Monitor.
The verification stage passes successfully, with a minor warning that is unrelated and doesn't impact anything (Other programs with that warning still run smoothly).

A bare upload is successful; it doesn't open a serial monitor.

However, if the upload is preformed while the serial monitor is open, the error shows up, and the program fails.

Also, if the upload step is completed and then the serial monitor is opened, then the same error pops up, and the program stops working.

The full error message is:

Exception in thread "Thread-49" java.lang.UnsatisfiedLinkError: jssc.SerialNativeInterface.openPort(Ljava/lang/String;Z)J                                                                                                
       at jssc.SerialNativeInterface.openPort(Native Method)                                              
       at jssc.SerialPort.openPort(SerialPort.java:158)
       at processing.app.Serial.<init>(Serial.java:136)
       at processing.app.Serial.<init>(Serial.java:82)
       at processing.app.SerialMonitor$4.<init>(SerialMonitor.java:101)
       at processing.app.SerialMonitor.open(SerialMonitor.java:101)
       at processing.app.AbstractMonitor.resume(AbstractMonitor.java:104)
       at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2218)
       at processing.app.Editor.access$2200(Editor.java:79)
       at processing.app.Editor$DefaultExportHandler.run(Editor.java:2196)
       at java.lang.Thread.run(Thread.java:748)



pert

Well at least we know communication with your board via serial is working since that's how a standard upload is done. However that is done via a separate tool (e.g. AVRDUDE).

You'll remember in the last thread I told you I distrusted the instructions on the Arduino Playground that you attempted to follow to install the Arduino IDE.

Have you tried just downloading the Linux version of the Arduino IDE from http://www.arduino.cc/en/Main/Software?

goodguy00

#6
Mar 12, 2018, 06:21 pm Last Edit: Mar 12, 2018, 10:06 pm by goodguy00
i even cannot open the serial-monitor properly. after i upgraded to opensuse leap 42.3 (before: opensuse 13.2) summer 2017, i got a lot of problems. first had some error with ctags, now this one.
i can compile and upload a sketch with no problems, but when i open the serial monitor, it throws this error (same as above).

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: jssc.SerialNativeInterface.openPort(Ljava/lang/String;Z)J
      at jssc.SerialNativeInterface.openPort(Native Method)
      at jssc.SerialPort.openPort(SerialPort.java:158)
      at processing.app.Serial.<init>(Serial.java:136)
      at processing.app.Serial.<init>(Serial.java:82)
....

i tried to explicitely set CLASSPATH to point to my version of jssc:

-rwxr-xr-x 1 root root 21173 Jul 12  2017 /usr/share/java/jssc-2.8.0.jar*
lrwxrwxrwx 1 root root    14 Sep 16 16:46 /usr/share/java/jssc.jar -> jssc-2.8.0.jar*

no remedy. any ideas?

btw: what is successful (and i think it's the same technology/java-lib): i can open the serial-monitor in eclipse with the arduino-plugin.

goodguy00

well, as soon as i talk to someone (even a blog like this) i find a solution much quicker. i searched in the eclipse install and found this:

eclipse_4.7/configuration/org.eclipse.osgi/724/0/.cp/lib/jssc-2.8.0.jar :: 153562 bytes

but my install, being used by arduino is:

/usr/share/java/Arduino-1.8.5/lib/jssc-2.8.0.jar -> /usr/share/java/jssc-2.8.0.jar :: 21173 bytes (and that is the latest official version 2.8.0-3.3 of openSuse Leap 42.3)

changing CLASSPATH to eclipse's jssc jar solved it.






Go Up