3

I am trying to view a live stream from the raspberry pi remotely. I am using motion software to record and stream the video. I am able to view the video locally. I am trying to view it remotely by following some tutorials on the net regarding using reverse ssh tunnels. These are the steps I am using below to view the stream:

Note: I have rented a server with static IP on aws and referring to the same below.

I have a USB camera connected and motion software running and wvdial running (3g dongle).

From the PI's terminal, typed the following :

ifconfig



ppp0      Link encap:Point-to-Point Protocol
          inet addr:100.106.202.59  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:224 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:9585 (9.3 KiB)  TX bytes:11292 (11.0 KiB)

Then typed in:

sudo autossh -M 65500 -o ServerAliveInterval=20 -L 16090:100.106.202.59:8081 -R 2222:localhost:22 user@server

The pi was now logged into my server.

Next, from the server (logged in via putty) I typed in:

ssh -p 2222 pi@127.0.0.1

And I was able to login to the pi.

Now, I opened up a browser on my windows laptop connected to the internet (different network) and typed in

myserveripaddress:16090

And nothing showed up in the browser. Please let me know where I am going wrong or if there is some alternate method to do this ?

1
  • Is is possible top use a socks-proxy? If yes: 1. Start ssh (on the client side) with the options to setup a socks-proxy. 2. Configure your browser to use this proxy 3. ??? 4. Profit :) -> askubuntu.com/questions/469582/…
    – MadMike
    Mar 16, 2017 at 9:19

3 Answers 3

1

If you are looking to get access to the Pi with a floating IP (due to 3G dongle), I see two good options.

  1. As ElefantPhace commented, Use ddns of some sort to create a statically available Domain name. This solution may not work if the 3G hotspot acts as a router and doesnt have port forwarding.

  2. Run an OpenVPN server instance on your AWS Server and Connect to that with your Pi. This should give you and IP on the OpenVPN Virtual Lan of 10.8.0.[something] with the aws server being 10.8.0.1. Then you can SSH and Port forward as normal!

Hope this helps!

-1

I can give you an alternate method that works in different platforms and devices. Use Virtual Network Computing. Set up a VNC Server on your rpi and then download a VNC client in your PC or mobile device. Create a connention and here you go!

Another thing you can try is install TeamViewer for raspberry. It's a beta for unattended access. Then you will be able to see everything going on your raspberry including the live feed you want. Get it from here (official site).

4
  • But again if I use this , I need the IP address of the pi (which I dont know as its connected via 3g dongle ppp) to login from the client. This is the issue.
    – bobdxcool
    Sep 23, 2016 at 16:38
  • Then use the team viewer Sep 23, 2016 at 18:42
  • 1
    Or use ddns and get a free noip.com or others domain name Dec 4, 2016 at 4:54
  • I don't think he is asking about a remote desktop software, when he already uses a motion software to record video.
    – allo
    Aug 6, 2020 at 21:15
-1

First thing you should do is make your Raspberry pi's IP static. So that whenever you power up your Raspberry pi it should connect to your access point(Hotspot).

Connect to your Access point. Type ifconfig in raspberry pi's terminal and enter that IP address below, in my case it was 192.168.43.233

Start by editing the dhcpcd.conf file

sudo nano /etc/dhcpcd.conf

Scroll all the way to the bottom and add this lines at the end as per your connection (wired or wireless).

interface eth0

static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1


interface wlan0
static ip_address=192.168.43.233/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Press Ctrl+x to save and reboot. Now power up your raspberry pi and it will automatically connect to your access point.

Installing VNC server

sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

Now enable VNC and SSH from configuration settings

sudo raspi-config

From your computer/laptop's terminal

sudo ssh pi@192.168.43.233

You'll get remote access to raspberry pi's terminal And from raspberry pi's terminal start vnc server

sudo vncserver :1 -geometry 900x900 -depth -24

Now start VNC viewer in your laptop and connect to raspberry pi using pi's credentials

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.