我正在开发一个结合了 Visual Studio 应用程序和树莓派的项目。
有没有一种简单的方法可以通过 C# Visual Studio 程序在树莓派上运行终端程序(如“python script.py”)并检索结果?
最佳答案
如果您在 Raspberry 上运行 Windows 10。
您可以在运行 Windows 10 的 Raspberry 上通过以下方式使用远程 Powershell:
# 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"
然后你可以使用 developp 使用 .NET core on Raspberry .
如果您运行 RASPBIAN,您可以 deploy Mono并使用 visual studio 或 visual Code (.net core) 进行开发。
关于c# - 我可以获得 C# Visual Studio 程序来控制树莓派吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47785602/