How do I get access to live video stream remotely?

Hi!

I have set up a dynamic DNS adress from noip.com, so I have access to Octoprint via an adress like ***************.ddns.net

Everything works fine, exept for one thing:
As soon as I access my Octoprint from outside my home network, I can't see the live stream from my Rasberry Pi Camera anymore. (I can only see the live video stream when I access Octoprint from within my home network)

How do I set things up so I can see the live video stream from ouside my home network (via ***************.ddns.net) ?

Current video stream URL in Octoprint settings is set to: http://octopi:8080/?action=stream

My setup:
Prusa i3 MK3 with an RPi Zero W and a Raspberry Pi Camera v2.
OctoPrint version 1.3.8

Thanks for your help!

3 Likes

Thanks for a fast reply, foosel!
Now it works! :smiley:

Of course i should have read the FAQ before posting.. Lesson learned!

Have a nice day,

Safest thing to do is install a VPN
PiVPN makes it easy...then only one port thru your router (UDP port 1194) is open to the internet...on the device you want to log into with you install OpenVPN client...then use the key generated from the server (an .ovpn file)
https://github.com/pivpn/pivpn <- source page

Once connected...even if you are a zillion miles away...the device looks like it's sitting inside your home network thru IP tables and internal routing of the server, giving you complete encrypted access to your home network, and access to your file shares, servers, VNC, and whatever else you have hosting inside your own LAN. (and without the proper keys...noone gets in :wink: )

2 Likes

How do you transfer the .ovpn files to their clients? I have been searching and searching for instruction on this.

nvm your link told me what I needed to know, I have to have some software like WinSCP.

In the ovpns folder where you create the ovpn files run this command to make a simple file server and access via your phones web browser using your Pi's IP:8080
python -m SimpleHTTPServer 8080

That’s a nice way to throw the security out of the window... It is like buying an expensive lock and the mailing yourself the key in a transparent envelope with the return address clearly shown.

What I love is that clone-your-own-key kiosk at Fry's Electronics, for example. It takes your credit card (now they have your home address), asks you what kind of key you're making ("home"), then they accept your existing key and duplicate it for you within moments.

But then you've just given them the ability to clone another key later, drive to your house when you're not there and open it up.

Hi octopi uses the same url entered whether you are remote or local so the remote browser is looking for the same url in your case http://octopi:8080/?action=stream this is a local only address. what you can do is port forward 8080 on your router to your pi as well and change the webcam url to something like http://***************.ddns.net:8080/?action=stream then the address will resolve both inside and outside your network as long as your router supports loopback. (which most do)

Doesn't octopi come pre-configured to reverse proxy the connection if you use the url like below? Seems to work that way on my install...

http://<public ip/dns name>/webcam/?action=stream

Better yet, use a relative URL:

/webcam/?action=stream

This has been a while, but it appears that this might not work for streaming via the android app. Attempted to try: /webcam/?action=stream as well as http://publicIP/webcam/?action=stream. Couldn't get it to open up in a browser window or via the app.

You should not be using portforwarding in the first place. There’s a more secure alternative that is easy to install: Ngrok Tunnel

2 Likes

Thank you, I'll take a look.

Got it working via browser, is Octoremote android compatible with ngrok?

If it works inside your network, then it will work outside your network, you just have to configure it to use the ngrok URL.

So, are you suggesting creating a second tunnel for the webcam? I am experiencing the same problem with an orange pi on Armbian, and I think what Ngrok only redirects your printer to the port 80 of the domain. In my case, my printer uses the port 4000, and my webcam uses 8080. With the Ngrok Tunnel Plugin, I am unable to use the same tunnel URL for the webcam as it redirects "my_webcam's_local_ip:4000" to "ngrok_subdomain:80" and that means "ngork_subdomain:8080" does not lead anywhere. So, I can only insert a ngrok link into webcam URL if only i create another tunnel leading to the port 8080. Do you think there is a solution without creating a second tunnel for the webcam? Could creating a relative path solve the issue?

I apologize if I misspoke. This will work for the majority of people which are using an octopi image or have implemented a reverse proxy similar to octopi's haproxy and are redirecting the standard port 80/443 and webcam stream urls. If your setup does not have the reverse proxy in place then it will not work for you I don't believe.