Tested Raspberry Pi
Author | dglover@microsoft.com |
---|---|
Platform | Raspberry Pi |
Language | Tested with Python 3 |
Visual Studio Code | Version 1.25.1 |
Date | 28 July 2018 |
- Install Visual Studio Code
- Install the Python Extension
pip3 install ptvsd==3.0.0
See Python Remote Debugging for more information.
ssh-keygen -t rsa
ssh-copy-id pi@xxx.xxx.xxx.xxx
On your developer desktop machine mount the Raspberry Pi file system and create your project on this mounted drive - ie on the Raspberry Pi.
For Linux
sudo apt-get install sshfs
sudo mkdir /mnt/rpi3plus
sudo sshfs -o allow_other -o IdentityFile=~/.ssh/id_rsa pi@xxx.xxx.xxx.xxx:/home/pi /mnt/rpi3plus
For Windows and macOS see How To Use SSHFS to Mount Remote File Systems Over SSH
- See tasks.json for two tasks. One to start the python app on the Raspberry Pi, the other to close when you detach the Python debugger.
- See launch.json - Python Raspberry Pi: Attach. Select and run from Debug tab