element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry pi IP camera using USB 3G Modem
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 8 replies
  • Subscribers 677 subscribers
  • Views 2217 views
  • Users 0 members are here
  • raspberry_pi
  • raspberrypi
  • ipcamera
  • 3g
Related

Raspberry pi IP camera using USB 3G Modem

bhuvan
bhuvan over 11 years ago

Hi guys

 

I am looking to build a video monitoring system using raspberry pi. I used the motion software, and it worked well with ethernet.

 

Now, I am want to get it working with a 3G USB dongle. I am using a ZTE MF70 3G modem.

 

The problem is that with a 3G dongle, the IP address keeps on changing. How can I overcome this problem ? Is there a software or something to do so. I want the camera to always use the same IP address and port.

 

Or is there anything other than motion that I can use ??

 

Please help.

  • Sign in to reply
  • Cancel
  • crosseyejack
    0 crosseyejack over 11 years ago

    OK. Going to explain why this won't be as simple as you are thinking first. But I will give you some light at the end of the tunnel if you can make it to the end of the post. I want to try and help you understand the problem you are facing so you will be better tooled up to deal with the problem.

     

    This will be Network dependent. Sure there are virtual networks that can offer public facing or VPN connections for mobile connections (M2M - Machine to Machine) but I'm guessing you are going to be sticking to more public mobile networks.

     

    In the UK Ever Mobile network I have used use something called Carrier Grade Network Address Translation. Basically Its like your router at home but for the whole network (Well they normally use a few, but to keep it simple lets pretend they just use one, like who most people only have one router at home). This CGNAT is the public facing internet connection and allows the devices connected behind it to access the internet though Address Translation. Just like how most home connections only have one Public IP address but can have many devices connected to it.

     

    This offers the network a number of benefits.

    1) With IPv4 addresses running low it allows them to give internet access to many many devices using just a tiny handful of IP addresses

    2) (In the UK at least) Mobile internet providers have to provide an adult content filter with this filter turned on by default if you have yet to prove you are over the age of 18 (You can pick up pre-paid sim cards for pennies in pretty much any corner store in the UK with no ID check) can having all the internet connected devices connected via an NAT makes it much easier to provide such a filter (Just like how your home router can offer website filtering if you look in its management control panel).

    3) It basically provides a free firewall for the connected devices with the added bonus of making it much harder to run servers off mobile connections. With no port forwarding set no outside device can say to your network provider "Hey I wish to connect to your customers mobile phone which just so happens to be running lighttpd".


    "But Jimmy... My mobile phone supports push messaging so when I get an email, a facebook notification or my friends nagging me to play candy crush my phone beeps right away heck even SMS's come through right away..."

    To conquer the "Behind the NAT" problem there have been many solutions. First lets get SMS out of the way, SMS pushes are actually a part of the network connection your mobile device has with the network. They are pushed by the network and have nothing to do with the CGNAT.

    But yes, there are ways to get data from the internet onto your device almost instantly. This is done by using persistent connections. What happens is that your phone once its connected to your Network Provider and figured out it has an internet connection will open an persistent keep alive connection with the people who are provided such "Push Message" systems, listen for any new messages and just keep the connection alive and make sure the connection hasn't dropped, it will send a little heartbeat message every so often.

    Once a new notification or push message is due to be sent to your device it is first sent to your push message provider who then finds which of its open connections it has is your device and says to it "Hey wake up, I've got data for you".

     

    And its this you need to replicate. Now I've not done this in a while so I am more than rusty but what it sounds like you need is something called "Reverse SSH Tunneling" It involves having another machine running (Which could be a machine at home running on wired broadband connection which you can open the ports too or a cheap VPS) which sits there listening for the connection from the mobile connected raspberry pi. You can then connect to this publicly accessible machine from anywhere else on the internet and access the content you seek (It doesn't just have to be video but anything really). Once you have got the basics down while creating this system at home, you can then put in some simple scripts that will a) connect automatically on boot to your "relay" machine b) make sure the connection stays up by sending a small handshake every so often and forcing a reconnect if the connection drops.

     

    EDIT: If you happen to be on a mobile provide that doesn't put you behind a CGNAT then you could use https://duckdns.org/ for a free DDNS service. They have simple to use scripts that will help you auto update the DDNS from the pi. https://duckdns.org/install.jsp Personally I have my own hosted server and domain names so I just use nsupdate and dnssec keys to update my own DDNS. But note. if you are behind a CGNAT you will have to deal with the port forwarding issue.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago

    some device not support on raspberry pi, such as 3g modem , powered hub, web cam etc

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crosseyejack
    0 crosseyejack over 11 years ago in reply to Former Member

    But a wide selection are. As OP as posted that their project is working well on home ethernet and that they are getting an internet connection but changing IP on their 3g modem I think that OP already has working devices but is just trying to access said devices via the 3G connection.

     

    OP Just a random idea that popped into my head. What you could do is have the webcam stream to a server such as a rtsp ingress server and trigger the upload via a email trigger.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Problemchild
    0 Problemchild over 11 years ago in reply to crosseyejack

    Got to agree with Crosseyejack's description. the 3G is most often NAT'd and don't expect the same IP all the time just not going to happen unless you are buying a special service in which you'd be paying more and better off working around it. You would be better off getting your RPI to connect to  you rather than vice versa if your network is also not fixed I would suggest using a Dynamic DNS service to register the home IP. Your Firewall could then be configured to allow connections from the remote cameras.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crosseyejack
    0 crosseyejack over 11 years ago in reply to Problemchild

    As for Dynamic DNS service DuckDNS (https://duckdns.org/) is popular over on http://www.reddit.com/r/raspberry_pi I've yet to use it as I have access to my own domain names and DNS servers but from what I have read it been getting great reviews.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago

    Try http://www.noip.com/ they give you a static domain name and update their system when your IP address changes.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crosseyejack
    0 crosseyejack over 11 years ago in reply to Former Member

    The only problem with NoIP is they are currently being subjected to a temporary restraining order by Microsoft http://blogs.technet.com/b/microsoft_blog/archive/2014/06/30/microsoft-takes-on-global-cybercrime-epidemic-in-tenth-malware-disruption.aspx Hopefully its only temporary but many of NoIP's domain names are currently pointing to Microsofts DNS Servers and not NoIP's so these domains can not be updated by users of the service.

     

    dig @8.8.8.8 NS no-ip.biz

     

    ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> @8.8.8.8 NS no-ip.biz

    ; (1 server found)

    ;; global options: +cmd

    ;; Got answer:

    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33427

    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

     

    ;; QUESTION SECTION:

    ;no-ip.biz.                     IN      NS

     

    ;; ANSWER SECTION:

    no-ip.biz.              12423   IN      NS      ns8.microsoftinternetsafety.net.

    no-ip.biz.              12423   IN      NS      ns7.microsoftinternetsafety.net.

     

    ;; Query time: 32 msec

    ;; SERVER: 8.8.8.8#53(8.8.8.8)

    ;; WHEN: Wed Jul  2 11:33:34 2014

    ;; MSG SIZE  rcvd: 90

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mender331
    0 mender331 over 6 years ago

    You can use motion eye with carrier grade nat if you install remote3.it (used to be called weaved)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube