How to read from Serial port in a webpage

坚强是说给别人听的谎言 提交于 2019-11-29 07:30:38

With a Java Applet you can read from the serial port but you need to sign the applet for security reasons. To firm unofficially (no sun's firm) you have to create a certificate. Here is an example.

I was solving the same problem and I did it. It is done using a Java Web Applet. You will need NetBeans. Read "readme" first. Let me know if anything, pls.

http://racky.wz.cz/applet_rs232.zip

Designed for serial COM1. Plug in it a RS-232 cable and short (connect) pins 2 and 3 on the other end.

This would appear to break most security models for the web. I cannot think of a way that it would be possible to do within a browser without granting an applet or ActiveX control a whole lot of permissions (and even then I'm not certain it's possible). I think it's likely to require some kind of native "thick" client-side application to do the communication with the serial port.

Java might very well be your best choice for maintaining cross-browser and cross-platform compatibility. A quick search brought up these pages that you may find useful:

The server-side choice doesn't matter at all. Once the client reads the data, it's the same as sending any other data to a server-side script.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!