Download Raspbian Jessie Lite from https://www.raspberrypi.org/downloads/raspbian/ and copy it on your SD card. Alternatively, you may download EmonSD, a pre-built SD card image for Raspberry Pi running as an emonPi/emonBase Download https://github.com/openenergymonitor/emonpi/wiki/emonSD-pre-built-SD-card-Download-&-Change-Log
sudo apt-get update
sudo apt-get upgrade
$ sudo apt-get install sqlite3 git i2c-tools avahi-daemon
For building SmartPi tools, additional packages are required.
sudo apt-get install libpam0g-dev
i2c-dev
is required for communicating with the SmartPi.
To check to see if the module is loaded:
sudo lsmod | grep i2c
This should return something like this:
i2c_dev 5859 0
i2c_bcm2708 4834 0
If the module is not listed, add it to the system.
echo 'i2c-dev' | sudo tee -a /etc/modules
sudo modprobe 'i2c-dev'
i2cdetect -l
The output should list your I2C channel. "i2c-1" in my case.
i2c-1 i2c 20804000.i2c I2C adapter
Channel 1 in my case
i2cdetect -y 1
In case of an SmartPi connected to an RPI3, the output should look like this:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
sudo apt-get remove golang
sudo apt-get autoremove
Download the archive and extract it into /usr/local, creating a Go tree in /usr/local/go. Currently version 1.8.1 is up to date. You may need to adapt the filename according to latest version.
cd /usr/local
curl -s https://storage.googleapis.com/golang/go1.8.1.linux-armv6l.tar.gz | sudo tar -xvz
echo 'PATH="/usr/local/go/bin:${PATH}"' | sudo tee -a /etc/profile
In order for the ${PATH}
to be updated, you will need to logout.
Create a directory to contain your Go workspace, for example ${HOME}/go
,
and set the GOPATH environment variable to point to that location.
mkdir "${HOME}/go"
export GOPATH="${HOME}/go"
go get -v github.com/FransTheekrans/SmartPi/src/smartpi
cd ${GOPATH-$HOME/go}/src/github.com/FransTheekrans/SmartPi
make
NOTE: If you need to build from a fork, you will have to symlink your fork into ${GOPATH-$HOME/go}/src/github.com/nDenerserve/
to make golang dependencies work correctly.
The emonSD provides a read-only file system for most areas.
You can mount the file system with write privileges by rpi-rw
in order to edit files.
rpi-ro
reverts write privileges again. /home/pi/data
is always mounted with write access.
This is the location where you need to place your SmartPi database and current values file.
In SmartPi's configif file /etc/smartpi
you may set the following settings to move all files SmartPi is writing into.
[database]
dir="/home/pi/data/smartpi"
[device]
shared_dir="/home/pi/data/smartpi"
- Added MQTT Client
- producecounter and consumecounter files make use of Databasedir -> co-located to rrd database
- fixed "}" compilation issue
- Added this readme.md
- Logging
- Improved error handling
- changed from rrdtool to sqlite3
- added csv-export
- changed from Bootstrap to Angular Material
- change datelayout in API to RFC3339
- fixed errors in datehandling
- added week consumption