I have an XPort Universal Demo board that I'm using as both an interface to a device with a serial port and as a webserver. I need the JavaScript in a web page to access a method in the Java applet that handles the serial port, allowing it to read and write data to the serial port. Do you have an example Jave applet and JavaScript that uses the XPort in this fashion?
Announcement
Collapse
No announcement yet.
Accessing serial port from JavaScript
Collapse
X
-
Originally posted by jpetrucc View PostI have an XPort Universal Demo board that I'm using as both an interface to a device with a serial port and as a webserver. I need the JavaScript in a web page to access a method in the Java applet that handles the serial port, allowing it to read and write data to the serial port. Do you have an example Jave applet and JavaScript that uses the XPort in this fashion?
To use Javascript with the XPort, you need to run custom code compiled with the CPK. The CPK requires a license agreement. If you're interested in pursuing this path, please contact your Lantronix sales contact or FAE to get a copy of the license agreement to sign.
Mariano
-
The xPico Ethernet device runs the same software as the XPort (CoBOS), and the serial port can be accessed with a Java applet. You can see this App Note to see how to web enable your CoBOS device:
https://ltxfaq.custhelp.com/ci/fatta...b_ServerV4.pdf
Comment
-
Hello Mariano thanks for the quick replay, i followed the documentation and it works in parts, but when open in the browser the java security stop the process, i add the IP address in the java control panel and it still doesn't work. Is it possible to fix it?
Comment
-
Originally posted by py2maw View PostHello Mariano thanks for the quick replay, i followed the documentation and it works in parts, but when open in the browser the java security stop the process, i add the IP address in the java control panel and it still doesn't work. Is it possible to fix it?
I'll send you an email with some Alpha firmware that could support access to the serial port through Javascript (similar to the xPico Wi-Fi's WebAPI).
Mariano
Comment
-
Hi all,
Please forgive my inexperience - I have only written html pages that communicate with basic javascript in the past.
I have the same issue as py2maw above. I have compiled the example js code as per steps in:
https://ltxfaq.custhelp.com/ci/fatta...b_ServerV4.pdf
It runs ok from DOS (page 15 - C:> java Test xxx.xxx.xxx.xxx 10001) but does not show inside my html page as the plugin to enable Java Applets is no longer supported.
Does Lantronix have an alternate method / workaround for this? Is there an example html app or code I can download?
We require a simple serial terminal on a html page. I have the Xport PRO (XPP1002000-02R).
Thanks in advance!
Alex
Comment
-
The XPort Pro doesn't support WebAPI to allow access to the serial port from an HTTP transaction (which is required for Javascript).
I recommend that you look at the XPort Edge, which does have the WebAPI:
https://www.lantronix.com/products/xport-edge/
I'll send you an email with contact information for the Lantronix sales person in your region so that you can get more information on the XPort Edge.
Mariano
Comment
Comment