How do you code for a headless RPi system?

I’m sure I’m not the only one using a headless Raspberry Pi for my Home Assistant build. I’m curious to hear how other people code for this configuration.

After trying a few different things, I’ve settled on SSHFS. I’m on Linux (openSUSE), but this can be accomplished on Windows and Macs as well. I won’t go into the details of how to do it on those systems, honestly because I don’t know how. Google is your friend.

What it comes down to is using SSH to create a “drive” and mounting it like an external hard drive. You can then use your favorite editor or IDE to work on your HA system. I’ve got a tiny script to issue the SSH commands to establish the connection. I’ve also set up SSH between the two systems with key exchange so I don’t need to put in a password.

Then I can use my favorite editor (Sublime) to do my coding. The only bummer is that the connection breaks each time I close my laptop. It makes perfect sense, but it means I’ve got to reconnect the virtual drive.

How do the rest of you do it?

I have a test setup in a virtual machine on my desktop, where I do all development.

When I have finished testing, everything is transferred via git. Any local editing is done with vim.

I bow in respect to those who can use vim.

2 Likes

The first 25 years are the hardest :smile:

1 Like

Pfffft. vi is where it’s at. :slight_smile:

Hassio is headless but easy enough to configure through the SAMBA or SSH addons.

I also have a headless Pi that runs a GPIO MQTT client in a venv. I use a combination of SSH and VNC to administer it.

I’m using a headless mini-itx system, and use emacs with a component called tramp that lets me open files on a remote system to edit them. It looks like sublime edit, textmate, and atom have plugins providing remote file editing support as well

nano or mcedit

HASS itself is written in python, which is multi platform, so I code and test on my laptop/desktop.

Sometime ago I was developing an application to receive temperature sensor data from battery-powered nodes using NRF24L01 chips. This was done in C/C++, so for that project I was coding on my laptop, and using syncthing to automatically sync the source code to the Raspberry where I did the compilation and testing.