redfalsh / flask-serial Goto Github PK
View Code? Open in Web Editor NEWreceive and send data of serial in Flask
License: MIT License
receive and send data of serial in Flask
License: MIT License
Hi, I'm using flask-serial in my flask project to display data from another device connected via serial on a dashboard.
Now I converted the project into a docker project and I run it with the following command:
docker-compose up --build
It works with a nginx server and gunicorn and the docker-compose.yaml file looks like this:
version: '3.3'
services:
mywebapp:
container_name: mywebapp
restart: always
env_file: .env
build: .
networks:
- db_network
- web_network
volumes:
- /dev:/dev
privileged: true
tty: true
nginx:
container_name: nginx
restart: always
image: "nginx:latest"
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certs:/etc/ssl/certs
networks:
- web_network
depends_on:
- mywebapp
networks:
db_network:
driver: bridge
web_network:
driver: bridge
With this configuration somehow the uart messages from /dev/ttyS0
somehow aren't forwarded to the python script. Has anyone an idea how to fix it to work?
I have been trying to install flask-serial to venv. There was no sign of faliure but when I tried to run by flask app, it is saying that there was no module named 'flask_serial'
Here is the logs from installing flask-serial using python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to flask_serial.egg-info/requires.txt
writing flask_serial.egg-info/PKG-INFO
writing top-level names to flask_serial.egg-info/top_level.txt
writing dependency_links to flask_serial.egg-info/dependency_links.txt
reading manifest file 'flask_serial.egg-info/SOURCES.txt'
writing manifest file 'flask_serial.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/flask_serial
copying build/lib.linux-x86_64-2.7/flask_serial/init.py -> build/bdist.linux-x86_64/egg/flask_serial
byte-compiling build/bdist.linux-x86_64/egg/flask_serial/init.py to init.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying flask_serial.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying flask_serial.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying flask_serial.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying flask_serial.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying flask_serial.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/flask_serial-1.1.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing flask_serial-1.1.0-py2.7.egg
Removing /usr/local/lib/python2.7/dist-packages/flask_serial-1.1.0-py2.7.egg
Copying flask_serial-1.1.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
flask-serial 1.1.0 is already the active version in easy-install.pth
Installed /usr/local/lib/python2.7/dist-packages/flask_serial-1.1.0-py2.7.egg
Processing dependencies for flask-serial==1.1.0
Searching for pyserial==3.4
Best match: pyserial 3.4
Adding pyserial 3.4 to easy-install.pth file
Using /usr/local/lib/python2.7/dist-packages
Searching for typing==3.7.4.1
Best match: typing 3.7.4.1
Processing typing-3.7.4.1-py2.7.egg
typing 3.7.4.1 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/typing-3.7.4.1-py2.7.egg
Searching for Flask==1.1.1
Best match: Flask 1.1.1
Adding Flask 1.1.1 to easy-install.pth file
Installing flask script to /usr/local/bin
Using /usr/local/lib/python2.7/dist-packages
Searching for Werkzeug==0.16.0
Best match: Werkzeug 0.16.0
Adding Werkzeug 0.16.0 to easy-install.pth file
Using /usr/local/lib/python2.7/dist-packages
Searching for Click==7.0
Best match: Click 7.0
Adding Click 7.0 to easy-install.pth file
Using /usr/local/lib/python2.7/dist-packages
Searching for Jinja2==2.10.3
Best match: Jinja2 2.10.3
Adding Jinja2 2.10.3 to easy-install.pth file
Using /usr/local/lib/python2.7/dist-packages
Searching for itsdangerous==1.1.0
Best match: itsdangerous 1.1.0
Adding itsdangerous 1.1.0 to easy-install.pth file
Using /usr/local/lib/python2.7/dist-packages
Searching for MarkupSafe==1.1.1
Best match: MarkupSafe 1.1.1
Adding MarkupSafe 1.1.1 to easy-install.pth file
Using /usr/local/lib/python2.7/dist-packages
Finished processing dependencies for flask-serial==1.1.0
Also, while I was trying to install flask-serial using pip, I get a non-ASCII error.
Traceback (most recent call last): File "/home/pi/python/agvflask.py", line 3, in <module> from flask_socketio import SocketIO File "/usr/local/lib/python3.9/dist-packages/flask_socketio/__init__.py", line 9, in <module> from socketio import socketio_manage # noqa: F401 File "/usr/local/lib/python3.9/dist-packages/socketio/__init__.py", line 9, in <module> from .zmq_manager import ZmqManager File "/usr/local/lib/python3.9/dist-packages/socketio/zmq_manager.py", line 5, in <module> import eventlet.green.zmq as zmq File "/usr/local/lib/python3.9/dist-packages/eventlet/__init__.py", line 17, in <module> from eventlet import convenience File "/usr/local/lib/python3.9/dist-packages/eventlet/convenience.py", line 7, in <module> from eventlet.green import socket File "/usr/local/lib/python3.9/dist-packages/eventlet/green/socket.py", line 21, in <module> from eventlet.support import greendns File "/usr/local/lib/python3.9/dist-packages/eventlet/support/greendns.py", line 66, in <module> setattr(dns, pkg, import_patched('dns.' + pkg)) File "/usr/local/lib/python3.9/dist-packages/eventlet/support/greendns.py", line 61, in import_patched return patcher.import_patched(module_name, **modules) File "/usr/local/lib/python3.9/dist-packages/eventlet/patcher.py", line 132, in import_patched return inject( File "/usr/local/lib/python3.9/dist-packages/eventlet/patcher.py", line 109, in inject module = __import__(module_name, {}, {}, module_name.split('.')[:-1]) File "/usr/local/lib/python3.9/dist-packages/dns/zone.py", line 86, in <module> class Zone(dns.transaction.TransactionManager): File "/usr/local/lib/python3.9/dist-packages/dns/zone.py", line 757, in Zone ) -> dns.rdtypes.ANY.SOA.SOA: AttributeError: module 'dns.rdtypes' has no attribute 'ANY'
why has no attribute 'any'
Is anyone has the same issue? thank you.
Setting up a serial port is pretty straight forward. But what about multiple ports? I am making a program with 16+ serial connections. How would I configure this to work with "n" number of ports?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.