Skip to content

Commit

Permalink
t1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilata committed Feb 12, 2024
1 parent 2fc6b89 commit ea6d81b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions ci/hardware_tests/device/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def power_on(self):
self.now()
self.log("[hardware/usb] Turning power on...")
run(
f"uhubctl --vendor {HUB_VENDOR} -p {self.device_port} -a on",
#f"uhubctl --vendor {HUB_VENDOR} -p {self.device_port} -a on",
f"uhubctl -l {self.uhub_location} -p {self.device_port} -a on",
shell=True,
check=True,
)
Expand All @@ -54,7 +55,8 @@ def power_off(self):
self.now()
self.log("[hardware/usb] Turning power off...")
run(
f"uhubctl --vendor {HUB_VENDOR} -p {self.device_port} -r 5 -a off",
#f"uhubctl --vendor {HUB_VENDOR} -p {self.device_port} -r 5 -a off",
f"uhubctl -l {self.uhub_location} -p {self.device_port} -r 5 -a off",
shell=True,
check=True,
)
Expand Down
2 changes: 1 addition & 1 deletion ci/hardware_tests/device/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def update_firmware(self, file=None):
self.touch("right", "click")
self.wait(5)
self.touch("right", "click")
self.wait(10)
self.wait(15)
return self.check_model("Trezor 1")

def _enter_bootloader(self):
Expand Down
2 changes: 1 addition & 1 deletion ci/hardware_tests/hardware.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# location of the uhub, can be found out by running `uhubctl`
T1_UHUB_LOCATION="3-2"
T1_UHUB_LOCATION="3-1"
# to which port of the uhub the device is connected
T1_UHUB_PORT="2"

Expand Down
2 changes: 1 addition & 1 deletion ci/hardware_tests/record_video.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OUTPUTFILE=video_${COMMIT}_$(date +%s).mp4

if [ "$ACTION" == "start" ]; then
echo "[software/video] Starting record to $OUTPUTFILE"
ffmpeg -loglevel warning -f oss -f video4linux2 -i $INPUTDEVICE \
ffmpeg -loglevel warning -f oss -f v4l2 -i $INPUTDEVICE \
-flush_packets 1 \
-vf "drawtext=font=Dejavu Sans: \
text='$COMMIT | %{localtime} | %{pts}': x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1: fontsize=15" $OUTPUTFILE &
Expand Down
8 changes: 5 additions & 3 deletions ci/hardware_tests/t1_hw_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ HERE=`dirname "$0"`
cd $HERE

function finish {
./record_video.sh ${T1_CAMERA} ${CI_COMMIT_SHORT_SHA} stop
ls -l *.mp4
./record_video.sh ${T1_CAMERA} FIXME stop
cd $HERE/../..
ls -l *.mp4 || true
find | fgrep .mp4
}
trap finish EXIT

Expand All @@ -17,7 +19,7 @@ set -a
source hardware.cfg
set +a

./record_video.sh ${T1_CAMERA} ${CI_COMMIT_SHORT_SHA} start
./record_video.sh ${T1_CAMERA} FIXME start
(cd ../.. && poetry install)
poetry run python bootstrap.py T1B1
poetry run python bootstrap.py T1B1 ../../firmware-T1*.bin
Expand Down
2 changes: 1 addition & 1 deletion ci/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ stdenvNoCC.mkDerivation ({
] ++ lib.optionals hardwareTest [
uhubctl
tio
ffmpeg
ffmpeg_5-full
dejavu_fonts
] ++ lib.optionals devTools [
shellcheck
Expand Down

0 comments on commit ea6d81b

Please sign in to comment.