aboutsummaryrefslogtreecommitdiff
path: root/sys_ctrl
diff options
context:
space:
mode:
authorBrian Woods2023-02-06 19:50:14 -0500
committerBrian Woods2023-02-06 19:50:14 -0500
commitd332a99154945cfebadbf01b56f6033467e1c5ef (patch)
tree9c867d2e215e5b793d374959da8d694aa09ed80f /sys_ctrl
init push
Added: firejail - just scripts for firejail options l2w_snd - piping sound from linux to windows over the network misc_scripts - misc scripts.... proton_sieve - proton sieve file for mainbox sorting sys_ctrl - system control scripts
Diffstat (limited to 'sys_ctrl')
-rwxr-xr-xsys_ctrl/armtest-console6
-rwxr-xr-xsys_ctrl/find_uart20
-rwxr-xr-xsys_ctrl/xentest-console6
-rwxr-xr-xsys_ctrl/xentest-power_long21
-rwxr-xr-xsys_ctrl/xentest-power_short21
5 files changed, 74 insertions, 0 deletions
diff --git a/sys_ctrl/armtest-console b/sys_ctrl/armtest-console
new file mode 100755
index 0000000..c333bdf
--- /dev/null
+++ b/sys_ctrl/armtest-console
@@ -0,0 +1,6 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2023 Brian Woods
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+uart=$( find_uart "JTAG+3Serial" | sed -n 2p )
+picocom -b 115200 "$uart"
diff --git a/sys_ctrl/find_uart b/sys_ctrl/find_uart
new file mode 100755
index 0000000..d7e0f37
--- /dev/null
+++ b/sys_ctrl/find_uart
@@ -0,0 +1,20 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2023 Brian Woods
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+if [ "x$1" == "x" ] ; then
+ echo "please input usb driver to search for"
+ exit 1
+else
+ driver=$1
+fi
+
+for ttyUSB in $( ls /dev/ttyUSB* ) ; do
+ id=$( udevadm info -q path -n $ttyUSB )
+ rv=$( udevadm info -a -p "$id" | grep "$driver" )
+ if [ "x$rv" != "x" ] ; then
+ echo "$ttyUSB"
+ fi
+done
+
+exit
diff --git a/sys_ctrl/xentest-console b/sys_ctrl/xentest-console
new file mode 100755
index 0000000..f62d972
--- /dev/null
+++ b/sys_ctrl/xentest-console
@@ -0,0 +1,6 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2023 Brian Woods
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+uart=$( find_uart "FT232R USB UART" )
+picocom -b 115200 "$uart"
diff --git a/sys_ctrl/xentest-power_long b/sys_ctrl/xentest-power_long
new file mode 100755
index 0000000..85ea5e8
--- /dev/null
+++ b/sys_ctrl/xentest-power_long
@@ -0,0 +1,21 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2023 Brian Woods
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# Uses a "NOYITO 2-Channel Micro USB Relay" connected to a PC's power
+# switch to remotely press the button. This is the long press.
+
+uart=$( find_uart ch341-uart )
+
+# sets correct baud rate
+stty 9600 -F "$uart"
+
+# enable
+echo -en '\xa0\x01\x01\xa2' > "$uart"
+echo -en '\xa0\x02\x01\xa3' > "$uart"
+
+sleep 6
+
+# disable
+echo -en '\xa0\x01\x00\xa1' > "$uart"
+echo -en '\xa0\x02\x00\xa2' > "$uart"
diff --git a/sys_ctrl/xentest-power_short b/sys_ctrl/xentest-power_short
new file mode 100755
index 0000000..a05c352
--- /dev/null
+++ b/sys_ctrl/xentest-power_short
@@ -0,0 +1,21 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2023 Brian Woods
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# Uses a "NOYITO 2-Channel Micro USB Relay" connected to a PC's power
+# switch to remotely press the button. This is the short press.
+
+uart=$( find_uart ch341-uart )
+
+# sets correct baud rate
+stty 9600 -F "$uart"
+
+# enable
+echo -en '\xa0\x01\x01\xa2' > "$uart"
+echo -en '\xa0\x02\x01\xa3' > "$uart"
+
+sleep 1
+
+# disable
+echo -en '\xa0\x01\x00\xa1' > "$uart"
+echo -en '\xa0\x02\x00\xa2' > "$uart"