Control / viewing from online domain


#1

I've searched around a bit online and on this forum and I couldn't find anything on someone setting up octoprint to relay images / video from their pi to a web server that is accessible by the internet.
I've seen some of the plugins that allow people to upload images to discord and other networks.
Does anyone have a plugin name that I can input my own ftp server to send files to and from
an added bonus if I can control the printer from the domain as well (obviously password protected)
Thanks so much my doods
Edit: I forgot to mention that I need it to be without port forwarding as I am not the owner of the network I'm connected to however I do own my own web domain and it is hosted for me so I can send it to there


#2

Brainstorming here for a moment (without thinking too much about the security aspects)...

  • If you had a hybrid hardware/software VPN from your public host to the OctoPi instance's network, then the public server could itself just pull the snapshot/video directly and then re-publish it. One might create a dedicated Raspberry Pi on that network to serve as a hardware VPN endpoint. The I.T. people there wouldn't like that you're doing this, of course.

  • Uploading the snapshots would be a little a lot easier, I'd guess.

  • haproxy is part of OctoPrint, for what it's worth.

  • Whatever this is, if it's not a VPN then it reasonably has to be a push model where something internally is uploading rather than something outside is trying to download.

  • This might be as simple as a Python script that runs on the Raspberry.

Pseudo-code...

# Verify that you can talk to the public server
loop
  curl local image
  scp local image to public server
  sleep for 30 seconds

#3

This is where you could utilize event hooks in config.yaml. Similar to the YouTube-Uploader on the old cookbook wiki page.

I'm sure @OutsourcedGuru could provide the commands to upload a file via ftp and then assign that to the CaptureDone event. I assume that something like wput {file} ftp://[username[:password]@]hostname[:port][/[path/][file]] would work.

Then when you have timelapse enabled it will upload a snapshot to your ftp server every time a snapshot is taken for use in timelapse generation. Be warned this could potentially get pretty big if you have your snapshot interval really short.

I'd lean towards using Astroprint Cloud it sees to be the easiest method to tunnel communication between networks for the layman.


#4

I suppose it could be ftp. I'm fond of scp since it's already loaded in the Raspbian Stretch image.

scp version

echo hi> hi.txt
scp hi.txt pi@octopi.local:~/.          # The local file hi.txt arrives to the home directory

In a case like this, I would generate a keypair on the Raspi and push the public key to the remote server. That way, you wouldn't have to include a raw password for scp, for example.

From the Raspberry

ssh-keygen -t rsa -b 2048     # Go with defaults, no passwords
ssh-copy-id -i ~/.ssh/id_rsa.pub user@my.publicserver.com