tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
3.01k stars 252 forks source link

HDMI works keyboard does not #368

Closed majes-git closed 3 years ago

majes-git commented 3 years ago

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.

tinypilot

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.

chrome-developer-tools

Install log:

pi@pikvm:~ $ curl -sS https://raw.githubusercontent.com/mtlynch/tinypilot/master/quick-install \
>   | bash -
+ '[' -z '' ']'
+ TINYPILOT_INSTALL_VARS=
+ echo 'Using default install vars'
Using default install vars
+ USE_TC358743_DEFAULTS=
+ [[ '' =~ ustreamer_capture_device= ]]
+ '[' -f /home/ustreamer/config.yml ']'
+ '[' -z '' ']'
+ [[ ! '' =~ ustreamer_encoder= ]]
+ TINYPILOT_INSTALL_VARS+=' ustreamer_encoder=hw'
+ [[ !  ustreamer_encoder=hw =~ ustreamer_format= ]]
+ TINYPILOT_INSTALL_VARS+=' ustreamer_format=jpeg'
+ [[ !  ustreamer_encoder=hw ustreamer_format=jpeg =~ ustreamer_resolution= ]]
+ TINYPILOT_INSTALL_VARS+=' ustreamer_resolution=1920x1080'
+ [[ !  ustreamer_encoder=hw ustreamer_format=jpeg ustreamer_resolution=1920x1080 =~ ustreamer_persistent= ]]
+ TINYPILOT_INSTALL_VARS+=' ustreamer_persistent=true'
+ [[ !  ustreamer_encoder=hw ustreamer_format=jpeg ustreamer_resolution=1920x1080 ustreamer_persistent=true =~ ustreamer_desired_fps= ]]
+ TINYPILOT_INSTALL_VARS+=' ustreamer_desired_fps=30'
+ set -u
+ set -e
+ echo 'Final install vars:  ustreamer_encoder=hw ustreamer_format=jpeg ustreamer_resolution=1920x1080 ustreamer_persistent=true ustreamer_desired_fps=30'
Final install vars:  ustreamer_encoder=hw ustreamer_format=jpeg ustreamer_resolution=1920x1080 ustreamer_persistent=true ustreamer_desired_fps=30
++ mktemp -d
+ pushd /tmp/tmp.ldxWTRmNdb
/tmp/tmp.ldxWTRmNdb ~
+ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [346 kB]
Fetched 13.4 MB in 12s (1,123 kB/s)
Reading package lists... Done
+ sudo apt-get install -y libffi-dev libssl-dev python3-dev python3-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  dh-python libexpat1-dev libpython3-dev libpython3.7-dev libssl1.1 python-pip-whl python3-distutils python3-lib2to3 python3.7-dev python3.7-venv
Suggested packages:
  libssl-doc
The following NEW packages will be installed:
  dh-python libexpat1-dev libffi-dev libpython3-dev libpython3.7-dev libssl-dev python-pip-whl python3-dev python3-distutils python3-lib2to3 python3-venv python3.7-dev python3.7-venv
The following packages will be upgraded:
  libssl1.1
