todbot / hidpytoy

A GUI app for playing with HID devices, written in Python
GNU General Public License v3.0
70 stars 10 forks source link

Why on earth is report size limited to 128? #3

Closed rom4ster closed 3 years ago

rom4ster commented 3 years ago

I need to send a 154 bit report to my mouse. The thingamabob wont let me go past 128 on the UI. FEEEX plz

todbot commented 3 years ago

The source is all here, you can change it too!

rom4ster commented 3 years ago

yeah but building from source is a PAIN, and I would have to search through to find the right class. You probably could do this much quicker.

mcuee commented 3 years ago

Building is actually not difficult.

(py36venv) C:\work\hid\hidpytoy [master ≡]> pip install -r requirements.txt
Collecting fbs
  Downloading fbs-0.9.9.tar.gz (207 kB)
     |████████████████████████████████| 207 kB 939 kB/s
Collecting PyQt5==5.9.2
  Downloading PyQt5-5.9.2-5.9.3-cp35.cp36.cp37-none-win_amd64.whl (77.4 MB)
     |████████████████████████████████| 77.4 MB 58 kB/s
Collecting hidapi
  Downloading hidapi-0.10.1-cp36-cp36m-win_amd64.whl (42 kB)
     |████████████████████████████████| 42 kB 447 kB/s
Collecting sip<4.20,>=4.19.4
  Downloading sip-4.19.8-cp36-none-win_amd64.whl (51 kB)
     |████████████████████████████████| 51 kB 1.1 MB/s
Collecting PyInstaller==3.4
  Downloading PyInstaller-3.4.tar.gz (3.5 MB)
     |████████████████████████████████| 3.5 MB 1.1 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting macholib>=1.8
  Downloading macholib-1.15-py2.py3-none-any.whl (37 kB)
Collecting altgraph
  Downloading altgraph-0.17-py2.py3-none-any.whl (21 kB)
Collecting pywin32-ctypes
  Downloading pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)
Requirement already satisfied: setuptools in c:\work\python\py36venv\lib\site-packages (from PyInstaller==3.4->fbs->-r requirements.txt (line 1)) (40.6.2)
Collecting pefile>=2017.8.1
  Using cached pefile-2021.5.24.tar.gz (66 kB)
Collecting future
  Using cached future-0.18.2.tar.gz (829 kB)
Building wheels for collected packages: fbs, PyInstaller, pefile, future
  Building wheel for fbs (setup.py) ... done
  Created wheel for fbs: filename=fbs-0.9.9-py3-none-any.whl size=235762 sha256=6b99f24559696102ddb592669fd881b04b3dbcb451faa5f70e66a5e651e120c0
  Stored in directory: c:\users\xfchen\appdata\local\pip\cache\wheels\01\ed\e2\1ffa7bcd64dfde856b0415937db80c5b3164044b4ac2a38616
  Building wheel for PyInstaller (PEP 517) ... done
  Created wheel for PyInstaller: filename=PyInstaller-3.4-py2.py3-none-any.whl size=2853159 sha256=15e6d1de9c67070602561fd392e7f0241b018b87a852132b4575a9efca0308b2
  Stored in directory: c:\users\xfchen\appdata\local\pip\cache\wheels\3e\69\2d\cb9cc43384029e262ac4bdbb93f53a7364ae6079a85af95878
  Building wheel for pefile (setup.py) ... done
  Created wheel for pefile: filename=pefile-2021.5.24-py3-none-any.whl size=62577 sha256=8e8cc9d5f40103ecbaa282049a970e2b28393576e7590ca4adb5b89a223d15c1
  Stored in directory: c:\users\xfchen\appdata\local\pip\cache\wheels\01\0c\0a\3e6db548b4adb2a3cbd4888d0aa233ad146965a335a98574ea
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491058 sha256=6a6585f15371f3354e79b974dac4f76198db14228900a48f851e3f16b80ba129
  Stored in directory: c:\users\xfchen\appdata\local\pip\cache\wheels\6e\9c\ed\4499c9865ac1002697793e0ae05ba6be33553d098f3347fb94
Successfully built fbs PyInstaller pefile future
Installing collected packages: future, altgraph, pywin32-ctypes, pefile, macholib, sip, PyInstaller, PyQt5, hidapi, fbs
Successfully installed PyInstaller-3.4 PyQt5-5.9.2 altgraph-0.17 fbs-0.9.9 future-0.18.2 hidapi-0.10.1 macholib-1.15 pefile-2021.5.24 pywin32-ctypes-0.2.0 sip-4.19.8

(py36venv) C:\work\hid\hidpytoy [master ≡]> fbs freeze
Done. You can now run `target\HIDPyToy\HIDPyToy.exe`. If that doesn't
work, see https://build-system.fman.io/troubleshooting.
mcuee commented 3 years ago

In case someone wants the Windows binary, here it is. https://github.com/mcuee/hidpytoy/releases/tag/snapshot_afe21d5

HIDPyToy.zip: Windows binary with Python 3.6 64bit HIDPyToy_mod.zip: Windows binary with Python 3.6 64bit, with the following patch to support larger report size of up to 1024 bytes.

rom4ster commented 3 years ago

thanks

mcuee commented 3 years ago

For those who want to build under macOS, take note you may need to install python 3.6 x64 version from python.org. fbs free version only supports Python 3.5/3.6.

Here is the run log under my Mac Mini M1 (macOS Big Sur ARM64).

hidpytoy on  master via 🐍 v3.6.8 (py36venv_x64) ❯ pip install -r requirements.txt 
Requirement already satisfied: fbs in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (0.9.9)
Requirement already satisfied: PyQt5==5.9.2 in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (5.9.2)
Requirement already satisfied: hidapi in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (0.10.1)
Requirement already satisfied: PyInstaller==3.4 in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from fbs->-r requirements.txt (line 1)) (3.4)
Requirement already satisfied: sip<4.20,>=4.19.4 in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from PyQt5==5.9.2->-r requirements.txt (line 2)) (4.19.8)
Requirement already satisfied: setuptools>=19.0 in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from hidapi->-r requirements.txt (line 3)) (40.6.2)
Requirement already satisfied: pefile>=2017.8.1 in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from PyInstaller==3.4->fbs->-r requirements.txt (line 1)) (2021.5.24)
Requirement already satisfied: macholib>=1.8 in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from PyInstaller==3.4->fbs->-r requirements.txt (line 1)) (1.15)
Requirement already satisfied: altgraph in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from PyInstaller==3.4->fbs->-r requirements.txt (line 1)) (0.17)
Requirement already satisfied: future in /Users/mcuee/build/python/py36venv_x64/lib/python3.6/site-packages (from pefile>=2017.8.1->PyInstaller==3.4->fbs->-r requirements.txt (line 1)) (0.18.2)

hidpytoy on  master via 🐍 v3.6.8 (py36venv_x64) ❯ fbs freeze
<CDLL 'libSystem.dylib', handle 2050118e0 at 0x7f9db8e78630>
Done. You can now run `target/HIDPyToy.app/Contents/MacOS/HIDPyToy`.
If that doesn't work, see https://build-
system.fman.io/troubleshooting.
mcuee commented 3 years ago

macOS binary added here. https://github.com/mcuee/hidpytoy/releases/tag/snapshot_afe21d5