After reboot of the tinypilot device (purchased with pre-programmed sd card) due to power loss nginx reports error 502.
tinypilot service is active but reports import failure:
root@tinypilot:/home/pilot# systemctl status tinypilot
● tinypilot.service - TinyPilot - RPi-based virtual KVM
Loaded: loaded (/lib/systemd/system/tinypilot.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-10-28 07:59:10 BST; 919ms ago
Main PID: 1006 (python)
Tasks: 1 (limit: 4915)
└─1006 /opt/tinypilot/venv/bin/python app/main.py
Oct 28 07:59:10 tinypilot systemd: Started TinyPilot - RPi-based virtual KVM.
Oct 28 07:59:11 tinypilot python: Traceback (most recent call last):
Oct 28 07:59:11 tinypilot python: File "app/main.py", line 18, in
Oct 28 07:59:11 tinypilot python: import public_api
Oct 28 07:59:11 tinypilot python: File "/opt/tinypilot/app/public_api.py", line 13, in
Oct 28 07:59:11 tinypilot python: import js_to_hid
Oct 28 07:59:11 tinypilot python: File "/opt/tinypilot/app/js_to_hid.py", line 1, in
Oct 28 07:59:11 tinypilot python: from hid import keycodes as hid
Oct 28 07:59:11 tinypilot python: ImportError: cannot import name 'keycodes' from 'hid' (/opt/tinypilot/app/hid/init.py)
root@tinypilot:/home/pilot# ls /opt/tinypilot/app/hid/
init.py pycache keyboard.py keyboard_test.py mouse.py mouse_test.py write.py write_test.py
the "hid" module's directory is missing keykodes.py file (compared to content of this directory on github).
I will re-crelate the keycodes file but just wat to leave a trace here in case someone faces similar problem.
- 2 replies
- ZZbigniew Zasieczny @zasiecznyz
Once the keycodes.py was created in /opt/tinypilot/app/hid/ using github source (https://raw.githubusercontent.com/tiny-pilot/tinypilot/master/app/hid/keycodes.py) the tinypilot service started without problems and everything works ok.ReplySolution
- CCharles Hague @cghague2022-10-28 14:04:29.862Z
Hi Zbigniew - thanks for sharing your solution with us!
I'm pleased to hear that this is now resolved. It sounds like this was a one-off issue caused by a power outage, but if you'd like to reduce the likelihood of filesystem corruption in future you can do so by enabling the read-only filesystem on your TinyPilot device.
I hope this is helpful. Please let me know if you have any questions!