Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing issue to the Pi #9

Open
aardrasystems opened this issue Apr 25, 2023 · 12 comments
Open

Publishing issue to the Pi #9

aardrasystems opened this issue Apr 25, 2023 · 12 comments

Comments

@aardrasystems
Copy link

aardrasystems commented Apr 25, 2023

Hi @gloveboxes

I am following your example as shown on

https://github.com/gloveboxes/Create-RaspberryPi-dotNET-Core-C-Sharp-IoT-Applications/blob/master/labs/Lab_1_Build_dot_NET_Core_app/README.md

I am having difficulty clarifying if my steps are correct. This is the error I am getting.

 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\potained -c Debug -o ./bin/linux-arm/publish ./dotnet.core.iot.csharp.cspnet.core.iot.csharp"" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: sh -c "dotnet publish -r linux-arm --self-containedroj && rsync -rvuz ./bin/linux-arm/publish/ djosh@raspberrypi:~/dotnet.

At line:1 char:122
+ ... -o ./bin/linux-arm/publish ./dotnet.core.iot.csharp.csproj && rsy
+                                                                ~~
The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorR
    + FullyQualifiedErrorId : InvalidEndOfLine
 

 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\potained -c Release -o ./bin/linux-arm/publish ./dotnet.core.iot.csharp.cotnet.core.iot.csharp"" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

I have Windows 10 PC and have already got .net6 installed. Therefore do I need to reinstall it via WSL again?

What could be wrong?

Should "usr" also need to be changed
"pipeProgram": "/usr/bin/ssh",

@gloveboxes
Copy link
Owner

Hi there, you have to run in the context of wsl2 on windows. It uses Linux utilities to sync code... cheers Dave

@aardrasystems
Copy link
Author

aardrasystems commented Apr 25, 2023

Thank You @gloveboxes for your reply. I am fairly new to Linux.

So how do I run this in the context of wsl2 on windows?

Is there any video tutorial to take me through the process?

@gloveboxes
Copy link
Owner

Hi, the docs do step you through using wsl on windows. If your new to wsl, search YouTube, there are a lot of videos that intro wsl. Cheers Dave

@aardrasystems
Copy link
Author

@gloveboxes Thanks, i will check it out

Is this the simplest setup for programming for raspberry pi when using c#?

We aim to interface with USB will .net handle both Windows and Unix drivers?

@gloveboxes
Copy link
Owner

Hi from all the research I did, this is the easiest way on windows. I've not tried usb but I see no reason why you can't call out to a Linux usb driver...

@aardrasystems
Copy link
Author

Thanks, @gloveboxes

So if I have understood it correctly, with WSL or WSL2, it would be as if I am running/coding on a Linux OS. Then with the VSC extension, it would be as if VSC code is running on Linux even though it's installed on Windows.

I hope I am correct

@gloveboxes
Copy link
Owner

Yup, spot on.

@aardrasystems
Copy link
Author

@gloveboxes, Thank You for your help.

Few last questions before I close for the day(located in UK)
..
The tutorial you refer to is "command prompt." is that the Windows CMD prompt when you type "cmd" or Linux when you type "WSL" in the search bar?

And you also mention installing .net core. My PC has already got .net, so I am presuming this installation is for the Linux environment.

@gloveboxes
Copy link
Owner

Hi, yes, and windows command prompt, cmd or powerful and then launch wsl. Then install .net in wsl.

@aardrasystems
Copy link
Author

@gloveboxes
Does it make a difference what Rasberrypi used? I am using the Zero 2W. As the task and launch refer to ARM32 or ARM64, I am correct Zero 2W is based on a different arm,

@gloveboxes
Copy link
Owner

I'm pretty sure that chip can run both raspberry pi os 32 and 64 bit. So select the arm architecture that matches the os you installed on the raspberry Pi.

@aardrasystems
Copy link
Author

@gloveboxes Thanks I will check that out again,

I will try that tomorrow.

It seems I am able to transfer the code to the pi, but then the pi hangs after starting .net debugger and all I see is:

Starting: "/usr/bin/ssh" djosh@raspberrypi "~/vsdbg/vsdbg --interpreter=vscode"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants