- Installation of a ready-made image
- Manual installation
Own installation vs finished image
If you want to install the software yourself, you will have to install and configure some programs yourself, a
Installing a finished image
You can load a ready configured image at https://files.enerserve.eu/smartpi/smartpi_bullseye_arm64.7z.
In contrast to the original Raspbian, many log files are moved to the ramdisk and some partitions are write-protected. Download the image and unpack the file. You need a program that can unzip 7-Zip files: http://www.7-zip.org).
- Download the program
- Win32DiskImager from https://sourceforge.net/projects/win32diskimager/
- Insert the SDcard into the SDcard reader of your PC
- Note the drive letter of the SD card. You can see the drive letter in the left column of Windows Explorer, e.g. G:
- Run the program you downloaded earlier.
- Select the unzipped file (*.img) in the "Image File" field.
- Select the drive letter of the SDcard in the "Device" selection field and click "Write".
- Wait until the writing is finished
Installation under Linux:Use the dd command.
dd bs=4M if=path_of_your_image.img of=/dev/sdX conv=fsync
In the installation package there are some files with special rights for the user smartpi.
To ensure a smooth installation, you should create this user as well:
sudo adduser smartpi --group --system
Add package list:
Add the Grafana repository to the package sources with the following commands:
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt update
sudo apt upgrade
sudo apt-get install -y i2c-tools, sqlite3, ppp, wvdial, libpam0g, npm, influxdb, grafana
Then edit the configuration file of InfluxDB:
sudo nano /etc/influxdb/influxdb.conf
In the [http] section, verify that the following lines are commented out and have the appropriate values:
enabled = true
Activate and start the database:
sudo systemctl unmask influxdb
sudo systemctl enable influxdb
sudo systemctl start influxdb
influx -execute "CREATE USER smartpi WITH PASSWORD 'smart4pi' WITH ALL PRIVILEGES"
influx -username admin -password smart4pi -execute "CREATE DATABASE MeteringData"
influx -username admin -password smart4pi -execute "CREATE CONTINUOUS QUERY minmax_1h ON MeteringData BEGIN SELECT max(CosPhi1) AS MAX_CosPhi1,max(CosPhi2) AS MAX_CosPhi2,max(CosPhi3) AS MAX_CosPhi3,max(F1) AS MAX_F1,max(F2) AS MAX_F2,max(F3) AS MAX_F3,max(U1) AS MAX_U1,max(U2) AS MAX_U2,max(U3) AS MAX_U3,max(I1) AS MAX_I1,max(I2) AS MAX_I2,max(I3) AS MAX_I3,max(I4) AS MAX_I4,max(P1) AS MAX_P1,max(P2) AS MAX_P2,max(P3) AS MAX_P3,max(P3) AS MAX_P3,min(CosPhi1) AS MIN_CosPhi1,min(CosPhi2) AS MIN_CosPhi2,min(CosPhi3) AS MIN_CosPhi3,min(F1) AS MIN_F1,min(F2) AS MIN_F2,min(F3) AS MIN_F3,min(U1) AS MIN_U1,min(U2) AS MIN_U2,min(U3) AS MIN_U3,min(I1) AS MIN_I1,min(I2) AS MIN_I2,min(I3) AS MIN_I3,min(I4) AS MIN_I4,min(P1) AS MIN_P1,min(P2) AS MIN_P2,min(P3) AS MIN_P3,min(P3) AS MIN_P3 INTO hour FROM data GROUP BY time(1h),serial,type END"
influx -username admin -password smart4pi -execute "CREATE DATABASE FastMeasurement"
A Tempfs file system for the file with the current measured values is absolutely necessary. Therefore open /etc/fstab with a text editor of your choice (e.g.
sudo nano /etc/fstab) and add the following entry:
tmpfs /var/tmp/smartpi tmpfs nodev,nosuid,size=20M 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=1777,size=10M 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777,size=30M 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=20M 0 0
wget [address of the package] (can be found under downloads)
sudo dpkg -i [name of the package].
After a reboot with sudo reboot the SmartPi is ready for use.
wget [Package address] (can be found at Downloads)
sudo dpkg -i [Package name]
sudo rebootthe SmartPi is ready for use.
By default, the SmartPi is delivered with DHCP. This means that it is assigned an IPaddress by your router. To find out the IPaddress of your SmartPi, you can either look in the list of registered on your router or search the IPaddress with a network scanner Angry IP (http://www.angryip.org) or Netscan.
The hostname of the correct IP must be "smartpi" or "raspberry". You can now access the website with http://<IPaddress>:1080.
A sshlogin is also possible:
Username: smartpi (pi before bullseye)
Password: smart4pi or raspberry
In the case of an Internet share (port share), we strongly recommend that you change the user's password for security reasons (command: passwd). The default password is known and allows hackers very easy access to your SmartPi and thus to your home network.
You can reach the web interface at http://<IPaddress>:1080
The web page currently displays the current values of power, current, voltage, cos phi and frequency.
A bar display shows the energy of the last 8 days.
A right click on Chart opens the display of the daily history of all measured values. A click on the button of the corresponding value adds the value to the daily history. Another click removes it again. The button "Day back" can be used to go back one day. The button "Day forward" jumps one day forward. The "Add day back" and "Remove day back" buttons can be used to extend or shorten the day view to several days.
The table view can be selected via the drop-down menu at the top left. Here a view or an export of the table is possible. Via the date fields an exact period can be selected.
Please note that it may take some time until the view is loaded.
The configuration page can also be loaded via the drop-down menu.
For access you need user name and password. These cannot be changed at this time:
In the "default settings" you can assign a serial number, a name and coordinates to the smartpi. When using the API (see http://blog.enerserve.eu) this information is already evaluated.
The tab "measurement" contains all settings for the measurement. Here you can select the appropriate frequency for your country (50Hz or 60Hz). Furthermore you can set at which phase the measurement should be done and which sensor is connected. Here you can also set whether the voltage is to be measured or assumed. The corresponding voltage can then be set.
The tabs "mqtt", "ftp", and "mobile communication" contain the access data and settings for the respective points. Also the MQTT and FTPupload can be switched on and off there.
Under "expert settings" you can change the port of the web interface and the format of the CSVfiles.