1 upgraded, 13 newly installed, 0 to remove and 11 not upgraded.
Need to get 52.8 MB of archives.
After this operation, 82.1 MB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian buster/main armhf libssl1.1 armhf 1.1.1d-0+deb10u4+rpt1 [1,276 kB]
Get:2 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf python3-lib2to3 all 3.7.3-1 [76.7 kB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf libssl-dev armhf 1.1.1d-0+deb10u4+rpt1 [1,583 kB]
Get:3 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf python3-distutils all 3.7.3-1 [142 kB]
Get:6 http://archive.raspberrypi.org/debian buster/main armhf python-pip-whl all 18.1-5+rpt1 [1,591 kB]
Get:5 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf dh-python all 3.20190308 [99.3 kB]
Get:7 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf libexpat1-dev armhf 2.2.6-2+deb10u1 [127 kB]
Get:8 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf libffi-dev armhf 3.2.1-9 [159 kB]
Get:9 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf libpython3.7-dev armhf 3.7.3-2+deb10u2 [47.2 MB]
Get:12 http://raspbian.raspberrypi.org/raspbian buster/main armhf python3-dev armhf 3.7.3-1 [1,264 B]
Get:14 http://raspbian.raspberrypi.org/raspbian buster/main armhf python3-venv armhf 3.7.3-1 [1,180 B]
Get:10 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf libpython3-dev armhf 3.7.3-1 [20.1 kB]
Get:11 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf python3.7-dev armhf 3.7.3-2+deb10u2 [522 kB]
Get:13 http://ftp.agdsn.de/pub/mirrors/raspbian/raspbian buster/main armhf python3.7-venv armhf 3.7.3-2+deb10u2 [6,148 B]
Fetched 52.8 MB in 18s (3,008 kB/s)
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
Selecting previously unselected package python3-lib2to3.
(Reading database ... 39973 files and directories currently installed.)
Preparing to unpack .../00-python3-lib2to3_3.7.3-1_all.deb ...
Unpacking python3-lib2to3 (3.7.3-1) ...
Selecting previously unselected package python3-distutils.
Preparing to unpack .../01-python3-distutils_3.7.3-1_all.deb ...
Unpacking python3-distutils (3.7.3-1) ...
Selecting previously unselected package dh-python.
Preparing to unpack .../02-dh-python_3.20190308_all.deb ...
Unpacking dh-python (3.20190308) ...
Selecting previously unselected package libexpat1-dev:armhf.
Preparing to unpack .../03-libexpat1-dev_2.2.6-2+deb10u1_armhf.deb ...
Unpacking libexpat1-dev:armhf (2.2.6-2+deb10u1) ...
Selecting previously unselected package libffi-dev:armhf.
Preparing to unpack .../04-libffi-dev_3.2.1-9_armhf.deb ...
Unpacking libffi-dev:armhf (3.2.1-9) ...
Selecting previously unselected package libpython3.7-dev:armhf.
Preparing to unpack .../05-libpython3.7-dev_3.7.3-2+deb10u2_armhf.deb ...
Unpacking libpython3.7-dev:armhf (3.7.3-2+deb10u2) ...
Selecting previously unselected package libpython3-dev:armhf.
Preparing to unpack .../06-libpython3-dev_3.7.3-1_armhf.deb ...
Unpacking libpython3-dev:armhf (3.7.3-1) ...
Preparing to unpack .../07-libssl1.1_1.1.1d-0+deb10u4+rpt1_armhf.deb ...
Unpacking libssl1.1:armhf (1.1.1d-0+deb10u4+rpt1) over (1.1.1d-0+deb10u3+rpt1) ...
Selecting previously unselected package libssl-dev:armhf.
Preparing to unpack .../08-libssl-dev_1.1.1d-0+deb10u4+rpt1_armhf.deb ...
Unpacking libssl-dev:armhf (1.1.1d-0+deb10u4+rpt1) ...
Selecting previously unselected package python-pip-whl.
Preparing to unpack .../09-python-pip-whl_18.1-5+rpt1_all.deb ...
Unpacking python-pip-whl (18.1-5+rpt1) ...
Selecting previously unselected package python3.7-dev.
Preparing to unpack .../10-python3.7-dev_3.7.3-2+deb10u2_armhf.deb ...
Unpacking python3.7-dev (3.7.3-2+deb10u2) ...
Selecting previously unselected package python3-dev.
Preparing to unpack .../11-python3-dev_3.7.3-1_armhf.deb ...
Unpacking python3-dev (3.7.3-1) ...
Selecting previously unselected package python3.7-venv.
Preparing to unpack .../12-python3.7-venv_3.7.3-2+deb10u2_armhf.deb ...
Unpacking python3.7-venv (3.7.3-2+deb10u2) ...
Selecting previously unselected package python3-venv.
Preparing to unpack .../13-python3-venv_3.7.3-1_armhf.deb ...
Unpacking python3-venv (3.7.3-1) ...
Setting up libssl1.1:armhf (1.1.1d-0+deb10u4+rpt1) ...
Setting up libffi-dev:armhf (3.2.1-9) ...
Setting up libexpat1-dev:armhf (2.2.6-2+deb10u1) ...
Setting up libssl-dev:armhf (1.1.1d-0+deb10u4+rpt1) ...
Setting up python-pip-whl (18.1-5+rpt1) ...
Setting up python3-lib2to3 (3.7.3-1) ...
Setting up python3-distutils (3.7.3-1) ...
Setting up dh-python (3.20190308) ...
Setting up libpython3.7-dev:armhf (3.7.3-2+deb10u2) ...
Setting up python3.7-venv (3.7.3-2+deb10u2) ...
Setting up python3.7-dev (3.7.3-2+deb10u2) ...
Setting up python3-venv (3.7.3-1) ...
Setting up libpython3-dev:armhf (3.7.3-1) ...
Setting up python3-dev (3.7.3-1) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-4+b1) ...
+ python3 -m venv venv
+ . venv/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /usr/bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/tmp/tmp.ldxWTRmNdb/venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
++ PATH=/tmp/tmp.ldxWTRmNdb/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' 'x(venv) ' '!=' x ']'
++ PS1='(venv) '
++ export PS1
++ '[' -n /usr/bin/bash -o -n '' ']'
++ hash -r
+ pip install wheel==0.34.2
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting wheel==0.34.2
  Downloading https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.34.2
+ pip install ansible==2.9.10
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting ansible==2.9.10
  Downloading https://www.piwheels.org/simple/ansible/ansible-2.9.10-py3-none-any.whl (16.2MB)
    100% |████████████████████████████████| 16.2MB 27kB/s
Collecting PyYAML (from ansible==2.9.10)
  Downloading https://www.piwheels.org/simple/pyyaml/PyYAML-5.3.1-cp37-cp37m-linux_armv7l.whl (44kB)
    100% |████████████████████████████████| 51kB 521kB/s
Collecting jinja2 (from ansible==2.9.10)
  Downloading https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl (125kB)
    100% |████████████████████████████████| 133kB 1.1MB/s
Collecting cryptography (from ansible==2.9.10)
  Downloading https://www.piwheels.org/simple/cryptography/cryptography-3.3-cp37-cp37m-linux_armv7l.whl (781kB)
    100% |████████████████████████████████| 788kB 394kB/s
Collecting MarkupSafe>=0.23 (from jinja2->ansible==2.9.10)
  Downloading https://www.piwheels.org/simple/markupsafe/MarkupSafe-1.1.1-cp37-cp37m-linux_armv7l.whl
Collecting cffi>=1.12 (from cryptography->ansible==2.9.10)
  Downloading https://www.piwheels.org/simple/cffi/cffi-1.14.4-cp37-cp37m-linux_armv7l.whl (346kB)
    100% |████████████████████████████████| 348kB 891kB/s
Collecting six>=1.4.1 (from cryptography->ansible==2.9.10)
  Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.12->cryptography->ansible==2.9.10)
  Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)
    100% |████████████████████████████████| 112kB 1.7MB/s
Installing collected packages: PyYAML, MarkupSafe, jinja2, pycparser, cffi, six, cryptography, ansible
Successfully installed MarkupSafe-1.1.1 PyYAML-5.3.1 ansible-2.9.10 cffi-1.14.4 cryptography-3.3 jinja2-2.11.2 pycparser-2.20 six-1.15.0
+ echo '[defaults]
roles_path = /tmp/tmp.ldxWTRmNdb
interpreter_python = /usr/bin/python3
'
+ ansible-galaxy install mtlynch.tinypilot
- downloading role 'tinypilot', owned by mtlynch
- downloading role from https://github.com/mtlynch/ansible-role-tinypilot/archive/master.tar.gz
- extracting mtlynch.tinypilot to /tmp/tmp.ldxWTRmNdb/mtlynch.tinypilot
- mtlynch.tinypilot (master) was installed successfully
- adding dependency: mtlynch.ustreamer
- adding dependency: geerlingguy.nginx
- downloading role 'ustreamer', owned by mtlynch
- downloading role from https://github.com/mtlynch/ansible-role-ustreamer/archive/master.tar.gz
- extracting mtlynch.ustreamer to /tmp/tmp.ldxWTRmNdb/mtlynch.ustreamer
- mtlynch.ustreamer (master) was installed successfully
- downloading role 'nginx', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-nginx/archive/2.8.0.tar.gz
- extracting geerlingguy.nginx to /tmp/tmp.ldxWTRmNdb/geerlingguy.nginx
- geerlingguy.nginx (2.8.0) was installed successfully
+ echo '- hosts: localhost
  connection: local
  become: true
  become_method: sudo
  roles:
    - role: mtlynch.tinypilot'
+ ansible-playbook -i localhost, install.yml --extra-vars ' ustreamer_encoder=hw ustreamer_format=jpeg ustreamer_resolution=1920x1080 ustreamer_persistent=true ustreamer_desired_fps=30'

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [mtlynch.ustreamer : create ustreamer group] ******************************
changed: [localhost]

TASK [mtlynch.ustreamer : create ustreamer user] *******************************
changed: [localhost]

TASK [mtlynch.ustreamer : check for a boot config file] ************************
ok: [localhost]

TASK [mtlynch.ustreamer : save whether boot config file exists] ****************
ok: [localhost]

TASK [mtlynch.ustreamer : check whether this machine was previously provisioned] ***
ok: [localhost]

TASK [mtlynch.ustreamer : read configuration from previous provisioning] *******
skipping: [localhost]

TASK [mtlynch.ustreamer : decode provisioning config] **************************
skipping: [localhost]

