Connect a weighing machine thru USB port

224 views
Skip to first unread message

PalomaM12

unread,
Jun 29, 2016, 3:51:25 PM6/29/16
to Chromium-Apps-Announce
Hi everybody!

I need to display weight from a weighing machine in an specific web page and make calculations whit it (instead of insert it manually, the app should get the weight thru the app). 
I've already read the documentation and it seems that packaged apps in Chrome are better for my problem (also I read the USB API).
But I'm a beginner at this and need some help because I don't know where to start. What do you recommend me? Is there some advice you have to give me?

Thanks!


PalomaM12

unread,
Jun 29, 2016, 4:39:57 PM6/29/16
to Chromium-Apps-Announce
It's a Torrey MFQ-40. III Class

Lessard, Steve

unread,
Jun 29, 2016, 5:29:29 PM6/29/16
to PalomaM12, Chromium-Apps-Announce

I have written a Chrome app that uses a scale. (I use the Mettler Toledo Ariva-S scale.) Here’s what I learned during the process:

·         Chrome’s USB API exposes the bus itself, not the native device drivers. In other words, the USB API allows you to write a device driver in JavaScript. Since I didn’t want to write a device driver the USB API was not an option for me.

·         Because I didn’t want to use the USB API I needed an out-of-process solution that would allow me to access the scale

o    Chrome has the Native Messaging API for talking to other processes. https://developer.chrome.com/extensions/nativeMessaging It does so by sending text-based messages back and forth via stdin and stdout. I experimented with this API a bit but ultimately decided it wasn’t going to work for me. The major issue was that Chrome can only pass messages to the native app if Chrome itself launches that native app (which it can do) but Chrome doesn’t give you any way to manage the native app’s process (e.g. pre-launch it, make sure it keeps running even if it crashed earlier, etc.)

o    I ended up writing a separate RESTful web service to wrap the scale’s native device driver. This service runs locally on the same machine as the Chrome app. Then my Chrome app makes a call to the web service to get data from the scale.

--
You received this message because you are subscribed to the Google Groups "Chromium-Apps-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages