raspberryediting

Editing code on a Raspberry PI remotely from Windows

Here’s a simple way to set up a workflow for editing code in your favourite editor on windows and have it deployed to a Raspberry PI (or any other linux machine for that matter).

First, you need to enable SSH in raspi-config.

Download and install WinSCP http://winscp.net/. Select the Explorer style preference when installning.

In WinSCP, add a new site entry using default settings

Make sure the user you use to connect can edit the files. Set the user as owner using this command;

sudo chown -R yourusername: /opt/deploy/yourprojectfolder

Connect in WinSCP, right click to edit a file, configure to use editor of choice. When saving the file it is automatically transferred to the server.

If you run node using nodemon the app is restarted when a file in the app folder changes.

npm install -g nodemon
sudo nodemon app.js

That’s it.