Last active
April 24, 2020 13:45
-
-
Save mu88/080e248107d3722fa47411b17f6ce3da to your computer and use it in GitHub Desktop.
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
chmod 777 /tmp/RaspiFanController/RaspiFanController |
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
scp -r \bin\Release\netcoreapp3.1\linux-arm\publish pi@raspberry:/tmp/RaspiFanController/ |
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
dotnet publish -r linux-arm -c Release /p:PublishSingleFile=true |
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
[Unit] | |
Description=Raspberry Pi Fan Controller based on Blazor Server | |
[Service] | |
WorkingDirectory=/tmp/RaspiFanController | |
ExecStart=/tmp/RaspiFanController/RaspiFanController & | |
Restart=always | |
# Restart service after 10 seconds if the dotnet service crashes: | |
RestartSec=10 | |
SyslogIdentifier=raspifancontroller | |
User=root | |
Environment=ASPNETCORE_ENVIRONMENT=Production | |
[Install] | |
WantedBy=multi-user.target |
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
sudo vcgencmd measure_temp |
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
sudo nano /etc/systemd/system/RaspiFanController.service |
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
var gpioController = new GpioController(); | |
gpioController.OpenPin(17, PinMode.Output); | |
gpioController.Write(17, PinValue.High); |
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
sudo /tmp/RaspiFanController/RaspiFanController |
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
sudo cp RaspiFanController.service /etc/systemd/system/RaspiFanController.service | |
sudo systemctl daemon-reload | |
sudo systemctl start RaspiFanController |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment