Closed majes-git closed 3 years ago
Oh, it looks like it's failing to establish a websockets connection. Keystrokes and mouse events go over the websockets channel, so that's why they're failing.
Can you share the logs by running /opt/tinypilot/dev-scripts/dump-logs
?
Here you go http://sprunge.us/Z8NPw9 Please note that I have changed my client from a routed network to the same broadcast domain as the raspberrypi, first the client appeared as the NAT GW (172.29.1.108) later it appears directly (172.29.1.160).
I also run tcpdump on my client to see if there are connection attempts from pikvm, but there are none.
Could this may be related to this error message (from the tinypilot journal)?
Dec 10 00:02:27 pikvm python[614]: The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
Dec 10 00:02:27 pikvm python[614]: [2020-12-10 00:02:27,930] ERROR in server: The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
I have also tried Firefox and Safari, as well as another laptop. Same behavior.
My browser gets this as well as a response by nginx to all the /socket.io/ requests (which return a 400):
"The client is using an unsupported version of the Socket.IO or Engine.IO protocols"
Looks like the socket.io/engine.io version in nginx is too old. After downgrading the pip packages it somehow seems to work:
$ sudo -u tinypilot /opt/tinypilot/venv/bin/pip install 'python-socketio==4.*'
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting python-socketio==4.*
Downloading https://files.pythonhosted.org/packages/b2/91/d78afbe5861de53cafe9dcc6eb1a802d5495cfbffb79b8385ee7cf15a71c/python_socketio-4.6.1-py2.py3-none-any.whl (51kB)
100% |████████████████████████████████| 61kB 821kB/s
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python3.7/site-packages (from python-socketio==4.*) (1.15.0)
Collecting python-engineio<4,>=3.13.0 (from python-socketio==4.*)
Downloading https://files.pythonhosted.org/packages/8d/35/b9edf38b6a42077f3c097ab4edb0281adb3cc5434645c0bd301b0b45c767/python_engineio-3.14.2-py2.py3-none-any.whl (51kB)
100% |████████████████████████████████| 61kB 2.4MB/s
Installing collected packages: python-engineio, python-socketio
Found existing installation: python-engineio 4.0.0
Uninstalling python-engineio-4.0.0:
Successfully uninstalled python-engineio-4.0.0
Found existing installation: python-socketio 5.0.1
Uninstalling python-socketio-5.0.1:
Successfully uninstalled python-socketio-5.0.1
Successfully installed python-engineio-3.14.2 python-socketio-4.6.1
However there are still 2 major issues:
Dec 10 09:29:58 pikvm python[618]: Process Process-1:
Dec 10 09:29:58 pikvm python[618]: Traceback (most recent call last):
Dec 10 09:29:58 pikvm python[618]: File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
Dec 10 09:29:58 pikvm python[618]: self.run()
Dec 10 09:29:58 pikvm python[618]: File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
Dec 10 09:29:58 pikvm python[618]: self._target(*self._args, **self._kwargs)
Dec 10 09:29:58 pikvm python[618]: File "/opt/tinypilot/app/hid/write.py", line 18, in _write_to_hid_interface_immediately
Dec 10 09:29:58 pikvm python[618]: hid_handle.write(bytearray(buffer))
Dec 10 09:29:58 pikvm python[618]: BrokenPipeError: [Errno 108] Cannot send after transport endpoint shutdown
Dec 10 09:29:58 pikvm python[618]: Process Process-2:
Dec 10 09:29:58 pikvm python[618]: Traceback (most recent call last):
Dec 10 09:29:58 pikvm python[618]: File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
Dec 10 09:29:58 pikvm python[618]: self.run()
Dec 10 09:29:58 pikvm python[618]: File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
Dec 10 09:29:58 pikvm python[618]: self._target(*self._args, **self._kwargs)
Dec 10 09:29:58 pikvm python[618]: File "/opt/tinypilot/app/hid/write.py", line 18, in _write_to_hid_interface_immediately
Dec 10 09:29:58 pikvm python[618]: hid_handle.write(bytearray(buffer))
Dec 10 09:29:58 pikvm python[618]: BrokenPipeError: [Errno 108] Cannot send after transport endpoint shutdown
Dec 10 09:29:59 pikvm python[618]: Process Process-3:
Dec 10 09:29:59 pikvm python[618]: Traceback (most recent call last):
Dec 10 09:29:59 pikvm python[618]: File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
Dec 10 09:29:59 pikvm python[618]: self.run()
Dec 10 09:29:59 pikvm python[618]: File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
Dec 10 09:29:59 pikvm python[618]: self._target(*self._args, **self._kwargs)
Dec 10 09:29:59 pikvm python[618]: File "/opt/tinypilot/app/hid/write.py", line 18, in _write_to_hid_interface_immediately
Dec 10 09:29:59 pikvm python[618]: hid_handle.write(bytearray(buffer))
Dec 10 09:29:59 pikvm python[618]: BrokenPipeError: [Errno 108] Cannot send after transport endpoint shutdown
534d:2109
). At least v4l2-ctl
shows Motion-JPEG
support.Any ideas what else I can do to fix the keyboard issues and to improve the HDMI latency?
That's strange. When I connect the raspberrypi to ethernet instead of wifi the error messages disappeared and the latency improved tremendously. The client is still on wifi and normally I don't have issues with the wireless connections (using Unifi equipment).
Is it possible that the wifi chip in Raspi 4 is just crap? Any suggestions how to operate the tinypilot over wireless networks?
Thanks for the heads up! This turned out to be a bug in Flask-SocketIO. I fixed it in #370
You should be seeing performance a little bit slower over WiFi but not 10-50x slower.
Are you still seeing those errors in the logs?
Thanks Michael!
The fix works well. Over LAN I don't see those error messages. Wifi is still slow like hell it it seems to delay is stacking up. I'm going to get a USB wifi device and see if that has better performance.
I have installed tinypilot as described on top of raspios (2020-12-02). See log below. The HDMI part works fine, but keyboard does not. I have tested several USB-C to USB-A cables to no avail.
What also looks strange is the "red" button indicating "Could not connect to TinyPilot:" There are also errors in the developer tools see screenshot below. I'm using Chrome.
Install log: