Sunday, August 8, 2021

influx Install and backup/move

 Influx install:

https://www.verdrahtet.info/2020/02/14/installation-von-influxdb-grafana-inkl-verbindung-zu-iobroker/

Influx Backup:

https://forum.iobroker.net/post/429747

Also ich mache mein Backup von der normalen Linux Kommandozeile aus und nicht unter der Influxdb-Konsole...

Das schaut dann so aus bei meiner Datenbank die iobroker heißt:

root@DietPi:~# sudo influxd backup -portable -database iobroker -host 127.0.0.1:8088 /tmp/iobroker_influx_backup
2020/05/10 20:28:39 backing up metastore to /tmp/iobroker_influx_backup/meta.00
2020/05/10 20:28:39 backing up db=iobroker
2020/05/10 20:28:39 backing up db=iobroker rp=autogen shard=49 to /tmp/iobroker_influx_backup/iobroker.autogen.00049.00 since 0001-01-01T00:00:00Z
2020/05/10 20:28:40 backing up db=iobroker rp=autogen shard=50 to /tmp/iobroker_influx_backup/iobroker.autogen.00050.00 since 0001-01-01T00:00:00Z
2020/05/10 20:28:40 backing up db=iobroker rp=autogen shard=51 to /tmp/iobroker_influx_backup/iobroker.autogen.00051.00 since 0001-01-01T00:00:00Z
2020/05/10 20:28:40 backing up db=iobroker rp=autogen shard=52 to /tmp/iobroker_influx_backup/iobroker.autogen.00052.00 since 0001-01-01T00:00:00Z
2020/05/10 20:28:41 backing up db=iobroker rp=autogen shard=53 to /tmp/iobroker_influx_backup/iobroker.autogen.00053.00 since 0001-01-01T00:00:00Z
2020/05/10 20:28:41 backing up db=iobroker rp=autogen shard=54 to /tmp/iobroker_influx_backup/iobroker.autogen.00054.00 since 0001-01-01T00:00:00Z
2020/05/10 20:28:42 backup complete:
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.meta
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.s49.tar.gz
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.s50.tar.gz
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.s51.tar.gz
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.s52.tar.gz
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.s53.tar.gz
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.s54.tar.gz
2020/05/10 20:28:42 /tmp/iobroker_influx_backup/20200510T182839Z.manifest
root@DietPi:~#

Vorher muss aber die Influxdb.config bearbeitet werden...:

Hatte mich damals hiernach gerichtet und entsprechend meinen Anforderungen umgesetzt...:

https://solaranzeige.de/phpBB3/viewtopic.php?t=310

Einen Restore hatte ich auch schon gemacht - ging problemlos.



https://solaranzeige.de/phpBB3/viewtopic.php?t=310





Recently I got an error on influxdb. The log file was not clearly stating an error. But Health target was not reached. Starting the service stated to read the error log, journalctl -xe .


Finally I saw the config pattern:

LimitNOFILE=65536 which basically could limit the number of files the service oder user??? can occupy.


After commenting with # . The service starts succesfully.

This is not due to the case having more than 65k open, but perhaps in contradiction to system limits .

This solved my issues on ubuntu but not on my original raspbian.


Thursday, August 5, 2021

ESP2866-01 Wiring

 Some ESP8266-01 Boards need the Ping CH_PD pulled, high, otherwise it is in rest mode.

Pulled high means putting a 10kOhm resistor between CH_PD and VCC.




Sunday, July 18, 2021

Tasmota Time settings

 ntpserver1 yourntpgoeshere


Germany: Timezone 99



https://tasmota.github.io/docs/Commands/

Sunday, May 23, 2021

ESP8266 via MQTT Iobroker

 https://www.smarthome-tricks.de/allgemein/nodemcu-esp8266-sensoren-an-iobroker-ueber-mqtt/

https://www.smarthome-tricks.de/esp8266/pubsubclient-fuer-mqtt-mit-benutzername-passwort-und-port/


https://github.com/knolleary/pubsubclient



Sunday, February 28, 2021

Grafana View Collection

 Internet Connection View:

https://www.smarthome-tricks.de/grafana/5-3-grafana-dashboard-fuer-die-internet-geschwindigkeit/

Tuesday, January 19, 2021

Information on Linux systems live

 Process overview: top, htop, nmon

Disk/read/write: iotop -o -b -d 10

