Browse Source

try and fix device descriptor

main
Hendrik Langer 6 years ago
parent
commit
f092619516
  1. 2
      README.md
  2. 8
      raspberry-environment/display.py

2
README.md

@ -59,7 +59,7 @@ add/change in /boot/cmdline.txt: console=tty3 consoleblank=0 loglevel=3 vt.globa
copy everything to /opt/freezer/
chmod a+x /opt/freezer/display.py
add to /etc/rc.local: cd /tmp && nohup python3 /opt/freezer/display.py &
add to /etc/rc.local: cd /tmp && nohup python3 /opt/freezer/display.py 2>&1 &
### read-only root
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/read-only-fs.sh

8
raspberry-environment/display.py

@ -121,8 +121,8 @@ def os_echo(filename, string):
def send_keypress():
with open('/dev/hidg0', 'w') as f:
f.write("\x00\x00\x04\x00\x00\x00\x00\x00") #press the A-button
f.write("\x00\x00\x00\x00\x00\x00\x00\x00") #release all keys
f.write(bytearray(b'\x00\x00\x04\x00\x00\x00\x00\x00')) #press the A-button
f.write(bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')) #release all keys
if __name__ == '__main__':
@ -186,12 +186,12 @@ if __name__ == '__main__':
os_echo(g+"functions/hid.usb0/protocol", "1")
os_echo(g+"functions/hid.usb0/subclass", "1")
os_echo(g+"functions/hid.usb0/report_length", "8")
os_echo(g+"functions/hid.usb0/report_desc", "\x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0")
os_echo(g+"functions/hid.usb0/report_desc", bytearray(b'\x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0').encode())
subprocess.run(['ln', '-s', g+"functions/hid.usb0", g+"configs/c.1"], shell=False, check=True)
# subprocess.run(['ln', '-s', g+"configs/c.1", g+"os_desc"], shell=False, check=True)
subprocess.run(['ls /sys/class/udc/ > '+g+'UDC'], shell=True, check=True)
subprocess.run('ls /sys/class/udc/ > '+g+'UDC', shell=True, check=True)
# RNDIS OS descriptors
#os_echo(g+"os_desc/use", "1")

Loading…
Cancel
Save