Last active
April 25, 2024 11:28
-
-
Save HackingGate/9dc4434c3de17188a17844438fc38aff to your computer and use it in GitHub Desktop.
My environment temperature calculation for https://github.com/srob/homebridge-sensehat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| from sense_hat import SenseHat | |
| import os | |
| def get_cpu_temp(): | |
| res = os.popen('vcgencmd measure_temp').readline() | |
| return float(res.replace("temp=", "").replace("'C\n", "")) | |
| def get_temp(sense): | |
| t1 = sense.get_temperature_from_humidity() | |
| t2 = sense.get_temperature_from_pressure() | |
| t = (t1 + t2) / 2 | |
| t_cpu = get_cpu_temp() | |
| t_corr = t - ((t_cpu - t) / 15) - 3 | |
| return t_corr | |
| sense = SenseHat() | |
| humidity = sense.get_humidity() | |
| pressure = sense.get_pressure() | |
| print("%s %s %s" % (get_temp(sense), humidity, pressure)) |
Author
Author
fileserver
Install
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bashInit
filebrowser config initChange listen port from default 8080 to 8780 (Optional)
filebrowser config set --port 8780Test
filebrowser -r .Add user
filebrowser users add admin adminUpdate user
filebrowser users update admin --username pi
filebrowser users update pi --password pass1234Add /etc/systemd/system/filebrowser.service with the following content.
[Unit]
Description=filebrowser
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/pi
ExecStart=/usr/local/bin/filebrowser -r /home/pi
Restart=on-failure
User=pi
Group=pi
[Install]
WantedBy=multi-user.targetLoad, enable and run
sudo systemctl daemon-reload
sudo systemctl enable --now filebrowser.service
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tailscale
https://tailscale.com/kb/1114/pi-hole/