quaxalber / bluetooth_2_usb

Convert a Raspberry Pi into a HID relay that translates Bluetooth keyboard and mouse input to USB. Minimal configuration. Zero hassle.
MIT License
21 stars 5 forks source link

[Bug] Fresh installation does not start #75

Closed ig-sinicyn closed 6 months ago

ig-sinicyn commented 6 months ago

RPI4: After updating (removing previous one, deleting the directory, git clone, install and reboot):

igors@hid-bridge:~ $ service bluetooth_2_usb status
× bluetooth_2_usb.service - Bluetooth to USB HID relay
     Loaded: loaded (/etc/systemd/system/bluetooth_2_usb.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-12-09 19:47:52 MSK; 1min 47s ago
   Duration: 517ms
    Process: 792 ExecStart=/usr/bin/bluetooth_2_usb --auto_discover (code=exited, status=1/FAILURE)
   Main PID: 792 (code=exited, status=1/FAILURE)
        CPU: 515ms

Dec 09 19:47:52 hid-bridge systemd[1]: bluetooth_2_usb.service: Scheduled restart job, restart counter is at 5.
Dec 09 19:47:52 hid-bridge systemd[1]: Stopped bluetooth_2_usb.service - Bluetooth to USB HID relay.
Dec 09 19:47:52 hid-bridge systemd[1]: bluetooth_2_usb.service: Start request repeated too quickly.
Dec 09 19:47:52 hid-bridge systemd[1]: bluetooth_2_usb.service: Failed with result 'exit-code'.
Dec 09 19:47:52 hid-bridge systemd[1]: Failed to start bluetooth_2_usb.service - Bluetooth to USB HID relay.
igors@hid-bridge:~ $

on manual run:

igors@hid-bridge:~ $ sudo bluetooth_2_usb -ad
Traceback (most recent call last):
  File "/usr/bin/bluetooth_2_usb", line 13, in <module>
    from usb_hid import unregister_disable
ImportError: cannot import name 'unregister_disable' from 'usb_hid' (/home/igors/bluetooth_2_usb/venv/lib/python3.11/site-packages/usb_hid.py)
ig-sinicyn commented 6 months ago

UPD: looks like something is seriously broken after update. Reverting the bt_hid to the prev version did not help either. Will have to try the clean install.

quaxalber commented 6 months ago

removing previous one, deleting the directory, git clone, install and reboot

Hey there, I just released a new version. Installed from scratch and it worked without issues. Would you please try the same?

ig-sinicyn commented 6 months ago

will wo in a hour or two. Thanks!

quaxalber commented 6 months ago

v0.6.6 features a new dependency resolution that should be more robust.

The update script as of 0.6.6 now performs a clean reinstallation. In order to upgrade to 0.6.6 you need to cleanly reinstall manually though:

cd && sudo bluetooth_2_usb/scripts/uninstall.sh && sudo rm -rf bluetooth_2_usb && git clone https://github.com/quaxalber/bluetooth_2_usb.git && sudo bluetooth_2_usb/scripts/install.sh
ig-sinicyn commented 6 months ago

@quaxalber

UPD: the issue below fixed with rebooting RPI 4 and rerunning this command

cd && sudo bluetooth_2_usb/scripts/uninstall.sh && sudo rm -rf bluetooth_2_usb && git clone https://github.com/quaxalber/bluetooth_2_usb.git && sudo bluetooth_2_usb/scripts/install.sh

All seems to work now!

-- end of UPD --

I've tried fresh installation and on this time installation fails with

Installing collected packages: pyserial, evdev, Adafruit-PlatformDetect, adafruit-circuitpython-typing, pyusb, Adafruit-PureIO, pyftdi, quax-Blinka, quax-circuitpython-hid
Successfully installed Adafruit-PlatformDetect-3.57.0 Adafruit-PureIO-1.1.11 adafruit-circuitpython-typing-1.2.0 evdev-1.6.1 pyftdi-0.55.0 pyserial-3.5 pyusb-1.2.1 quax-Blinka-8.26.0.post1 quax-circuitpython-hid-6.0.2
Modifying system files...
Created symlink /etc/systemd/system/multi-user.target.wants/bluetooth_2_usb.service → /home/igors/bluetooth_2_usb/bluetooth_2_usb.service.
Traceback (most recent call last):
  File "/home/igors/bluetooth_2_usb/bluetooth_2_usb.py", line 8, in <module>
    from usb_hid import disable
  File "/home/igors/bluetooth_2_usb/.venv/lib/python3.11/site-packages/usb_hid.py", line 22, in <module>
    raise Exception(  # pylint: disable=broad-exception-raised
Exception: dwc2 module not present in your kernel. did you insmod it?
Installation failed. The version information could not be retrieved.

Full log file: install.log

I've used RPi4 and this image as current one has headless installation issues

quaxalber commented 6 months ago

All seems to work now!

Great! :) Thx for the update. Closing this issue then.