I am developing a python application to run on a raspberry pi. Obviously, I can't run visual studio on my raspberry pi. Is there any way to set up my pi (running raspbian) to be the debugging target, so that on my windows machine (with vs) I can write the code and get the output, but the code executes on the pi?
I've used visual studio to debug apps running on android, so I'm looking for something similar, and I would like if it were real time, so that debugging features such as breakpoints worked as well.
Edit for clarification: This already exists for c# and others, just looking for this for python: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019
can you use putty on your windows machine to ssh connect to raspberry pi and run you code that way. You could use notepad++ or geanie to write your code on windows first or open the editor nano on raspberry pi to write your code.
Related
I have a rasparm robot by adeept it has a power electronics unit provided by the company and it is connected to raspberry pi3b+. adeept has online tutorial to run the robots and already written python files which we need to run in raspberry pi in order to make the robot run.
Its running when I am running the python codes in raspberry pi.
But when I am running the same codes in pc via MATLAB its not working. I am calling the python codes provided by adeept from MATLAB and trying to run it, it showing some errors. I have already instled all the libraries which was required to run the code.
I want to use adafruit_pca9865 library and call it with MATLAB and deploy the code to raspberry to make it running.
But when I am calling the python code to run servo from MATLAB i am getting the error shown in screenshot.
when I am trying to run python code directly then also I am getting this error. I have also installed proc and cpuinfo library and added to the folders required.
screenshot of error
I'm trying to use the VS Code remote debug feature (debugpy).
My problem is that my code to connect needs to be the client and VS Code needs to be the server.
Why? Because I can't modify the command line of my python "container" (It's an embedded version of python into another process). So I simply want to execute a command in my py code, which, then, connects to my debug server that has been startet in VS Code.
Is that possible? I know that this works in PyCharm professional, but I can't get it done in VS Code.
Thanks!
So, I want to be able to write Python code in my Visual Studio Code on my Windows PC. On my network is a raspberry pi 4, which I would like to execute said code on and receive any errors or output from.
Is it possible for me to write some python code on my Windows PC, "run" it on the Raspberry pi, and receive any outputs of the program on my Windows PC?
The reason I wish to do this is that Visual Studio Code generally helps me write any code, and it is more time consuming for me to use other IDE's, and my code uses PyBluez, something I can't just test on my Windows PC (which has no Bluetooth module)
I hope my question is in the right format and such! This is my first time posting! Any comments appreciated!
Yes you can do that, but it might not be very straight forward. In order to achieve this, you need your Raspberry Pi to be on the same network as your Windows PC (i.e. on the same WiFi network or connected via Ethernet). Then you need to get the IP address of your Raspberry Pi through the following command:-
ifconfig -a
The IP address will be of the following format: W.X.Y.Z
Now from your Windows PC, you can send your python script/scripts through the following command from cmd:-
scp script.py pi#W.X.Y.Z:/home/
And then you can access your Raspberry Pi and run the program by sshing into it through the following commands from cmd:-
ssh pi#W.X.Y.Z
You'll need to enter the Raspberry Pi's password for both commands above, but after that you should have your script on your Pi and you should be able to run it there from your Windows PC.
The links below have more verbose explanation:-
https://www.raspberrypi.org/documentation/remote-access/ip-address.md
https://www.raspberrypi.org/documentation/remote-access/ssh/scp.md
https://www.raspberrypi.org/documentation/remote-access/ssh/
I hope this helps.
It seems that my answer was to use the Remote Development pack on Visual Studio Code (it's an extension) to ssh into my raspberry pi. It's worked well for me for the past few days, and I highly recommend it. It allowed me to access the entire sd card and access any files I need to, while also giving me an SSH terminal and run the program ON the other machine.
For anyone who does this; set up the whole ssh key thing, to stop having to give the password to the pi so often.
The scp command would also work, I think, but is more complex than what I want to do.
Thank you so much for the answer, JL Peyret!
I am using a Raspberry Pi zero that runs on Rasbpian, and am connecting it with a computer, through a transceiver. I use minicom on the Raspberry Pi and Putty on the laptop to second documents.
I wrote some code that automatically generates files in a folder, and want to send those files through serial to my laptop the moment they are generated. I've heard that I can use rsync for this, but only read about people using it with SSH. One friend advised using piping, but I am new to this, so did not understand how to use piping with rsync.
I am trying to deploy my first Python project onto a Raspberry Pi 2 B via Visual Studio 2015 Community Edition. The Pi runs Windows 10 Core IoT and I can connect to it via SSH and the web interface with no problem.
My issue is that I get Error DEP6200 during deployment. VS asks for a PIN during deployment that I cannot provide. It's not the OS's login password nor any standard PIN you might expect (eg 0000 or 1234).
Any hint is appreciated.
try changing Authentication to None in App Properties while deploying/ debugging.
Can be found Debug -> Properties -> Authentication (Select 'None')
I was still getting errors after switching the authentication to "None". I had to add the port number after the remote machine name.
MyPi3:8116
I also noticed that msvcmon.exe was running as administrator on the pi. I switched it to run as the DefaultAccount. I'm not sure if this was necessary. I'll switch it back to administrator later. You can shut it down from the processes link then on the debugging link, start it back up and check the box for DefaultAccount.