Anyone Using PiVPN with Octoprint?

Anyone out there running PiVPN on the same Pi as their Octoprint?

I have Octoprint running with TouchUI and the official 7" touchscreen, and everything is working fine.

I tried to install PiVPN, and it seems to install fine, and when it gets to the end, it tells me to run "pivpn add" to add clients. However, when I try "pivpn add" I get the error "-bash: pivpn: command not found."

I've completely wiped my sd card and reinstalled Octoprint with touchui, and everything works fine. I tried installing PiVPN again, and get the same error.

Any suggestions?

Thanks.

It sounds like the pivpn executable or script isn't in the pi user's PATH. If it were me, I'd try to find it:

sudo find / -name pivpn 2> /dev/null
1 Like

Ok, I gave that a try, and what it found was two directories: /etc/pivpn and opt/pivpn

Any ideas why it won't install correctly?

The first one would contain the configuration information for pivpn, the second one has the actual executable itself.

You might now try /opt/pivpn add"

Ok, i gave that a try, and what I get is: "-bash: /opt/pivpn: Is a directory"

Alright, do an ls -l /opt/pivpn and see what's in that folder. It might instead need to be /opt/pivpn/pivpn or /opt/pivpn/bin/pivpn or whatever.

Ok, I tried that, and the result I get is "total 0."

I've come to the conclusion (based on my experimenting and with another user's post here about PiVPN issues) that PiVPN won't run on the barebones OS that gets installed when Octoprint is installed on a Pi.

I have another Pi that has Raspian on it. I ran the PiVPN install, and it worked perfectly on that one, so I'm using it as my VPN server.

Thanks everyone for your assistance.

1 Like

I found a solution. On the bottom of this page

before you install Pivpn from pivpn.dev... not pivpn.io run

sudo rm /root/bin/git

this makes the installer work with this Distro. If you read thru all the gibberish on the page, evidently someone disabled running the git command from sudo, which makes the installer fail. I tried running the installer several times before finding this page, doing that one command, then running the installer successfully. I'm still working on it, but I was able to produce a key using "pivpn add" so far.