Skip to content

Instantly share code, notes, and snippets.

@mu88
Last active April 24, 2020 13:45
Show Gist options
  • Save mu88/080e248107d3722fa47411b17f6ce3da to your computer and use it in GitHub Desktop.
Save mu88/080e248107d3722fa47411b17f6ce3da to your computer and use it in GitHub Desktop.
chmod 777 /tmp/RaspiFanController/RaspiFanController
scp -r \bin\Release\netcoreapp3.1\linux-arm\publish pi@raspberry:/tmp/RaspiFanController/
dotnet publish -r linux-arm -c Release /p:PublishSingleFile=true
[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
sudo vcgencmd measure_temp
sudo nano /etc/systemd/system/RaspiFanController.service
var gpioController = new GpioController();
gpioController.OpenPin(17, PinMode.Output);
gpioController.Write(17, PinValue.High);
sudo /tmp/RaspiFanController/RaspiFanController
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