Install Notes
sudo nano /etc/systemd/timesyncd.conf
NTP=time2.google.com time3.google.com
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd
timedatectl status
sudo raspi-config
set locale
set serial NO/YES
enable I2C
enable SPI
Update
git clone https://github.com/goodtft/LCD-show.git
sudo chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show
Wait a few minutes, the system will restart automatically.
sudo nano /boot/config.txt
dtoverlay=sc16is752-spi1,int_pin=24
dtoverlay=disable-wifi
dtoverlay=disable-bt #for Pi4
dtoverlay=pi3-disable-bt #for Pi3
sudo apt install -y gnupg2 curl wget
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update
sudo apt install -y influxdb
sudo nano /etc/influxdb/influxdb.conf
query-log-enabled = false
[http]
enabled = true
bind-address = ":8086"
log-enabled = false
sudo systemctl enable influxdb
sudo systemctl start influxdb
influx
CREATE DATABASE powermeterDB
CREATE USER "powermeter_db" WITH PASSWORD '97561003778'
exit
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
sudo wget -q -O /usr/share/keyrings/grafana.key https://packages.grafana.com/gpg.key
Add this repository for stable releases:
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
Bash
Add this repository if you want beta releases:
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/oss/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
Bash
After you add the repository:
sudo apt-get update
sudo apt-get install grafana
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
sudo systemctl edit grafana-server.service
[Service]
# Give the CAP_NET_BIND_SERVICE capability
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
# A private user cannot have process capabilities on the host's user
# namespace and thus CAP_NET_BIND_SERVICE has no effect.
PrivateUsers=false
sudo systemctl enable grafana-server.service
sudo nano /etc/grafana/grafana.ini
set port from 3000 to 80
cd /opt
sudo git clone https://github.com/samuelphy/energy-meter-logger
apt-get install python-influxdb
cd /opt/energy-meter-logger
MQTT
sudo apt install mosquitto
sudo apt install mosquitto-clients
INFO:
sudo systemctl start mosquitto # Starten
sudo systemctl stop mosquitto # Stoppen
sudo systemctl restart mosquitto # Neustarten
sudo systemctl disable mosquitto # Autostart deaktivieren
sudo systemctl enable mosquitto # Autostart aktivieren
mosquitto_sub -h localhost -t tasmota/# -d
sudo touch /etc/mosquitto/conf.d/010-listener-users.conf
sudo nano /etc/mosquitto/conf.d/010-listener-users.conf
listener 1883
password_file /etc/mosquitto/conf.d/010-access-list
allow_anonymous false
sudo touch /etc/mosquitto/conf.d/010-access-list
sudo mosquitto_passwd /etc/mosquitto/conf.d/010-access-list PowerMeter_PV01
SONOFF - TASMOTA
configure MQTT; Timezone, NTP
sudo apt-get install telegraf
telegraf config > telegraf.conf
[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
servers = ["tcp://<hostname or IP>:1883"]
## Topics that will be subscribed to.
topics = [
"my/topic/#",
]
## QoS policy for messages
## 0 = at most once
qos = 0
## Connection timeout for initial connection in seconds
connection_timeout = "30s"
## Environment variables can be acessed using the ${variable} syntax
client_id = "${MQTT_CLIENT_ID}"
## Username and password to connect MQTT server.
username = "${MQTT_USER}"
password = "${MQTT_PASSWORD}"
data_format = "json_v2"
[[inputs.mqtt_consumer.json_v2]]
# If you're not using UTC, leave out the two timestamp
# lines and see if it works. Otherwise, you'll have
# metrics in the past/future.
timestamp_path = "Time"
timestamp_format = "2006-01-02T15:04:05"
[[inputs.mqtt_consumer.json_v2.object]]
path = "ENERGY"
cd ~/Downloads
git clone https://github.com/billw2/rpi-clone.git
cd rpi-clone
sudo cp rpi-clone rpi-clone-setup /usr/local/sbin
sudo rpi-clone sd?? -v
Keine Kommentare