Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91ced1c
commit db67708
Showing
61 changed files
with
1,086 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
wget -O- http://project-downloads.drogon.net/gertduino/gertduino.tgz | tar xfz - | ||
|
||
cd gertduino | ||
|
||
cd avrdude | ||
|
||
sudo cp /etc/avrdude.conf /var/tmp | ||
sudo cp avrdude.conf /etc | ||
|
||
sudo cp /usr/share/arduino/hardware/arduino/boards.txt /var/tmp | ||
sudo cp boards.txt /usr/share/arduino/hardware/arduino/boards.txt | ||
|
||
sudo cp /usr/share/arduino/hardware/arduino/programmers.txt /var/tmp | ||
sudo cp programmers.txt /usr/share/arduino/hardware/arduino/programmers.txt | ||
|
||
sudo cp /usr/bin/avrdude /var/tmp | ||
sudo cp avrdude /usr/bin/avrdude | ||
|
||
sudo chmod 4755 /usr/bin/avrdude | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python | ||
#==================================================================== | ||
# Import subfiles | ||
#==================================================================== | ||
import datetime | ||
import serial | ||
import subprocess | ||
import sys | ||
import time | ||
import warnings | ||
|
||
#==================================================================== | ||
# Set Variables | ||
#==================================================================== | ||
count = 0 | ||
delay = 2 | ||
DEBUG = 0 | ||
maxcount = 1 | ||
|
||
#==================================================================== | ||
# Setup Serial Port | ||
# /tty/AMA0 is used with the GertDuino board | ||
#==================================================================== | ||
#ser = serial.Serial('/dev/ttyACM0', 9600, timeout=5) | ||
#ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=5) | ||
#ser = serial.Serial('/dev/ttyUSB1', 9600, timeout=5) | ||
ser = serial.Serial('/dev/ttyAMA0', 9600, timeout=5) | ||
|
||
#==================================================================== | ||
# Send the Analogue Port number to Gertduino & read back the voltage value | ||
#==================================================================== | ||
|
||
#while True: | ||
while (count < maxcount): | ||
ser.flushInput() | ||
print "Count= {0}".format(count) | ||
# OK read all Analog | ||
for i in range(6): | ||
if DEBUG == 1: | ||
print "\ti={0}".format(i) | ||
# write the Analogue Port number to GertDuino | ||
ser.write(chr(48+i)) | ||
# read the response back from GertDuino | ||
line = ser.readline() | ||
# print "\t{0}".format(line), | ||
print "\tA{0}=".format(i), | ||
print "{0}".format(line), | ||
# If reading Analogue 0 then save the voltage to /home/robin/ReadVoltage0 | ||
if i == 0: | ||
cht = open("/home/robin/AprxVoltage", "wb") | ||
cht.write(line); | ||
cht.close() | ||
# If the voltage is low on Analogue 0 then print "Low", or "Critical", or shutdown Raspi | ||
if float(line) < 12.00 and float(line) > 11.51: | ||
print "\t\tVoltage is low" | ||
elif float(line) < 11.50 and float(line) > 11.01: | ||
print "\t\tVoltage is CRITICAL" | ||
elif float(line) < 11.00: | ||
# subprocess.call(["sudo", "shutdown", "-k"]) | ||
subprocess.call(["sudo", "shutdown", "-k", "now"]) | ||
count = count +1 | ||
time.sleep(delay) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/bin/bash | ||
|
||
scp /home/robin/AprxVoltage robin@battmon1.local:/home/robin/AprxVoltage | ||
scp /home/robin/AprxVoltage robin@raspi20.local:/home/robin/AprxVoltage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python | ||
|
||
import subprocess | ||
import re | ||
import sys | ||
import time | ||
import datetime | ||
import os | ||
import glob | ||
import warnings | ||
|
||
DEBUG = 0 | ||
|
||
# Add a delay for boot | ||
time.sleep(1) | ||
|
||
# Continuously append data | ||
while(True): | ||
|
||
os.system('modprobe w1-gpio') | ||
os.system('modprobe w1-therm') | ||
|
||
base_dir = '/sys/bus/w1/devices/' | ||
device_folder1 = glob.glob(base_dir + '*27c2')[0] | ||
# device_folder1 = glob.glob(base_dir + '*284a')[0] | ||
# device_folder1 = glob.glob(base_dir + '*2af2')[0] | ||
# device_folder1 = glob.glob(base_dir + '*5c8c')[0] | ||
device_file1 = device_folder1 + '/w1_slave' | ||
|
||
def read_temp_raw1(): | ||
f = open(device_file1, 'r') | ||
lines1 = f.readlines() | ||
f.close() | ||
return lines1 | ||
|
||
def read_temp1(): | ||
lines1 = read_temp_raw1() | ||
while lines1[0].strip()[-3:] != 'YES': | ||
time.sleep(0.2) | ||
lines1 = read_temp_raw1() | ||
equals_pos = lines1[1].find('t=') | ||
if equals_pos != -1: | ||
temp_string = lines1[1][equals_pos+2:] | ||
temp_c1 = float(temp_string) / 1000.0 | ||
return temp_c1 | ||
|
||
BasementTemp = round(read_temp1(),1) | ||
|
||
if DEBUG > 0: | ||
print "Basement Temp (rounded): ", BasementTemp | ||
|
||
cht = open("/home/robin/BasementTemp", "w") | ||
cht.write (str(BasementTemp)) | ||
cht.close() | ||
|
||
print "Basement Temp: ", (read_temp1()) | ||
|
||
time.sleep(1) | ||
|
||
sys.exit() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python | ||
|
||
import subprocess | ||
import re | ||
import sys | ||
import time | ||
import datetime | ||
import os | ||
import glob | ||
import warnings | ||
|
||
DEBUG = 0 | ||
|
||
# Add a delay for boot | ||
time.sleep(1) | ||
|
||
# Continuously append data | ||
while(True): | ||
|
||
os.system('modprobe w1-gpio') | ||
os.system('modprobe w1-therm') | ||
|
||
base_dir = '/sys/bus/w1/devices/' | ||
device_folder1 = glob.glob(base_dir + '*27c2')[0] | ||
# device_folder1 = glob.glob(base_dir + '*284a')[0] | ||
# device_folder1 = glob.glob(base_dir + '*2af2')[0] | ||
# device_folder1 = glob.glob(base_dir + '*5c8c')[0] | ||
device_file1 = device_folder1 + '/w1_slave' | ||
|
||
def read_temp_raw1(): | ||
f = open(device_file1, 'r') | ||
lines1 = f.readlines() | ||
f.close() | ||
return lines1 | ||
|
||
def read_temp1(): | ||
lines1 = read_temp_raw1() | ||
while lines1[0].strip()[-3:] != 'YES': | ||
time.sleep(0.2) | ||
lines1 = read_temp_raw1() | ||
equals_pos = lines1[1].find('t=') | ||
if equals_pos != -1: | ||
temp_string = lines1[1][equals_pos+2:] | ||
temp_c1 = float(temp_string) / 1000.0 | ||
return temp_c1 | ||
|
||
TestTemp = round(read_temp1(),1) | ||
|
||
if DEBUG > 0: | ||
print "Test Temp (rounded): ", TestTemp | ||
|
||
cht = open("/home/robin/CurrentTestTemp", "w") | ||
cht.write (str(TestTemp)) | ||
cht.close() | ||
|
||
print "Test Temp: ", (read_temp1()) | ||
|
||
time.sleep(1) | ||
|
||
sys.exit() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
|
||
21:42:42 up 1 min, 0 users, load average: 0.76, 0.47, 0.18 | ||
21:44:01 up 2 min, 0 users, load average: 0.20, 0.36, 0.17 | ||
21:46:01 up 4 min, 0 users, load average: 0.03, 0.24, 0.14 | ||
21:48:01 up 6 min, 0 users, load average: 0.00, 0.16, 0.13 | ||
21:50:01 up 8 min, 0 users, load average: 0.00, 0.11, 0.12 | ||
21:52:01 up 10 min, 0 users, load average: 0.00, 0.07, 0.10 | ||
21:54:01 up 12 min, 0 users, load average: 0.12, 0.09, 0.11 | ||
21:56:01 up 14 min, 0 users, load average: 0.02, 0.06, 0.10 | ||
21:58:01 up 16 min, 0 users, load average: 0.00, 0.04, 0.09 | ||
22:00:01 up 18 min, 0 users, load average: 0.00, 0.03, 0.07 | ||
22:02:01 up 20 min, 0 users, load average: 0.03, 0.03, 0.07 | ||
22:04:01 up 22 min, 0 users, load average: 0.00, 0.02, 0.06 | ||
22:06:01 up 24 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:08:01 up 26 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:10:01 up 28 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:12:01 up 30 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:14:02 up 32 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:16:01 up 34 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:18:01 up 36 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:20:01 up 38 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:22:01 up 40 min, 0 users, load average: 0.04, 0.03, 0.05 | ||
22:24:01 up 42 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:26:01 up 44 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:28:01 up 46 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:30:01 up 48 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:32:01 up 50 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:34:01 up 52 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:36:01 up 54 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:38:01 up 56 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:40:01 up 58 min, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:42:01 up 1:00, 0 users, load average: 0.04, 0.03, 0.05 | ||
22:44:01 up 1:02, 0 users, load average: 0.01, 0.02, 0.05 | ||
22:46:02 up 1:04, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:48:01 up 1:06, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:50:01 up 1:08, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:52:01 up 1:10, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:54:01 up 1:12, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:56:01 up 1:14, 0 users, load average: 0.00, 0.01, 0.05 | ||
22:58:01 up 1:16, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:00:01 up 1:18, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:02:01 up 1:20, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:04:01 up 1:22, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:06:01 up 1:24, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:08:01 up 1:26, 0 users, load average: 0.08, 0.03, 0.05 | ||
23:10:01 up 1:28, 0 users, load average: 0.04, 0.04, 0.05 | ||
23:12:01 up 1:30, 0 users, load average: 0.01, 0.03, 0.05 | ||
23:14:01 up 1:32, 0 users, load average: 0.00, 0.02, 0.05 | ||
23:16:01 up 1:34, 0 users, load average: 0.01, 0.02, 0.05 | ||
23:18:01 up 1:36, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:20:02 up 1:38, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:22:01 up 1:40, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:24:01 up 1:42, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:26:01 up 1:44, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:28:01 up 1:46, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:30:01 up 1:48, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:32:01 up 1:50, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:34:01 up 1:52, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:36:01 up 1:54, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:38:01 up 1:56, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:40:01 up 1:58, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:42:01 up 2:00, 0 users, load average: 0.07, 0.03, 0.05 | ||
23:44:01 up 2:02, 0 users, load average: 0.01, 0.02, 0.05 | ||
23:46:01 up 2:04, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:48:01 up 2:06, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:50:01 up 2:08, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:52:01 up 2:10, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:54:01 up 2:12, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:56:01 up 2:14, 0 users, load average: 0.00, 0.01, 0.05 | ||
23:58:02 up 2:16, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:00:01 up 2:18, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:02:01 up 2:20, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:04:01 up 2:22, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:06:01 up 2:24, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:08:01 up 2:26, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:10:01 up 2:28, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:12:01 up 2:30, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:14:01 up 2:32, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:16:01 up 2:34, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:18:01 up 2:36, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:20:01 up 2:38, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:22:01 up 2:40, 0 users, load average: 0.08, 0.03, 0.05 | ||
00:24:01 up 2:42, 0 users, load average: 0.05, 0.06, 0.05 | ||
00:26:01 up 2:44, 0 users, load average: 0.01, 0.04, 0.05 | ||
00:28:01 up 2:46, 0 users, load average: 0.00, 0.03, 0.05 | ||
00:30:02 up 2:48, 0 users, load average: 0.00, 0.02, 0.05 | ||
00:32:01 up 2:50, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:34:01 up 2:52, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:36:01 up 2:54, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:38:01 up 2:56, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:40:01 up 2:58, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:42:01 up 3:00, 0 users, load average: 0.07, 0.03, 0.05 | ||
00:44:01 up 3:02, 0 users, load average: 0.01, 0.02, 0.05 | ||
00:46:01 up 3:04, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:48:01 up 3:06, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:50:01 up 3:08, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:52:01 up 3:10, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:54:01 up 3:12, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:56:01 up 3:14, 0 users, load average: 0.00, 0.01, 0.05 | ||
00:58:01 up 3:16, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:00:01 up 3:18, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:02:01 up 3:20, 0 users, load average: 0.08, 0.03, 0.05 | ||
01:04:01 up 3:22, 0 users, load average: 0.01, 0.02, 0.05 | ||
01:06:01 up 3:24, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:08:02 up 3:26, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:10:01 up 3:28, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:12:01 up 3:30, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:14:01 up 3:32, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:16:01 up 3:34, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:18:01 up 3:36, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:20:01 up 3:38, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:22:01 up 3:40, 0 users, load average: 0.00, 0.01, 0.05 | ||
01:24:01 up 3:42, 0 users, load average: 0.00, 0.01, 0.05 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
BOARD_TAG = uno | ||
ARDUINO_PORT = /dev/ttyACM0 | ||
ARDUINO_LIBS = | ||
ARDUINO_DIR = /usr/share/arduino | ||
include /home/robin/Arduino.mk | ||
|
Oops, something went wrong.