From 2adf1adf7003dd8f06e88712c0c14c40c1ce825b Mon Sep 17 00:00:00 2001 From: dekuNukem Date: Mon, 18 Aug 2025 17:55:03 +0100 Subject: [PATCH] updated setup instructions, dont compile xpadneo on RPi5 --- user_program/notes_2025.txt | 12 ++++++++++++ user_program/setup.txt | 22 +++++++++++++++++----- user_program/usb4vc_main.py | 15 +++++++++++++-- 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 user_program/notes_2025.txt diff --git a/user_program/notes_2025.txt b/user_program/notes_2025.txt new file mode 100644 index 0000000..0d18ebe --- /dev/null +++ b/user_program/notes_2025.txt @@ -0,0 +1,12 @@ +USB4VC 2025 notes +Raspberry Pi 5 + +changelog + +whats new + +rpi5 support (no bt, 64bit kernel etc) +newest system version +web based dashboard + +todo: diff --git a/user_program/setup.txt b/user_program/setup.txt index f3338ce..ee6d2ed 100644 --- a/user_program/setup.txt +++ b/user_program/setup.txt @@ -17,13 +17,20 @@ set up ssh: ssh-keygen copy PC pub key to rpi ~/.ssh/authorized_keys +------------ + +IMPORTANT !!!!!!!!!!!!!!!!!! + +sudo apt update +sudo apt upgrade + ------------- # use sudo -E to preserve environmental variables for python3 +sudo apt-get update sudo apt-get install i2c-tools sudo apt install stm32flash -/usr/local/bin/stm32flash -r hhh -a 0x3b /dev/i2c-1 stm32flash -r PBFW_IBMPC_PBID1_V0_2_0.dfu -a 0x3b /dev/i2c-1 sudo apt install dfu-util @@ -31,13 +38,19 @@ sudo dfu-util --device ,0483:df11 -a 0 -D ~/usb4vc/firmware/PBFW_ADB_PBID2_V0_1_ ----- sudo apt install evtest +pip3 install evdev + + +sudo apt install python3-pip raspberry pi 5 uses a different GPIO chip, this is a compatibility package + +// no need sudo apt remove python3-rpi.gpio +// no need? sudo pip3 install --break-system-packages rpi-lgpio -cd ~ -git clone https://github.com/atar-axis/xpadneo.git +cd ~;git clone https://github.com/atar-axis/xpadneo.git sudo apt-get install dkms raspberrypi-kernel-headers https://github.com/atar-axis/xpadneo @@ -50,7 +63,7 @@ Luma OLED driver https://luma-oled.readthedocs.io/en/latest/software.html sudo apt-get update -sudo apt-get install python3 python3-pip python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5 -y +sudo apt-get install python3 python3-pip python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 -y sudo -H pip3 install luma.oled ------------------- @@ -69,7 +82,6 @@ https://raspberrypi-guide.github.io/programming/run-script-on-boot sudo su -pip3 install evdev sudo nano /etc/rc.local diff --git a/user_program/usb4vc_main.py b/user_program/usb4vc_main.py index e586878..d09edd7 100644 --- a/user_program/usb4vc_main.py +++ b/user_program/usb4vc_main.py @@ -40,7 +40,13 @@ def check_rpi_model(): stored_model = get_stored_rpi_model() print('current_model', current_model) print('stored_model', stored_model) - if current_model != stored_model: + + if "Raspberry Pi 5".lower() in current_model.lower(): + usb4vc_ui.oled_print_model_changed() + os.system("cd /home/pi/xpadneo/; sudo ./uninstall.sh") + save_rpi_model(current_model) + return + elif current_model != stored_model: usb4vc_ui.oled_print_model_changed() for x in range(20): print("!!!!!!!!!! DO NOT UNPLUG UNTIL I REBOOT !!!!!!!!!!") @@ -63,7 +69,12 @@ try: boot_config = os.popen(f'cat {cmdline_path}').read() if "usbhid.mousepoll".lower() not in boot_config.lower(): print(f"@@@@@@@@@@@@ writing usbhid.mousepoll to {cmdline_path} @@@@@@@@@@@@") - new_config = boot_config.replace('\r', '').replace('\n', '').strip() + ' usbhid.mousepoll=0\n' + new_config = boot_config.replace('\r', '').replace('\n', '').strip() + ' usbhid.mousepoll=4\n' + with open(cmdline_path, 'w') as ffff: + ffff.write(new_config) + elif "usbhid.mousepoll=0" in boot_config: + print(f"@@@@@@@@@@@@ writing usbhid.mousepoll to {cmdline_path} @@@@@@@@@@@@") + new_config = boot_config.replace('\r', '').replace('\n', '').strip().replace("usbhid.mousepoll=0", "usbhid.mousepoll=4") with open(cmdline_path, 'w') as ffff: ffff.write(new_config) except Exception as e: