How to send data from COM port in JS?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
47 views
Good day! Based on the values of the accelerometer tmci want to build a 3D model in the browser (WebGL). Tmca connected to a COM port, the values I read using java jSSC library. How beautiful then read the values in JS to build the 3D model? Thank you.
by | 47 views

2 Answers

0 like 0 dislike
The runtime JS in the browser is isolated from the iron, so there should be a full implementation of client-server applications.
Computer with COM port will act as a web server.
On this server you need to implement a server-side script that will connect to COM and is the transit over HTTP from the client browser.
And on the client-side API will be implemented by JS, and receive data via AJAX.
Here is an example of how to make the server side on NodeJS.
by
0 like 0 dislike
There is such an option. Create a server-Python there take data from COM port, page Ajax will take them away....well then how would all versions be not very realtime. You can still ESP8266 bolted to the stm, on it the web server with the data from the accelerometer, web browser, Ajax will have to eat it all
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users