first commit

This commit is contained in:
pandacraft 2025-03-21 16:04:17 +01:00
commit a5a0434432
1126 changed files with 439481 additions and 0 deletions

14
Troubleshooting/README.md Normal file
View file

@ -0,0 +1,14 @@
# GrovePi Trubleshooting Script
The scripts here are for finding the common problems with the GrovePi.
To run the test, make the complete_test.sh executable:
sudo chmod +x complete_test.sh
and run it:
sudo ./complete_test.sh
Choose option 5 to run all the tests. This might take a few minutes.
Once the tests are completed, a log.txt file would be created on the Desktop. Send this by email or post it on the forums.
See more about the GrovePi at http://www.dexterindustries.com/grovepi

15
Troubleshooting/all_tests.sh Executable file
View file

@ -0,0 +1,15 @@
#! /bin/bash
REPO_PATH=$(readlink -f $(dirname $0) | grep -E -o "^(.*?\\GrovePi)")
echo =============================
echo GrovePi Troubleshooting Script
echo =============================
cd $REPO_PATH/Troubleshooting
echo ""
sudo bash ./software_status.sh 2>&1 | sudo tee log.txt
# bash ./avrdude_test.sh 2>&1 | sudo tee -a log.txt
bash ./i2c_test1.sh 2>&1 | sudo tee -a log.txt
bash ./firmware_version_test.sh 2>&1 | sudo tee -a log.txt
sudo cp log.txt /home/pi/Desktop/log.txt
echo "Log has been saved to Desktop. Please copy it and send it by email or upload it on the forums"

View file

@ -0,0 +1,6 @@
#! /bin/bash
echo ""
echo Checking for Atmega chip
echo ========================
echo ""
avrdude -c gpio -p m328p -v

View file

@ -0,0 +1,38 @@
#! /bin/bash
echo =============================
echo GrovePi Troubleshooting Script
echo =============================
echo ""
echo Adding permissions to the scripts
echo =================================
chmod +x software_status.sh
chmod +x avrdude_test.sh
chmod +x i2c_test1.sh
chmod +x firmware_version_test.sh
echo "Choose a test to run:"
echo =======================
echo 1. Software status test
echo 2. Atmega Test
echo 3. I2C test
echo 4. Firmware test
echo 5. Complete test
echo 6. Exit
read -n1 -p "Select and option:" doit
case $doit in
1) sudo ./software_status.sh 2>&1| tee log.txt ;;
2) sudo ./avrdude_test.sh 2>&1| tee log.txt ;;
3) sudo ./i2c_test1.sh 2>&1| tee log.txt ;;
4) sudo ./firmware_version_test.sh 2>&1| sudo tee log.txt ;;
5) sudo ./software_status.sh 2>&1| tee log.txt ;
sudo ./avrdude_test.sh 2>&1| tee -a log.txt ;
sudo ./i2c_test1.sh 2>&1| tee -a log.txt ;
sudo ./firmware_version_test.sh 2>&1| tee -a log.txt ;;
*) echo Exiting ;;
esac
cp log.txt /home/pi/Desktop/log.txt
echo "Log has been saved to Desktop. Please copy it and send it by email or upload it on the forums"

View file

@ -0,0 +1,6 @@
#! /bin/bash
REPO_PATH=$(readlink -f $(dirname $0) | grep -E -o "^(.*?\\GrovePi)")
echo ""
echo Checking for firmware version
echo =============================
python $REPO_PATH/Software/Python/grove_firmware_version_check.py

17
Troubleshooting/i2c_test1.sh Executable file
View file

@ -0,0 +1,17 @@
#! /bin/bash
echo ""
echo Checking I2C bus for devices
echo ============================
echo ""
# insert a wait here to make sure the ATMEGA is reset and ready
sleep 1
echo Checking I2C bus 0
echo ==================
echo NOTE: it is normal for this one to fail
i2cdetect -y 0
echo ""
echo Checking I2C bus 1
echo ==================
i2cdetect -y 1

View file

@ -0,0 +1,106 @@
#! /bin/bash
#echo Checking for dependencies
#echo troubleshooting_script_v1 #> error_log.txt
echo ""
echo Check space left #>> error_log.txt
echo ================ #>>error_log.txt
df -h
echo ""
echo Check for dependencies #>> error_log.txt
echo ======================
dpkg-query -W -f='${Package} ${Version} ${Status}\n' python #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' python-pip #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' git #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' libi2c-dev #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' python-serial #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' python-rpi.gpio #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' i2c-tools #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' python-smbus #>> error_log.txt
# dpkg-query -W -f='${Package} ${Version} ${Status}\n' arduino #>> error_log.txt
# dpkg-query -W -f='${Package} ${Version} ${Status}\n' minicom #>> error_log.txt
dpkg-query -W -f='${Package} ${Version} ${Status}\n' scratch #>> error_log.txt
echo "" #>>error_log.txt
#Check for wiringPi
# if [[ -n $(find / -name 'wiringPi') ]]
# then
# echo "wiringPi Found" #>>error_log.txt
# else
# echo "wiringPi Not Found (ERR)" #>>error_log.txt
# fi
# if [[ -n $(find / -name 'wiringPi') ]]
# then
# echo "wiringPi Found" #>>error_log.txt
# else
# echo "wiringPi Not Found (ERR)"#>>error_log.txt
# fi
#Check for changes in blacklist
if grep -q "#blacklist i2c-bcm2708" /etc/modprobe.d/raspi-blacklist.conf; then
echo "I2C already removed from blacklist" #>>error_log.txt
else
echo "I2C still in blacklist" #>>error_log.txt
fi
if grep -q "#blacklist spi-bcm2708" /etc/modprobe.d/raspi-blacklist.conf; then
echo "SPI already removed from blacklist" #>>error_log.txt
else
echo "SPI still in blacklist" #>>error_log.txt
fi
echo "" #>>error_log.txt
echo ""
echo Check for addition in /modules #>>error_log.txt
echo ============================== #>>error_log.txt
if grep -q "i2c-dev" /etc/modules; then
echo "I2C-dev already there" #>>error_log.txt
else
echo "I2C-dev not there (ERR)" #>>error_log.txt
fi
if grep -q "i2c-bcm2708" /etc/modules; then
echo "i2c-bcm2708 already there" #>>error_log.txt
else
echo "i2c-bcm2708 not there (ERR)" #>>error_log.txt
fi
if grep -q "spi-dev" /etc/modules; then
echo "spi-dev already there" #>>error_log.txt
else
echo "spi-dev not there (ERR)" #>>error_log.txt
fi
echo "" #>>error_log.txt
echo ""
#echo Checking Hardware revision
echo Hardware revision #>>error_log.txt
echo ================= #>>error_log.txt
python3 -c "import auto_detect_rpi; print(auto_detect_rpi.getRPIGenerationCode(), auto_detect_rpi.getRPIHardwareRevCode())" #>>error_log.txt
# gpio -v #>>error_log.txt
# echo "" #>>error_log.txt
echo ""
#echo Check the /dev folder
echo Check the /dev folder #>>error_log.txt
echo ===================== #>>error_log.txt
ls /dev | grep 'i2c' #>>error_log.txt
ls /dev | grep 'spi' #>>error_log.txt
ls /dev | grep 'ttyAMA' #>>error_log.txt
echo "" #>>error_log.txt
echo "USB device status"
echo =================
lsusb
echo ""
lsusb -t
echo "Raspbian for Robots Version"
echo ===========================
cat /home/pi/di_update/Raspbian_For_Robots/Version
echo ""
echo ""
echo "Hostname"
echo ========
cat /etc/hostname
echo ""