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
import RPi.GPIO as GPIO | |
import time | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(11, GPIO.OUT) | |
def turnon(): | |
GPIO.output(11,True) | |
def turnoff(): |
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
import glob | |
import time | |
from pytz import timezone | |
from datetime import datetime | |
base_dir = '/sys/bus/w1/devices/' | |
device_folder = glob.glob(base_dir + '28*')[0] | |
device_file = device_folder + '/w1_slave' |
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
#! /bin/bash | |
. /boot/bss_variables.config | |
echo "Start beerfridge start scripts: " | |
echo "Beerfridge Start Script:[[ INIT ]]" | |
cat /boot/bss_variables.config | |
sudo sh /boot/bss_set_host_and_ip_master.sh | |
sudo sh /boot/bss_set_host_and_ip_master.sh |
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
#! /bin/bash | |
echo "Beerfridge Start Script: [[ PASSWORD ]]" | |
. /boot/bss_variables.config | |
echo "pi:${PASSWORD_USER}" | chpasswd |
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
#! /bin/bash | |
echo "Beerfridge Start Script: [[ HOSTNAME & IP ]]" | |
. /boot/bss_variables.config | |
# Change the hostname | |
sudo hostnamectl --transient set-hostname ${MASTER_HOSTNAME} | |
sudo hostnamectl --static set-hostname ${MASTER_HOSTNAME} | |
sudo hostnamectl --pretty set-hostname ${MASTER_HOSTNAME} | |
sudo sed -i s/raspberrypi/${MASTER_HOSTNAME}/g /etc/hosts |
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
#! /bin/bash | |
echo "Beerfridge Start Script: [[ NETWORK ]]" | |
. /boot/bss_variables.config | |
echo "country="${COUNTRY}" | |
network={ | |
ssid=\"${SSID}\" | |
psk=\"${PASSWORD}\" | |
}" | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf |
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
### Variables for setting up wifi: | |
COUNTRY= | |
SSID='' | |
PASSWORD='' | |
### Variables for setting up hostname and IP: | |
ROUTER_IP_ADDRESS= | |
MASTER_HOSTNAME= | |
MASTER_IP= |