Tuesday, December 22, 2020

Beware ! Minecraft Windows 10 Edition from Microsoft store

 To my knowledge there is no satisfactory solution to share a Minecraft Win 10 licence from MS Store on a Win10 Computer among different users with differen MS Store accounts.

No App Sharing as known from Apple or Google possible. 

The MS Solution is to buy the licence X-Times!

Not Cool!

Monday, October 19, 2020

Granting Access for non Root to GPIOs

https://stackoverflow.com/questions/30938991/access-gpio-sys-class-gpio-as-non-root



Anleitung dafür Rechte auf GPIOs zu setzen aus:
http://www.netzmafia.de/skripten/hardware/RasPi/RasPi_GPIO_Shell.html

Datei:
# /etc/udev/rules.d/80-gpio-noroot.rules
# Zugriff auf GPIO ohne root-Rechte ermoeglichen
#
# Gruppe aendern
SUBSYSTEM=="gpio", RUN+="/bin/chown -R root.gpio /sys/class/gpio"
SUBSYSTEM=="gpio", RUN+="/bin/chown -R root.gpio /sys/devices/virtual/gpio"
# Sticky-Bit setzen
SUBSYSTEM=="gpio", RUN+="/bin/chmod g+s /sys/class/gpio"
SUBSYSTEM=="gpio", RUN+="/bin/chmod g+s /sys/devices/virtual/gpio"
# Zugriffsrechte setzen
SUBSYSTEM=="gpio", RUN+="/bin/chmod -R ug+rw /sys/class/gpio"
SUBSYSTEM=="gpio", RUN+="/bin/chmod -R ug+rw /sys/devices/virtual/gpio"


#Jetzt müssen Sie nur noch den udev-Daemon von den Änderungen wissen lassen (beim nächsten Reboot passiert das dann automatisch):
sudo service udev restart
sudo udevadm trigger --subsystem-match=gpio

Iobroker zur Gruppe gpios hinzufügen:
sudo usermod -aG gpio iobroker



Nun ist folgendes passiert: 
Die Rechte auf die GPios wurden auf die Gruppe GPIO erweitert.
Dies wird bei jedem Boot wiederholt.
Der Nutzer Iobroker wurde dieser Gruppe hinzugefügt und kann nach einem Neustart nun die GPios schalten.


Saturday, September 26, 2020

Ubuntu Blocking Packages from update

 https://askubuntu.com/questions/18654/how-to-prevent-updating-of-a-specific-package

dpkg

Put a package on hold:

echo "<package-name> hold" | sudo dpkg --set-selections

Remove the hold:

echo "<package-name> install" | sudo dpkg --set-selections

Display the status of your packages:

dpkg --get-selections

apt

Hold a package:

sudo apt-mark hold <package-name>

Remove the hold:

sudo apt-mark unhold <package-name>

Show all packages on hold:

sudo apt-mark showhold

Saturday, August 15, 2020

postfix for raspi info

 I just installed Postfix on multiple raspis to be informed about updates, problems etc.

Any suggestions on how this could be done easier by e.g. collecting would be very much appreciated.


I started of with:

sudo apt install postfix:

  • Setup as satellite machine
  • Hostname unchanged
  • Relay or smarthost: put in your smtp
  • Everythin else default.

After that I've updated my /etc/aliases to reroute everything towards root and then towards my external mail adress:

postmaster:    root
nagios: root
root: admin@yourdomain.com


in the postfix Config file: /etc/postfix/main.cf I added:



smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_tls_security_level = encrypt


The  meaning of sender_canonical  is not clear as it seems redundant to the aliases:
www-data admin@yourdomain.com
root admin@yourdomain.com


the sasl_password file needs the input of your external relay or smarthost:

smtpserver:25  user:password


Be sure, the file ist only readable by its owner.


now:

sudo newalias    --> gets the aliases updated
 sudo postmap hash:/etc/postfix/sasl_password  && sudo postmap /etc/postfix/sender_canonical --> gets the files merged into postfix
sudo systemctl restart postfix -->  start with new config

If everything works you should be able to do this:
echo Hello!  Test! | mail -s Testmail admin@yourdomain.com



If it does not work due to the encryption or auth because missing Mech:
https://serverfault.com/questions/1008119/postfix-error-sasl-authentication-failed-cannot-authenticate-to-server-no-mec
try to install:
apt install libsasl2-modules