TASK [mtlynch.ustreamer : read ustreamer_capture_device from config file if it's not already defined] ***
skipping: [localhost]

TASK [mtlynch.ustreamer : enable TC358743 overlay in /boot/config.txt] *********
skipping: [localhost]

TASK [mtlynch.ustreamer : set GPU memory to 256MB in /boot/config.txt] *********
skipping: [localhost]

TASK [mtlynch.ustreamer : check for a boot cmdline file] ***********************
skipping: [localhost]

TASK [mtlynch.ustreamer : read /boot/cmdline.txt] ******************************
skipping: [localhost]

TASK [mtlynch.ustreamer : decode command-line string] **************************
skipping: [localhost]

TASK [mtlynch.ustreamer : change cma to 128M if it's set to a different value] ***
skipping: [localhost]

TASK [mtlynch.ustreamer : add cma=128M to cmdline.txt if it's missing] *********
skipping: [localhost]

TASK [mtlynch.ustreamer : create EDIDs folder] *********************************
skipping: [localhost]

TASK [mtlynch.ustreamer : copy TC358743 EDID file] *****************************
skipping: [localhost]

TASK [mtlynch.ustreamer : install TC358743 initializer service] ****************
skipping: [localhost]

TASK [mtlynch.ustreamer : use custom settings for TC358743 chip for any facts not already defined] ***
skipping: [localhost]

TASK [mtlynch.ustreamer : remove TC358743 initializer service file] ************
ok: [localhost]

TASK [mtlynch.ustreamer : disable TC358743 overlay in /boot/config.txt] ********
ok: [localhost]

TASK [mtlynch.ustreamer : enable OpenMax IL acceleration on Pi OS] *************
ok: [localhost]

TASK [mtlynch.ustreamer : collect universal required apt packages] *************
ok: [localhost]

TASK [mtlynch.ustreamer : collect Raspberry Pi OS specific required apt packages] ***
ok: [localhost]

TASK [mtlynch.ustreamer : install libraspberrypi-dev if we're using OpenMax IL acceleration] ***
skipping: [localhost]

TASK [mtlynch.ustreamer : collect Debian-specific required apt packages] *******
skipping: [localhost]

TASK [mtlynch.ustreamer : collect Ubuntu-specific required apt packages] *******
skipping: [localhost]

TASK [mtlynch.ustreamer : install uStreamer pre-requisite packages] ************
changed: [localhost]

TASK [mtlynch.ustreamer : create uStreamer folder] *****************************
changed: [localhost]

TASK [mtlynch.ustreamer : get uStreamer repo] **********************************
changed: [localhost]

TASK [mtlynch.ustreamer : cache build settings] ********************************
changed: [localhost]

TASK [mtlynch.ustreamer : clean repository if needed] **************************
changed: [localhost]

TASK [mtlynch.ustreamer : build uStreamer] *************************************
changed: [localhost]

TASK [mtlynch.ustreamer : fix uStreamer folder permissions] ********************
ok: [localhost]

TASK [mtlynch.ustreamer : install uStreamer as a service] **********************
changed: [localhost]

TASK [mtlynch.ustreamer : enable systemd uStreamer service file] ***************
changed: [localhost]

TASK [mtlynch.ustreamer : save provisioning configuration] *********************
changed: [localhost]

TASK [geerlingguy.nginx : Include OS-specific variables.] **********************
ok: [localhost]

TASK [geerlingguy.nginx : Define nginx_user.] **********************************
ok: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
included: /tmp/tmp.ldxWTRmNdb/geerlingguy.nginx/tasks/setup-Debian.yml for localhost

TASK [geerlingguy.nginx : Update apt cache.] ***********************************
ok: [localhost]

TASK [geerlingguy.nginx : Ensure nginx is installed.] **************************
changed: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : Remove default nginx vhost config file (if configured).] ***
changed: [localhost]

TASK [geerlingguy.nginx : Ensure nginx_vhost_path exists.] *********************
ok: [localhost]

TASK [geerlingguy.nginx : Add managed vhost config files.] *********************
changed: [localhost] => (item={'listen': '80 default_server', 'server_name': 'tinypilot', 'root': '/opt/tinypilot', 'index': 'index.html', 'extra_parameters': 'proxy_buffers 16 16k;\nproxy_buffer_size 16k;\nproxy_set_header Host $host;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_http_version 1.1;\n\nlocation /socket.io {\n  proxy_pass http://tinypilot;\n  proxy_set_header Upgrade $http_upgrade;\n  proxy_set_header Connection "Upgrade";\n}\nlocation /state {\n  proxy_pass http://ustreamer;\n}\nlocation /stream {\n  proxy_pass http://ustreamer;\n}\nlocation /snapshot {\n  proxy_pass http://ustreamer;\n}\nlocation / {\n  proxy_pass http://tinypilot;\n}\nlocation ~* ^/.+\\.(html|js|js.map|css)$ {\n  root "/opt/tinypilot/app/static";\n\n  # Disable caching\n  add_header Last-Modified $date_gmt;\n  add_header Cache-Control \'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0\';\n  if_modified_since off;\n  expires off;\n  etag off;\n}\nlocation ~* ^/.+\\.(jpg|jpeg|png|ico)$ {\n  root "/opt/tinypilot/app/static";\n}\n'})

TASK [geerlingguy.nginx : Remove managed vhost config files.] ******************
skipping: [localhost] => (item={'listen': '80 default_server', 'server_name': 'tinypilot', 'root': '/opt/tinypilot', 'index': 'index.html', 'extra_parameters': 'proxy_buffers 16 16k;\nproxy_buffer_size 16k;\nproxy_set_header Host $host;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_http_version 1.1;\n\nlocation /socket.io {\n  proxy_pass http://tinypilot;\n  proxy_set_header Upgrade $http_upgrade;\n  proxy_set_header Connection "Upgrade";\n}\nlocation /state {\n  proxy_pass http://ustreamer;\n}\nlocation /stream {\n  proxy_pass http://ustreamer;\n}\nlocation /snapshot {\n  proxy_pass http://ustreamer;\n}\nlocation / {\n  proxy_pass http://tinypilot;\n}\nlocation ~* ^/.+\\.(html|js|js.map|css)$ {\n  root "/opt/tinypilot/app/static";\n\n  # Disable caching\n  add_header Last-Modified $date_gmt;\n  add_header Cache-Control \'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0\';\n  if_modified_since off;\n  expires off;\n  etag off;\n}\nlocation ~* ^/.+\\.(jpg|jpeg|png|ico)$ {\n  root "/opt/tinypilot/app/static";\n}\n'})

TASK [geerlingguy.nginx : Remove legacy vhosts.conf file.] *********************
ok: [localhost]

TASK [geerlingguy.nginx : Copy nginx configuration in place.] ******************
changed: [localhost]

TASK [geerlingguy.nginx : Ensure nginx service is running as configured.] ******
ok: [localhost]

TASK [mtlynch.tinypilot : check for a boot config file] ************************
ok: [localhost]

TASK [mtlynch.tinypilot : enable dwc2 driver in boot config] *******************
changed: [localhost]

TASK [mtlynch.tinypilot : enable dwc2 driver in modules] ***********************
changed: [localhost]

TASK [mtlynch.tinypilot : install usb-gadget initializer as a service] *********
changed: [localhost]

TASK [mtlynch.tinypilot : enable systemd usb-gadget initializer service file] ***
changed: [localhost]

TASK [mtlynch.tinypilot : install TinyPilot pre-requisite packages] ************
changed: [localhost]

TASK [mtlynch.tinypilot : create tinypilot group] ******************************
changed: [localhost]

TASK [mtlynch.tinypilot : create tinypilot user] *******************************
changed: [localhost]

TASK [mtlynch.tinypilot : enable passwordless sudo for shutdown command] *******
changed: [localhost]

TASK [mtlynch.tinypilot : create TinyPilot folder] *****************************
changed: [localhost]

TASK [mtlynch.tinypilot : get TinyPilot repo] **********************************
changed: [localhost]

TASK [mtlynch.tinypilot : find absolute path to python3] ***********************
ok: [localhost]

TASK [mtlynch.tinypilot : save absolute path to python3] ***********************
ok: [localhost]

TASK [mtlynch.tinypilot : create TinyPilot virtualenv] *************************
changed: [localhost]

TASK [mtlynch.tinypilot : fix TinyPilot folder permissions] ********************
ok: [localhost]

TASK [mtlynch.tinypilot : install TinyPilot as a service] **********************
changed: [localhost]

TASK [mtlynch.tinypilot : enable systemd TinyPilot service file] ***************
changed: [localhost]

RUNNING HANDLER [mtlynch.ustreamer : reload systemd config] ********************
ok: [localhost]

RUNNING HANDLER [mtlynch.ustreamer : restart uStreamer] ************************
changed: [localhost]

RUNNING HANDLER [geerlingguy.nginx : restart nginx] ****************************
changed: [localhost]

RUNNING HANDLER [geerlingguy.nginx : reload nginx] *****************************
changed: [localhost]

RUNNING HANDLER [mtlynch.tinypilot : reload TinyPilot systemd config] **********
ok: [localhost]

RUNNING HANDLER [mtlynch.tinypilot : restart TinyPilot service] ****************
changed: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=55   changed=32   unreachable=0    failed=0    skipped=23   rescued=0    ignored=0

pi@pikvm:~ $ sudo reboot
mtlynch commented 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?

majes-git commented 3 years ago

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)
majes-git commented 3 years ago

I have also tried Firefox and Safari, as well as another laptop. Same behavior.

majes-git commented 3 years ago

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"
majes-git commented 3 years ago

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:

  1. The tinypilot journal is being flooded by messages as such:
    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
  2. The latency of the screen/HDMI is way too high - it is several seconds (2secs up to 10secs). Based on your post it should be around 200ms. I think I have the same model of the video capture device (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?

majes-git commented 3 years ago

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?

mtlynch commented 3 years ago

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?

majes-git commented 3 years ago

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.