mirror of
				https://github.com/dekuNukem/USB4VC.git
				synced 2025-10-24 11:20:50 -07:00 
			
		
		
		
	porting to Raspberry Pi 5
This commit is contained in:
		| @@ -31,8 +31,17 @@ sudo dfu-util --device ,0483:df11 -a 0 -D ~/usb4vc/firmware/PBFW_ADB_PBID2_V0_1_ | ||||
|  | ||||
| ----- | ||||
| sudo apt install evtest | ||||
|  | ||||
| sudo apt remove python3-rpi.gpio | ||||
| sudo pip3 install --break-system-packages rpi-lgpio | ||||
|  | ||||
| cd ~ | ||||
| git clone https://github.com/atar-axis/xpadneo.git | ||||
| -------------- | ||||
|  | ||||
| sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old | ||||
| ----- | ||||
|  | ||||
| Luma OLED driver | ||||
|  | ||||
| https://luma-oled.readthedocs.io/en/latest/software.html | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  | ||||
| # sh sync.sh; ssh -t pi@192.168.1.62 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_main.py" | ||||
|  | ||||
| scp ./* pi@192.168.1.62:~/usb4vc/rpi_app | ||||
| scp ./* pi@192.168.1.98:~/usb4vc/rpi_app | ||||
| # ssh -t pi@192.168.1.60 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_main.py" | ||||
| # ssh -t pi@192.168.1.60 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_check_update.py" | ||||
|  | ||||
|   | ||||
| @@ -58,12 +58,13 @@ def check_rpi_model(): | ||||
|  | ||||
| check_rpi_model() | ||||
|  | ||||
| cmdline_path = "/boot/firmware/cmdline.txt" | ||||
| try: | ||||
|     boot_config = os.popen('cat /boot/cmdline.txt').read() | ||||
|     boot_config = os.popen(f'cat {cmdline_path}').read() | ||||
|     if "usbhid.mousepoll".lower() not in boot_config.lower(): | ||||
|         print("@@@@@@@@@@@@ writing usbhid.mousepoll to /boot/cmdline.txt @@@@@@@@@@@@") | ||||
|         print(f"@@@@@@@@@@@@ writing usbhid.mousepoll to {cmdline_path} @@@@@@@@@@@@") | ||||
|         new_config = boot_config.replace('\r', '').replace('\n', '').strip() + ' usbhid.mousepoll=0\n' | ||||
|         with open('/boot/cmdline.txt', 'w') as ffff: | ||||
|         with open(cmdline_path, 'w') as ffff: | ||||
|             ffff.write(new_config) | ||||
| except Exception as e: | ||||
|     print('usbhid.mousepoll exception:', e) | ||||
| @@ -80,9 +81,9 @@ while 1: | ||||
|         try: | ||||
|             ertm_status = subprocess.getoutput("cat /sys/module/bluetooth/parameters/disable_ertm").replace('\n', '').replace('\r', '').strip() | ||||
|             if ertm_status != 'Y': | ||||
|                 print('ertm_status:', ertm_status) | ||||
|                 print("Disabling ERTM....") | ||||
|                 # print('ertm_status:', ertm_status) | ||||
|                 # print("Disabling ERTM....") | ||||
|                 subprocess.call('echo 1 > /sys/module/bluetooth/parameters/disable_ertm') | ||||
|                 print("DONE") | ||||
|                 # print("DONE") | ||||
|         except Exception: | ||||
|             continue | ||||
|   | ||||
		Reference in New Issue
	
	Block a user