-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into stable
- Loading branch information
Showing
7 changed files
with
74 additions
and
71 deletions.
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
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 |
---|---|---|
@@ -1,48 +1,20 @@ | ||
#!/bin/bash | ||
source load_config.sh | ||
|
||
sudo apt-get install -y python-smbus i2c-tools python-rpi.gpio python-gpiozero | ||
sudo pip install xmltodict | ||
echo "-------------------------------------------------------------" | ||
echo "emonpiLCD install" | ||
echo "-------------------------------------------------------------" | ||
cd $openenergymonitor_dir | ||
|
||
# Uncomment dtparam=i2c_arm=on | ||
sudo sed -i "s/^#dtparam=i2c_arm=on/dtparam=i2c_arm=on/" /boot/config.txt | ||
# Append line i2c-dev to /etc/modules | ||
sudo sed -i -n '/i2c-dev/!p;$a i2c-dev' /etc/modules | ||
|
||
if [ ! -d /var/log/emonpilcd ]; then | ||
# emonPiLCD Logger | ||
sudo mkdir /var/log/emonpilcd | ||
sudo chown $user /var/log/emonpilcd | ||
# Permissions? | ||
touch /var/log/emonpilcd/emonpilcd.log | ||
fi | ||
|
||
# --------------------------------------------------------- | ||
# Install service | ||
# --------------------------------------------------------- | ||
service=emonPiLCD | ||
|
||
if [ -f /lib/systemd/system/$service.service ]; then | ||
echo "- reinstalling $service.service" | ||
sudo systemctl stop $service.service | ||
sudo systemctl disable $service.service | ||
sudo rm /lib/systemd/system/$service.service | ||
else | ||
echo "- installing $service.service" | ||
fi | ||
|
||
# Install emonpi repo if it doesnt already exist | ||
if [ ! -d $openenergymonitor_dir/emonpi ]; then | ||
echo "Installing emonpi repository" | ||
cd $openenergymonitor_dir | ||
git clone ${git_repo[emonpi]} | ||
else | ||
echo "- emonpi repository already installed" | ||
git pull | ||
fi | ||
|
||
sudo cp $openenergymonitor_dir/emonpi/lcd/$service.service /lib/systemd/system | ||
sudo sed -i "s~ExecStart=.*~ExecStart=/usr/bin/python $openenergymonitor_dir/emonpi/lcd/emonPiLCD.py~" /lib/systemd/system/$service.service | ||
sudo systemctl enable $service.service | ||
sudo systemctl restart $service.service | ||
|
||
state=$(systemctl show $service | grep ActiveState) | ||
echo "- Service $state" | ||
# --------------------------------------------------------- | ||
if [ -f $openenergymonitor_dir/emonpi/lcd/install.sh ]; then | ||
$openenergymonitor_dir/emonpi/lcd/install.sh | ||
else | ||
echo "ERROR: $openenergymonitor_dir/emonpi/lcd/install.sh script does not exist" | ||
fi |
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
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,9 @@ | ||
#!/bin/bash | ||
source load_config.sh | ||
|
||
echo "-------------------------------------------------------------" | ||
echo "EmonPi LCD Update" | ||
echo "-------------------------------------------------------------" | ||
if [ -f $openenergymonitor_dir/emonpi/lcd/install.sh ]; then | ||
$openenergymonitor_dir/emonpi/lcd/./install.sh | ||
fi |
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.0.9-beta | ||
1.1.0-beta |