Passing serial data to javascript via Flask
问题 I've been poking around with pushing data from Flask to Javascript, mainly by modifying the code found here: https://github.com/clebio/flask-d3 Now I'm trying to read data from a COM Port and pass it through Flask to Javascript. I've done some of this before using PySerial, but am not sure the right way to approach combining it into Flask. I feel comfortable implementing something where, with each request, the port is opened, reads a line, and is closed. That's not very efficient, so ideally