From f3f7be1343f4fa5b51cb5030040ce212c58d0708 Mon Sep 17 00:00:00 2001 From: Matej Vysokai Date: Mon, 24 Apr 2023 11:34:19 +0000 Subject: [PATCH] Upload files to '' --- enable-usb-hid | 34 ++++++++++++++++++++++++++++++++++ requirements.txt | 16 ++++++++++++++++ spustenie.sh | 4 ++++ 3 files changed, 54 insertions(+) create mode 100644 enable-usb-hid create mode 100644 requirements.txt create mode 100644 spustenie.sh diff --git a/enable-usb-hid b/enable-usb-hid new file mode 100644 index 0000000..8191d6e --- /dev/null +++ b/enable-usb-hid @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Echo commands to stdout. +set -x + +# Exit on first error. +set -e + +# Treat undefined environment variables as errors. +set -u + +if ! grep 'dtoverlay=dwc2' /boot/config; then + echo "dtoverlay=dwc2" >> /boot/config.txt +fi + +if ! grep dwc2 /etc/modules; then + echo "dwc2" >> /etc/modules +fi + +ENABLE_RPI_HID_PATH=/opt/enable-rpi-hid +ENABLE_RPI_HID_DIR=$(dirname $ENABLE_RPI_HID_PATH) + +mkdir -p "$ENABLE_RPI_HID_DIR" +wget https://raw.githubusercontent.com/mtlynch/ansible-role-key-mime-pi/master/files/enable-rpi-hid \ + -O "$ENABLE_RPI_HID_PATH" +chmod +x "$ENABLE_RPI_HID_PATH" + +cd $(mktemp -d) +wget https://raw.githubusercontent.com/mtlynch/ansible-role-key-mime-pi/master/templates/usb-gadget.systemd.j2 +sed -e "s@{{ key_mime_pi_initialize_hid_script_path }}@${ENABLE_RPI_HID_PATH}@g" \ + usb-gadget.systemd.j2 > /lib/systemd/system/usb-gadget.service + +systemctl daemon-reload +systemctl enable usb-gadget.service \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..046b5b7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,16 @@ +eventlet==0.31.0 +Flask==1.1.1 +Flask-SocketIO==4.3.2 + +# Indirect dependencies +click==7.1.2 +dnspython==2.0.0 +greenlet==0.4.17 +itsdangerous==1.1.0 +Jinja2==2.11.3 +MarkupSafe==1.1.1 +monotonic==1.5 +python-engineio==3.14.2 +python-socketio==4.6.1 +six==1.15.0 +Werkzeug==1.0.1 diff --git a/spustenie.sh b/spustenie.sh new file mode 100644 index 0000000..0a4f177 --- /dev/null +++ b/spustenie.sh @@ -0,0 +1,4 @@ +#!/bin/bash +. venv/bin/activate +export PORT=8000 +./app/main.py