How to read from Serial port in a webpage

后端 未结 4 828
轮回少年
轮回少年 2020-12-18 06:05

I want to design a webform that user should fill some fields. The value of one field should be read from Serial port (COM1) of client computer which a special hardware is co

相关标签:
4条回答
  • 2020-12-18 06:16

    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.

    0 讨论(0)
  • 2020-12-18 06:18

    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.

    0 讨论(0)
  • 2020-12-18 06:19

    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.

    0 讨论(0)
  • 2020-12-18 06:31

    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:

    • Java Communications API
    • Java Serial Programming Wikibook

    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.

    0 讨论(0)
提交回复
热议问题