-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming ESP32 camera feed to Flask web app usingFastAPI and python-socketio as middleware #1
Comments
Issues faced to implement
Issues facing to implement
|
Few solutions found on stack overflow.
Try figuring out solution from these. Or via any new source. |
An Idea.💡 ..
this lead to...... One alternative, seems to be workable..
Now going to perform experiment on this, and will report the status. As a next update, instead of having flask's template, can go with React web-app, can use MUI and can design better UI. Any way, that's for later time. |
Could able to achieve till here with the help of these references..
Heartful thanks to them. |
|
|
Error getting with multiprocessing: - Ran out of input error. Log PS D:\4-2_sem\MajorProject\SelfDrivingCar> python .\main.py
[DEBUG] main: About to establish communications
[DEBUG] main: Communications established
[DEBUG] main: Starting the application...
* Restarting with stat
[DEBUG] main: About to establish communications
[DEBUG] main: Communications established
[DEBUG] main: Starting the application...
* Debugger is active!
* Debugger PIN: 119-550-104
(15972) wsgi starting up on http://127.0.0.1:5000
(15972) accepted ('127.0.0.1', 53906)
[DEBUG] web: Client connected successfully
127.0.0.1 - - [14/Jun/2023 12:07:52] "GET /socket.io/?EIO=3&transport=polling&t=OYud_hl HTTP/1.1" 200 421 0.008005
(15972) accepted ('127.0.0.1', 53907)
[DEBUG] web: client's ack: {'msg': 'CONN_ESTABLISHED'}
127.0.0.1 - - [14/Jun/2023 12:07:52] "POST /socket.io/?EIO=3&transport=polling&t=OYud_iR&sid=c930cb0509244948aa51c21bfeff7cf9 HTTP/1.1" 200 219 0.000000
127.0.0.1 - - [14/Jun/2023 12:07:52] "GET /socket.io/?EIO=3&transport=polling&t=OYud_ia&sid=c930cb0509244948aa51c21bfeff7cf9 HTTP/1.1" 200 183 0.000000
[DEBUG] web: client's ack: {'msg': 'CONN_TERMINATED'}
[DEBUG] web: Client disconnected successfully
127.0.0.1 - - [14/Jun/2023 12:07:53] "GET /socket.io/?EIO=3&transport=websocket&sid=c930cb0509244948aa51c21bfeff7cf9 HTTP/1.1" 200 0 0.719858
(15972) accepted ('127.0.0.1', 53911)
[DEBUG] web: Client connected successfully
127.0.0.1 - - [14/Jun/2023 12:07:58] "GET /socket.io/?EIO=3&transport=polling&t=OYue1Ck HTTP/1.1" 200 421 0.000000
(15972) accepted ('127.0.0.1', 53913)
[DEBUG] web: client's ack: {'msg': 'CONN_ESTABLISHED'}
127.0.0.1 - - [14/Jun/2023 12:07:59] "POST /socket.io/?EIO=3&transport=polling&t=OYue1Up&sid=618f280ac8fa4e24ba4061fb0beba363 HTTP/1.1" 200 219 0.005010
127.0.0.1 - - [14/Jun/2023 12:07:59] "GET /socket.io/?EIO=3&transport=polling&t=OYue1Ut&sid=618f280ac8fa4e24ba4061fb0beba363 HTTP/1.1" 200 183 0.000000
[DEBUG] web: (stream event) client sent: {'msg': 'start streaming'}
[[[[[[[[[[[[[[[[[[[[[[[[[[[STREAMING BEGINS]]]]]]]]]]]]]]]]]]]]]]]]]]]
[DEBUG] web: Creating proceses to begin streaming
[DEBUG] web: about to start spawned process for streaming
Exception in thread Thread-9 (_handle_event_internal):
Traceback (most recent call last):
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\site-packages\socketio\server.py", line 682, in _handle_event_internal
r = server._trigger_event(data[0], namespace, sid, *data[1:])
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\site-packages\socketio\server.py", line 711, in _trigger_event
return self.handlers[namespace][event](*args)
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_socketio\__init__.py", line 282, in _handler
return self._handle_event(handler, message, namespace, sid,
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_socketio\__init__.py", line 713, in _handle_event
ret = handler(*args)
File "D:\4-2_sem\MajorProject\SelfDrivingCar\app\middleware\communication\web_communicator.py", line 58, in handle_stream
camProcess.start()
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "<string>", line 1, in <module>
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\balga\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 126, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
[DEBUG] main: Thanks for utilizing the application. Current Resolution: |
This is related to the above immediate commit. 🗝 Point:
|
By all grace - now 🌉 bridge between ESP32 and Web-app is built.
Current Stack
ScreenshotFlow used to get the feed in webInitial Setup
Getting the feed in web
|
Missed to add the resource taken to resolve CORS error. Stackoverflow - Connect A Backend Python FastAPI with or without SocketIO Server with a Frontend React Client |
Inherently also fixed the streaming collision data from ESP32 to web.
|
The text was updated successfully, but these errors were encountered: