Skip to content

Commit

Permalink
Adds CEC test tool
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetersson committed Jan 8, 2021
1 parent 1d1e24a commit fcc7b0e
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions bin/cec-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

TMPFILE=/tmp/cec.log

# Clean up old file
rm -f $TMPFILE

read -p "What is the TV brand/make? " -r TV_MAKE
read -p "What is the TV model? " -r TV_MODEL

echo "TV Brand: $TV_MAKE" >> $TMPFILE
echo "TV Model: $TV_MODEL" >> $TMPFILE

echo -e "\n\nStarting diagnostics. This will take a few minutes...\n\n"

apt-get -qq update
apt-get install -yqq cec-utils pastebinit

echo -e "\n\nPerforming CEC 'scan' command:\n\n" >> $TMPFILE
echo 'scan' | cec-client -s -d 1 >> $TMPFILE

echo -e "\n\nPerforming CEC 'pow 0.0.0.0' command:\n\n" >> $TMPFILE
echo 'pow 0.0.0.0' | cec-client -s d 1 >> $TMPFILE

read -p "Is the TV on right now? " -r TV_STATUS_START
echo "Is the TV on now? $TV_STATUS_START" >> $TMPFILE

echo -e "\n\nPerforming CEC 'standby 0.0.0.0' command:\n\n" >> $TMPFILE
echo 'standby 0.0.0.0' | cec-client -s d 1 >> $TMPFILE

read -p "Is the TV off right now? " -r TV_STATUS_AFTER_POWER_OFF
echo "Is the TV off now? $TV_STATUS_AFTER_POWER_OFF" >> $TMPFILE

echo -e "\n\nPerforming CEC 'on 0.0.0.0' command:\n\n" >> $TMPFILE
echo 'on 0.0.0.0' | cec-client -s d 1 >> $TMPFILE

read -p "Is the TV on right now? " -r TV_STATUS_AFTER_POWER_ON
echo "Is the TV on now? $TV_STATUS_AFTER_POWER_ON" >> $TMPFILE

echo -e "\n\nPerforming 'cec-compliance -A' command:\n\n" >> $TMPFILE
cec-compliance -A >> $TMPFILE 2>&1

echo "\n\nPlease share this URL with us:"
pastebinit -P -i $TMPFILE 2> /dev/null

0 comments on commit fcc7b0e

Please sign in to comment.