System.serial UnsatisfiedLinkError (missing library?)

Fresh install of Ignition 7.5.1, added the following modules:
Serial Support Client 1.5.1 (b29)
Serial Support Gateway 1.5.1 (b29)

Created a button and added the following:

system.serial.openSerialPort('/dev/ttyUSB0')

Pressing the button results in the following:

ERROR [ActionAdapter-AWT-EventQueue-0] <HTML>Error executing script for event:&nbsp;<code><b>actionPerformed</b></code><BR>on component:&nbsp;<code><b>Button</b></code>.
Traceback (most recent call last):
  File "<event:actionPerformed>", line 14, in <module>
	at Serialio.SerialPortLocal.SerOpenPort(Native Method)
	at Serialio.SerialPortLocal.open(SerialPortLocal.java:317)
	at Serialio.SerialPortLocal.<init>(SerialPortLocal.java:287)
	at com.inductiveautomation.ignition.modules.serial.scripting.SerialScriptModule.openSerialPort(SerialScriptModule.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: Serialio.SerialPortLocal.SerOpenPort(LSerialio/SerialConfig;)I

	at org.python.core.PyException.fillInStackTrace(PyException.java:70)
	at java.lang.Throwable.<init>(Throwable.java:181)
	at java.lang.Exception.<init>(Exception.java:29)
	at java.lang.RuntimeException.<init>(RuntimeException.java:32)
	at org.python.core.PyException.<init>(PyException.java:46)
	at org.python.core.PyException.<init>(PyException.java:43)
	at org.python.core.Py.JavaError(Py.java:481)
	at org.python.core.Py.JavaError(Py.java:474)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
	at org.python.core.PyObject.__call__(PyObject.java:387)
	at org.python.core.PyObject.__call__(PyObject.java:391)
	at org.python.pycode._pyx17.f$0(<event:actionPerformed>:14)
	at org.python.pycode._pyx17.call_function(<event:actionPerformed>)
	at org.python.core.PyTableCode.call(PyTableCode.java:165)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1261)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:539)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:155)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:266)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
	at $Proxy14.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
	at java.awt.Component.processMouseEvent(Component.java:6288)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6053)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4651)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4481)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4481)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
	at java.awt.EventQueue.access$000(EventQueue.java:84)
	at java.awt.EventQueue$1.run(EventQueue.java:602)
	at java.awt.EventQueue$1.run(EventQueue.java:600)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:616)
	at java.awt.EventQueue$2.run(EventQueue.java:614)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.UnsatisfiedLinkError: Serialio.SerialPortLocal.SerOpenPort(LSerialio/SerialConfig;)I
	at Serialio.SerialPortLocal.SerOpenPort(Native Method)
	at Serialio.SerialPortLocal.open(SerialPortLocal.java:317)
	at Serialio.SerialPortLocal.<init>(SerialPortLocal.java:287)
	at com.inductiveautomation.ignition.modules.serial.scripting.SerialScriptModule.openSerialPort(SerialScriptModule.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
	... 49 more

When I originally tried this I had code that did a full configuration, open, write, read, close. This was throwing exactly the same exception, but also included a message complaining that it could not find the libLux86_64bit library. Unfortunately, I am unable to reproduce the error with this extra text.

I cannot find any reference to libLux86 anywhere, so I would guess it is supposed to be supplied by the serial module.

Any ideas?
Thanks.

This is the extra text that I was talking aboutā€¦

Serialio Library: version 10.0.4: build 9212 Copyright (c) 1996-2009 Serialio.com, All Rights Reserved. os.name="Linux" os.arch="amd64" java.lang.UnsatisfiedLinkError: no libLux86_64bit in java.library.path: Check that native library libLux86_64bit is in proper directory

Iā€™m finding it hard to reliably get this to appear- it seems that it is detached from the exception in some way and only runs once per session or something.

There is a bug in the native library loader for 64-bit linux. Iā€™ve already fixed it, should work in the next release. Sorry about that.

Thanks. In the meantime, is there a workaround? I could easily make the file available if I knew where it is now and where the loader was searching for it.

The latest 7.5.2 beta (available in the downloads section of website) has the fix included.

Using 7.5.2-beta4, I get errors when starting the designer:

INFO  [main-Designer-Startup] Starting module: Serial Support Client [+7361]
ERROR [NativeLoader-Designer-Startup] Error loading SerialIo native library.
java.lang.NullPointerException
	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1383)
	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1357)
	at com.inductiveautomation.ignition.modules.serial.SerialNativeLoader.loadNative(SerialNativeLoader.java:64)
	at com.inductiveautomation.ignition.modules.serial.SerialNativeLoader.load(SerialNativeLoader.java:49)
	at com.inductiveautomation.ignition.modules.serial.SerialSupportDesignerHook.startup(SerialSupportDesignerHook.java:18)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner$LoadedModule.startup(IgnitionDesigner.java:2353)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner.startupModule(IgnitionDesigner.java:1056)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner.loadProject(IgnitionDesigner.java:968)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner$StartupProjectDialogHandler$1.run(IgnitionDesigner.java:379)
	at java.lang.Thread.run(Thread.java:662)
