Webboard on Worldsen / VMThai.com

คอมพิวเตอร์ => เรื่องทั่วไปของคอมพิวเตอร์ => ข้อความที่เริ่มโดย: cluangar ที่ สิงหาคม 31, 2022, 01:09:32 PM



หัวข้อ: ใช้งาน Bluetooth Mouse บน MultiBoot OS
เริ่มหัวข้อโดย: cluangar ที่ สิงหาคม 31, 2022, 01:09:32 PM
หลังจากต้องใช้งาน Ubuntu และ Win11 สลับไปมา  ทำให้ต้องการใช้งาน Bluetooth Mouse ได้ทั้ง 2 OS  จึงเป็นที่มาของ Trick นี้  อ้างอิง https://unix.stackexchange.com/questions/255509/bluetooth-pairing-on-dual-boot-of-windows-linux-mint-ubuntu-stop-having-to-p (https://unix.stackexchange.com/questions/255509/bluetooth-pairing-on-dual-boot-of-windows-linux-mint-ubuntu-stop-having-to-p)



หัวข้อ: Re: ใช้งาน Bluetooth Mouse บน MultiBoot OS
เริ่มหัวข้อโดย: cluangar ที่ สิงหาคม 31, 2022, 01:11:44 PM
1. ทำการ Pair Bluetooth Device ที่ต้องการเข้ากับ Ubuntu เสียก่อนเพื่อให้ Ubuntu สร้าง parameter information ต่างๆบน Ubuntu โดยจะอยู่ที่ /var/lib/bluetooth/<bluetooth donble>/<bluetooth device>  ซึ่ง file สำคัญที่จะนำมาแก้ไขคือ info


หัวข้อ: Re: ใช้งาน Bluetooth Mouse บน MultiBoot OS
เริ่มหัวข้อโดย: cluangar ที่ สิงหาคม 31, 2022, 01:14:38 PM
2. Reboot เครื่อง  เพื่อเข้า windows แล้ว Pair อุปกรณ์บน Windows อีกครั้ง
3. จะทำการ export key ต่างๆของอุปกรณ์จาก regedit ของ windows  แต่ ค่าเหล่านี้ต้อง export ผ่าน system account เท่านั้น  ฉะนั้นจำเป็นต้องต้องใช้ tools ช่วยอย่าง pstools
4. จากนั้น  เปิด command prompt ด้วยสิทธิ administrator  แล้ว run คำสั่ง PsExec64.exe -s -i regedit /E d:\btkeys_export.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys"


หัวข้อ: Re: ใช้งาน Bluetooth Mouse บน MultiBoot OS
เริ่มหัวข้อโดย: cluangar ที่ สิงหาคม 31, 2022, 01:21:40 PM
5. จากนั้นใช้ tools ช่วย  python script ที่จะแปลงค่า parameter key ที่จะนำไปใช้ใน ubuntu  https://github.com/gawells/dual-boot-bluetooth-pair (https://github.com/gawells/dual-boot-bluetooth-pair)
6. จากนั้น run python3 clean_reg_file.py --file_path btkeys_export.txt --output clean.reg  (ล้าง " ก่อนใช้ script อีกตัวเพื่อแปลงค่า key ที่จำเป็นต้องนำไปใช้)
7. จากนั้น run python3 bluetooth_fix.py --reg_path clean.reg  เราจะได้ key ที่จำเป็นต่างๆ  ต้องนำค่าเหล่านี้ไปแก้ไขใน info


หัวข้อ: Re: ใช้งาน Bluetooth Mouse บน MultiBoot OS
เริ่มหัวข้อโดย: cluangar ที่ สิงหาคม 31, 2022, 01:25:46 PM
8. กลับมาที่ ubuntu จากนั้น copy ค่า bluetooth device เก่า  มาเป็นต้นแบบรอการแก้ไข  โดยใช้คำสั่ง sudo cp -R /var/lib/bluetooth/<bluetooth dongle>/<old bluetooth device> /var/lib/bluetooth/<bluetooth dongle>/<new bluetooth device>
  โดย new bluetooth device นี้  คือค่าที่ได้จากการ run bluetooth_fix.py


หัวข้อ: Re: ใช้งาน Bluetooth Mouse บน MultiBoot OS
เริ่มหัวข้อโดย: cluangar ที่ สิงหาคม 31, 2022, 01:28:09 PM
9. จากนั้น run sudo nano /var/lib/bluetooth/<bluetooth dongle>/<new bluetooth device>/info
10. แก้ไขค่า parameter key ต่างๆให้ตรงกับที่ได้จาก bluetooth_fix.py
11. run sudo systemctl restart bluetooth

  ถ้าไม่มีอะไรผิดพลาดจะสามารถใช้งาน bluetooth device ได้