Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions code/shell/config_for_pico.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,22 @@ pip install psutil
echo '--- pip install xmltodict'
pip install xmltodict

echo '--- save and edit cmdline.txt'
cp /boot/cmdline.txt /boot/cmdline.txt.save
sed -i 's| console=serial0,115200 console=tty1||' /boot/cmdline.txt

echo '--- save and edit config.txt'
cp /boot/config.txt /boot/config.txt.save
sed -i 's|#dtparam=i2c_arm=on|dtparam=i2c_arm=on|' /boot/config.txt

echo '--- installing & enabling daemon'
cd PiModules/code/python/package
python setup.py install
cd ../upspico/picofssd
python setup.py install
systemctl enable picofssd.service

echo '--- adding line to config.txt'
echo -e "\n\ndtparam=pi3-disable-bt\n\n" >> /boot/config.txt
echo -e "\n\ndtoverlay=i2c-rtc,ds1307\n\n" >> /boot/config.txt
echo -e "\n\nenable_uart=1\n\n" >> /boot/config.txt

echo '--- adding lines to /etc/modules'
echo -e "\n\ni2c-bcm2708\ni2c-dev\n\n" >> /etc/modules
echo -e "\n\ni2c-bcm2708\ni2c-dev\rtc-ds1307\n\n" >> /etc/modules

echo '--- disabling hciuart'
systemctl disable hciuart
echo '--- removing fake-hwclock'
apt-get -y remove fake-hwclock && sudo update-rc.d -f fake-hwclock remove

echo '--- all done'
exit 0

27 changes: 27 additions & 0 deletions code/shell/post_firmware_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

if [ `whoami` != 'root' ]; then
echo 'Must be run as root'
exit 1
fi

set -e

echo '--- save and edit cmdline.txt'
rm /boot/cmdline.txt
cp /boot/cmdline.txt.save /boot/cmdline.txt

echo '--- adding line to config.txt'
sed -i 's|dtparam=pi3-disable-bt|#dtparam=pi3-disable-bt|' /boot/config.txt

echo '--- enabling hciuart'
systemctl enable hciuart

echo '--- enabling serial'
systemctl start serial-getty@ttyAMA0.service
systemctl enable serial-getty@ttyAMA0.service
systemctl start serial-getty@ttyS0.service
systemctl enable serial-getty@ttyS0.service

echo '--- all done'
exit 0
27 changes: 27 additions & 0 deletions code/shell/pre_firmware_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

if [ `whoami` != 'root' ]; then
echo 'Must be run as root'
exit 1
fi

set -e

echo '--- save and edit cmdline.txt'
cp /boot/cmdline.txt /boot/cmdline.txt.save
sed -i 's| console=ttyAMA0,115200||' /boot/cmdline.txt

echo '--- adding line to config.txt'
echo -e "\n\ndtparam=pi3-disable-bt\n\n" >> /boot/config.txt

echo '--- disabling hciuart'
systemctl disable hciuart

echo '--- disabling serial'
systemctl stop serial-getty@ttyAMA0.service
systemctl disable serial-getty@ttyAMA0.service
systemctl stop serial-getty@ttyS0.service
systemctl disable serial-getty@ttyS0.service

echo '--- all done'
exit 0
30 changes: 26 additions & 4 deletions pico_status/pico_status_hv3.0.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,30 @@ def fan_state():
def fan_speed():
time.sleep(0.1)
data = i2c.read_word_data(0x6b, 0x12)
data = format(data,"02x")
return (float(data) * 10)
if (data == 0x00):
return "OFF"
elif (data == 0x0a):
return "10%"
elif (data == 0x14):
return "20%"
elif (data == 0x1e):
return "30%"
elif (data == 0x28):
return "40%"
elif (data == 0x32):
return "50%"
elif (data == 0x3c):
return "60%"
elif (data == 0x46):
return "70%"
elif (data == 0x50):
return "80%"
elif (data == 0x5a):
return "90%"
elif (data == 0x64):
return "100%"
else:
return "ERROR"

def r232_state():
time.sleep(0.1)
Expand Down Expand Up @@ -210,9 +232,9 @@ def r232_state():
print " "
print " ","PIco FAN Mode.........:",fan_mode()
print " ","PIco FAN State........:",fan_state()
print " ","PIco FAN Speed........:",fan_speed(),"RPM"
print " ","PIco FAN Speed........:",fan_speed()
print " "
print "***********************************"
print " Powered by PiCo "
print "***********************************"
print " "
print " "