I'm trying to access my phone camera using IP Webcam android app. I'm programming Pi using my laptop via Remote Desktop Connection with a static IP set for Pi. Also I tried to stream webcam from Pi's chromium browser showing connection timed out. I'm able to stream the cam from my laptop's Firefox browser.

Code given below is throwing some error.

import urllib
import cv2
import numpy as np


while True:

    # all the opencv processing is done here
    if ord('q')==cv2.waitKey(10):

The following error is shown

Traceback (most recent call last):
  File "/home/pi/Desktop/New.py", line 8, in <module>
  File "/usr/lib/python2.7/urllib.py", line 87, in urlopen
    return opener.open(url)
  File "/usr/lib/python2.7/urllib.py", line 213, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.7/urllib.py", line 350, in open_http
  File "/usr/lib/python2.7/httplib.py", line 1038, in endheaders
  File "/usr/lib/python2.7/httplib.py", line 882, in _send_output
  File "/usr/lib/python2.7/httplib.py", line 844, in send
  File "/usr/lib/python2.7/httplib.py", line 821, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
IOError: [Errno socket error] [Errno 110] Connection timed out

Also I tried to stream webcam from Pi's chromium browser showing connection timed out.

This is the core of your problem: the Pi has no access to the camera over the network. You need to diagnose your network and find out what's wrong. I would start by running


to see how data is routed.

  • It's showing the following things only. traceroute to (, 30 hops max, 60 byte packets 1 * * * 2 * * * 3 * * * .........
    – smc
    Mar 28 '18 at 13:33
  • What's your Pi's IP address? How does the routing table (route -n) look like? Mar 28 '18 at 14:12
  • Pi's IP is Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface UG 303 0 0 wlan0 U 303 0 0 wlan0 U 202 0 0 eth0 I'm not able to paste above info in correct format please view in editor
    – smc
    Mar 28 '18 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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