Receive data from COM port of client

Receive data from COM port of client

  
Hi,

First post to the forum, so hello to everyone!!!

My question is: Is it possible to receive data from the COM ports of a client PC into the browser?

The device is a weighing scale that weighs objects and then transmits a packet of data. The data is then received by the PC and stored in the database.

The reason I ask is that I have an application that is ripe for updating, but it has this requirement which cannot be changed easily. Manual input is not an option as it would take too long, and would be prone ot error.

Any advice greatfully received.

Thanks

Ian
Hi Ian,

It's interesting, I had a talk with a friend a couple days ago that was trying to do exatcly the same thing (also with scales). I'll ask what approach did he take.

But anyway, I can tell you already that you can't do it with pure javascript on a browser. Since js has no hardware access.

Also the solution will depend alot on what is your device, devices capabilities (like java applets/activex) and browser. Can you give some details about that?

Regards,
João Rosado
Hi 

Thanks João.

The weighing hardware is quite basic, however it is expensive and not easily replacable. The browser could be whichever would work, but primarily it is a Windows environment.

Two ideas I had:

1. Some kind of keyboard hook that would receive the COM port data, and convert it to keypresses in the browser. Some anti-virus software detects this as malicious behaviour though.

2. A software agent that detects new weights, and then with a database connection, insert that data in to the database, and with a regular timer update the webpage.

Just some initial thoughts I had. I'm sure there are better ideas.

Thanks

Ian
Usually the best options is a java applet (if the device/browser supports java applets) or a native app (in case of a android/ios device).that than easily do web requests. Solution will depend alot on your device, that's why I asked specifics.
I checked the usual solution for mobile (PhoneGap) but it doesn't support a COM interface.

Still waiting an asnwer from my friend.

Regards,
João Rosado
Hi Ian,

I think your first idea might be one to follow. I have no comission or anything but I found some software that reads the data from the RS232 port and sends it to the keyboard buffer. I haven't tried it since I also don't have a scale...
Nonetheless here goes the links: 
  • http://www.billproduction.com/billscalebalance/index.html
  • http://www.tec-it.com/software/data-acquisition/twedge/keyboard-wedge/default.aspx
Cheers,
André
I talked to my friend.
The scales he had to inteact with were from http://www.seca.com/ and they had a client driver that allowed sending HL7 messages to specific endpoints. Then he would place that information in a table on the database and process it like a queue.

I also searched a bit and found a java applet called jssc. Looks good but I cound't get it to work on my machine. Probaby because I don't have any COM ports xD.
They have a example online with a full interface all coded in javascript: http://java-simple-serial-connector.googlecode.com/svn/trunk/js_terminal/index.html

Think if this one works (of if your scales have nice software) is better than the keyboard events thingy.

Regards,
João Rosado