- Raspberry / ARM Device / Linux Device
- SSH access to device / for deployment purposes
- .NET SDK installed on Windows/Linux/Mac – where App will be developed
- Windows Command Line SSH
- IDE / Visual Studio Code / Visual Studio
1. Create .NET Core application using command line / or Visual Studio
Command Line / Visual Studio Code
dotnet new console -o DotNet.RaspberryPi.App1
2. Build / Publish using Command Line
dotnet publish -c Release -r linux-arm
3. Deploy to Raspberry Pi device / Linux ARM Device
We will move / copy files to destination (ARM device) using SCP command, which stand for Secure Copy. Replace parameters to meet your needs.
- Source Path / Folder
- Destination Path / Folder
- IP Address
scp -r <SOURCE-FOLDER> <USER>@<IP-ADDRESS>:<DESTINATION-FOLDER>
scp -r ./bin/Release/netcoreapp2.1/linux-arm email@example.com:/home/appUser/apps/
4. Run the App on the Device
First you’ll need to change permissions on executable ARM/Linux file by using chmod command. Also, move to publish directory where file is located.
This steps should be done on the device over SSH or direct connection. Connect to device using SSH command line command(alternative is Putty), Linux has command included by default.
IP address of the device can be found using:
- nmap (nmap <IP-ADDRESS:RANGE-FROM>:<IP-ADDRESS:RANGE-TO>, example: nmap 192.168.1.1-255) or
- you can go to your router and list devices. Router IP can be found using
- ipconfig command line (Windows) or
- ifconfig (Linux). Look for default gateway.
When you have all the parameters that you need, you can continue to executing the command below:
#connecting to the remote device
#changing directory to publish folder
sudo chmod +x <AppName>
# change execution permissions on application