GC2000
GC2000

Reputation: 45

Can I get a C# Visual studio program to control a raspberry pi?

I am working on a project that combines a visual studio application and a raspberry pi.

Is there an easy way to run a terminal program (like "python script.py") on a raspberry pi through a C# Visual Studio Program and retrieve the results?

Upvotes: 4

Views: 487

Answers (1)

JPBlanc
JPBlanc

Reputation: 72670

IF YOU RUN Windows 10 ON YOUR Raspberry .

You can use a remote Powershell on a Raspberry running Windows 10 with the following :

# Start WinRM on the local Windows OS
net start WinRM

# Vérify RaspBerry PI3 access
Test-Connection jpbraspbpi3-1

# Allow accesss to Raspberry PI3
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'jpbraspbpi3-1'

# Etablish the connexion
Enter-PSSession -ComputerName 'jpbraspbpi3-1' -Credential (Get-Credential -UserName 'administrator' -Message 'Mot de passe !')

# You can allow a pseudo cmd.exe command line on the Windows 10 of your Raspberry
reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher" /v AllowedExecutableFilesList /t REG_MULTI_SZ /d "c:\windows\system32\cmd.exe\0"

Then you can use developp using .NET core on Raspberry.

IF YOUR RUN RASPBIAN, you can deploy Mono and develop with visual studio or visual Code (.net core).

Upvotes: 3

Related Questions