简体   繁体   中英

How can my web app communicate with serial port

I have a cloud web app using asp web api and angular. Both hosted on azure. I need my angular app to be able to communicate to serial port (read/write). How can I do this?

I've read that chrome apps can connect to usb/serial, but i'm still confused of how it works. Should i rebuild my apps to chrome apps, or should i create a seperate apps or can i just write chrome apps that open my actual web and access the serial from my current app?

You don't have to rewrite your app. Just create a chrome app and use webview for your actual cloud app. Basicaly you have to write the serial port communication in the chrome app context and pass the data to your webview context in your chrome app which is actually the app loaded from your cload.

Other approach is to write your whole application in an offline chrome app and communicate with your cloud server trought ajax or websocket.

Another thing might help is nw.js. With this you can create desktop like apps with web technology. Basicaly in your nw.js app you will use a node.js serial modul for serial communication.

Or combinate these methods.

I suggest one of the chrome app way cuz I have good experience with its serial module.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM