Read serial port and broadcast it on websockets. Allow multiple websocket clients, each has its own thread.
with pip and venv :
sudo apt install python3-venv python3-pip # make sure you have venv and pip packages
python -m venv venv/ # create virtual environment
source venv/bin/activate # activate virtual environment
pip install -r requirements.txt # install all dependenciesor install the dependencies manually :
pip install pyserial websocketspython serial2websockets.py
# with this default parameters
python serial2websockets.py -p 5678 -b 9600 - automatic find ip address for the host and serial port is only tested on linux.
# log all messages with timestamp on standard output
python serial2websockets.py -l -t > log.csvlooks like:
YY/MM/DD hh:mm:ss:ffffff, a message from serial