SurferTim
Posts: 875
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: port forwarding

Sun Jun 18, 2017 6:16 pm

If that is the correct IP, it doesn't even respond to a ping.

User avatar
DougieLawson
Posts: 29790
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: port forwarding

Sun Jun 18, 2017 6:24 pm

Can you try
traceroute -n 8.8.8.8
and post the results on here.

Can you try running this python3 program

Code: Select all

#!/usr/bin/python3
import socket
import os
testIP = "8.8.8.8"
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect((testIP, 0))
ipaddr = s.getsockname()[0]
host = socket.gethostname()
print ("IP:", ipaddr, " Host:", host)

import urllib.request
hp = urllib.request.urlopen("http://"+ipaddr+"/")
print (hp.reason)
print (hp.status)
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Sun Jun 18, 2017 8:45 pm

I decided to try using my modem instead I have a tp-link tc-7610 does anybody know if it's possible to set up port forwarding on this?????

SurferTim
Posts: 875
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: port forwarding

Sun Jun 18, 2017 9:35 pm

If the TP-Link router gets an IP from the modem, then yes, you can. Set the RPi to dhcp and see what IP it gets.

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Mon Jun 19, 2017 1:22 am

Ok how do I set it to dhcp???

SurferTim
Posts: 875
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: port forwarding

Mon Jun 19, 2017 1:28 am

Remove the static settings in /etc/dhcpcd.conf.

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Mon Jun 19, 2017 3:13 am

I got the results for Dougie Lawson's python3 code but I am having a hard time uploading the file

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Mon Jun 19, 2017 1:58 pm

results from Dougie lawsons previous post hope this helps



IP: 192.168.0.104 Host: raspberrypi
Traceback (most recent call last):
File "/usr/lib/python3.4/urllib/request.py", line 1174, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.4/http/client.py", line 1090, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.4/http/client.py", line 1128, in _send_request
self.endheaders(body)
File "/usr/lib/python3.4/http/client.py", line 1086, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.4/http/client.py", line 924, in _send_output
self.send(msg)
File "/usr/lib/python3.4/http/client.py", line 859, in send
self.connect()
File "/usr/lib/python3.4/http/client.py", line 836, in connect
self.timeout, self.source_address)
File "/usr/lib/python3.4/socket.py", line 509, in create_connection
raise err
File "/usr/lib/python3.4/socket.py", line 500, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/Austin .py", line 12, in <module>
hp = urllib.request.urlopen("http://"+ipaddr+"/")
File "/usr/lib/python3.4/urllib/request.py", line 153, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.4/urllib/request.py", line 455, in open
response = self._open(req, data)
File "/usr/lib/python3.4/urllib/request.py", line 473, in _open
'_open', req)
File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
File "/usr/lib/python3.4/urllib/request.py", line 1202, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.4/urllib/request.py", line 1176, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
>>>

User avatar
DougieLawson
Posts: 29790
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: port forwarding

Mon Jun 19, 2017 5:08 pm

Your Raspberry isn't running a web server on port 80 if you get ERRNO 111. My python3 program gets the IP address for your RPi, then attempts to fetch the web-server's home page from that address.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Mon Jun 19, 2017 6:27 pm

Ok Does my windows firewall have anything to do with this??? because I think it's blocking everything and I don't know how to access it

B.Goode
Posts: 4406
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: port forwarding

Mon Jun 19, 2017 6:41 pm

hockeydudesdad wrote:Does my windows firewall have anything to do with this???
You will have to tell us, because you haven't mentioned a Windows system previously as far as I can see.

I thought you wanted the Rest of The World to be able to access your RPi by setting up port forwarding on your Internet router?

Can you provide a word sketch of how your Windows system fits into your network topology, and how it would affect traffic flowing to and from your RPi?

User avatar
DougieLawson
Posts: 29790
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: port forwarding

Mon Jun 19, 2017 8:35 pm

Is it safe to assume you ran my python3 program on your Raspberry?
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Mon Jun 19, 2017 9:58 pm

Yes I ran it I'm not sure why it didn't work or how to fix it.

User avatar
DougieLawson
Posts: 29790
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: port forwarding

Mon Jun 19, 2017 10:09 pm

When my program works you should get something like

Code: Select all

pi@viking /tmp $ python3 ./checkWWW.py
IP: 192.168.3.14  Host: viking
OK
200
pi@viking /tmp $
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Mon Jun 19, 2017 11:55 pm

I finally got it working However my camera keeps shutting off automatically how do I fix this?????

klricks
Posts: 4765
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: port forwarding

Tue Jun 20, 2017 1:39 am

hockeydudesdad wrote:I finally got it working However my camera keeps shutting off automatically how do I fix this?????
Please tell us and whoever stumbles (Googles) across this thread, what it was that fixed your issue.

It would be best to start a new thread about your camera issue. Be sure to give lots of details so people can help you without having to guess. eg what camera brand and model with link? How is it connected? Power supply specs? OS installed? etc.
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://blackeagle12.net/Comp/RPi/Rpi.html Click contact icon then world icon --->

hockeydudesdad
Posts: 45
Joined: Mon Jan 16, 2017 4:22 pm

Re: port forwarding

Tue Jun 20, 2017 2:07 am

I set up port forwarding but I used the public Ip address assigned to my computer instead of the local ip address of my pi. I hope this makes sense and I hope this helps

Return to “Troubleshooting”

Who is online

Users browsing this forum: k-pi and 62 guests