ERROR [main-Designer-Startup] Error starting up module Serial Support Client
java.lang.RuntimeException
	at com.inductiveautomation.ignition.modules.serial.SerialNativeLoader.load(SerialNativeLoader.java:52)
	at com.inductiveautomation.ignition.modules.serial.SerialSupportDesignerHook.startup(SerialSupportDesignerHook.java:18)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner$LoadedModule.startup(IgnitionDesigner.java:2353)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner.startupModule(IgnitionDesigner.java:1056)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner.loadProject(IgnitionDesigner.java:968)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner$StartupProjectDialogHandler$1.run(IgnitionDesigner.java:379)
	at java.lang.Thread.run(Thread.java:662)

system.serial.openSerialPort still results in:

java.lang.UnsatisfiedLinkError: no libLux86_64bit in java.library.path: Check that native library libLux86_64bit is in proper directory

Please let me know if there is anything more I can do to help fix this.

Thanks.

Apologiesā€¦ I didnā€™t actually push the changeset that fixed this. :blush:

I also got this error when calling

system.serial.openSerialPort('/dev/ttyAMA0')

Ignition v7.9.9
Serial Support Client 4.9.10 Trial
Rasberry pi 4.14.79-v7

Traceback (most recent call last):
  File "<event:keyPressed>", line 58, in <module>
	at Serialio.SerialPortLocal.SerOpenPort(Native Method)
	at Serialio.SerialPortLocal.open(SerialPortLocal.java:369)
	at Serialio.SerialPortLocal.<init>(SerialPortLocal.java:339)
	at com.inductiveautomation.ignition.modules.serial.scripting.SerialScriptModule.openSerialPort(SerialScriptModule.java:193)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: Serialio.SerialPortLocal.SerOpenPort(LSerialio/SerialConfig;)I

	at org.python.core.Py.JavaError(Py.java:495)
	at org.python.core.Py.JavaError(Py.java:488)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
	at org.python.core.PyObject.__call__(PyObject.java:387)
	at org.python.core.PyObject.__call__(PyObject.java:391)
	at org.python.pycode._pyx4.f$0(<event:keyPressed>:97)
	at org.python.pycode._pyx4.call_function(<event:keyPressed>)
	at org.python.core.PyTableCode.call(PyTableCode.java:165)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1275)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:636)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:180)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:271)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
	at com.sun.proxy.$Proxy21.keyPressed(Unknown Source)
	at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:250)
	at java.awt.Component.processKeyEvent(Component.java:6493)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2832)
	at java.awt.Component.processEvent(Component.java:6312)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4891)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4713)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
	at java.awt.Component.dispatchEventImpl(Component.java:4762)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Window.dispatchEventImpl(Window.java:2750)
	at java.awt.Component.dispatchEvent(Component.java:4713)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.UnsatisfiedLinkError: Serialio.SerialPortLocal.SerOpenPort(LSerialio/SerialConfig;)I
	at Serialio.SerialPortLocal.SerOpenPort(Native Method)
	at Serialio.SerialPortLocal.open(SerialPortLocal.java:369)
	at Serialio.SerialPortLocal.<init>(SerialPortLocal.java:339)
	at com.inductiveautomation.ignition.modules.serial.scripting.SerialScriptModule.openSerialPort(SerialScriptModule.java:193)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
	... 48 more

Ignition v7.9.9 (b2018081621)
Java: Oracle Corporation 1.8.0_65

We donā€™t have support for ARM with the serial module, unfortunately.

Thanks Kevin. Is there any way to get support for ARM?

Iā€™m guessing that using the pyserial library is also not supported, given that I tried and received an import error indication ā€œNo Java Communications API implementation foundā€ (itā€™s looking for javax.comm or gnu.io)

And it looks like adding those libraries or anything else like jSerialComm library, for example, would not support client access anywayā€¦

Iā€™m not sure of any workarounds other than trying to build your own module to do serial access.

I think we have a ticket on our end for upgrading the serial library to a version that supports ARM if thereā€™s on available from the vendor.

Okay, that wasnā€™t too difficult. Your documentation is pretty good! Using jSerialComm.

First time I've ever heard that, lol

edit: meant SDK docs, our Ignition docs are pretty good.

can you post the link to adding 3rd party Java libraries like jSerialComm

I followed the SDK documentation for making Designer/Client modules.

Just wrote a small class to expose the jSerialComm library and added it to the script manager. Not sure how correct it is, but it works just fine ĀÆ\_(惄)_/ĀÆ

1 Like

Iā€™m getting these unsatisfied link errors with v7.9.11 64-bit in both Windows 7 and Linux. Is this known and perhaps fixed in a later 7.9.x ?

If you get the errors but it still works then yes, it was a known/expected issue - the old serial library did its own System.loadLibrary call in a static initializer that would fail and we did our own explicit System.load against the known location for the library.

Hah! The error threw me off. It is in fact working. (:

(Planning to push them to latest 7.9 early this fall. Then 8.1 in the spring.)