Skip to content

Commit

Permalink
Add user to dialout group to access power meter
Browse files Browse the repository at this point in the history
  • Loading branch information
UsualSpec committed Jul 8, 2024
1 parent b0b6d6d commit f334d81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ First of all, flash an OS to the SD card of the Raspberry Pi. This project was t
2. Run the deployment script: `sudo chmod +x deploy.sh && sudo ./deploy.sh`. You are asked to input the name of the device you want to deploy. This will also set the hostname of this device and copy a SSH key to the `ethditet` user. Do **not** disconnect if you are using SSH as this may prevent you from reconnecting before a forced reboot due to the port change of the SSH server and the firewall.
3. After the script has finished, copy the resulting `client.csr` file and the `zabbix_psk.psk` file to the server. If you are using a USB stick, use `cp /etc/mmclient/client_<deviceName>.csr /mnt/<deviceName>.csr` and `cp zabbix_psk.psk /mnt/zabbix_psk_<deviceName>.psk` and then remove zabbix_psk.psk via: `rm zabbix_psk.psk`.

On the server (e.g. in a seperate `certs` folder where you generated the CA signing the certificates of the Pi), sign the client.csr file with e.g. `openssl x509 -req -in <deviceName>.csr -CA ca.cer -CAkey ca.key -CAcreateserial -out <deviceName>.cer -days 365 -sha512` and copy the resulting client.cer file to `/etc/mmclient/client.cer` and `ca.cer` file to `/etc/mmclient/ca.cer` on the Pi. For more information, check the README file in the server folder.
On the server (e.g. in a seperate `certs` folder where you generated the CA signing the certificates of the Pi), sign the client.csr file with e.g. `openssl x509 -req -in <deviceName>.csr -CA ca.cer -CAkey ca.key -CAcreateserial -out <deviceName>.cer -days 365 -sha512` and copy the resulting client.cer file to `/etc/mmclient/client.cer` and `ca.cer` file to `/etc/mmclient/ca.cer` and set the owner to `mmclient`: `sudo chown mmclient: /etc/mmclient/client.cer` on the Pi. For more information, check the README file in the server folder.
Now, set up Zabbix on the Zabbix Online UI with the PSK from zabbix_psk.psk and the PSK identity `PSK <your_selected_device_name>`.

To configure PSK encryption and register this agent in the Zabbix frontend:
Expand Down
2 changes: 2 additions & 0 deletions client/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ sudo -u postgres psql -d autopower_client -a -f client_db_schema.sql

# create mmclient user and set up files
adduser --system mmclient
# allow access to power meter
adduser mmclient dialout

mkdir /etc/mmclient
cp config/secrets.json.example /etc/mmclient/secrets.json
Expand Down

0 comments on commit f334d81

Please sign in to comment.