2

I have configured a Raspberry Pi to be client, and my personal computer to be TCP server, and trying to connect to server via an ethernet cable. On my personal computer I use Comm Operator and select port "1234". Raspberry Pi (TCP client) has following setup:

auto eth0
iface eth0 inet static
 address 192.168.20.45
 netmask 255.255.255.0
 gateway 192.168.20.1

Raspberry Pi (TCP client) has the following script to connect:

import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('192.168.20.48',1234))

And frankly, it get stuck in the connect step, doesnt even get past that. On the TCP server side running on Windows, IPv4 setup is as follows:

192.168.20.48
255.255.255.0
192.168.20.1

with Google DNS

8.8.8.8
8.8.4.4

Weird thing is that it works the other way around, if I set up my computer as client and connect to raspberry pi. Could you give me some ideas as to what could be the problem? I really could use some opinion. Thanks in advance to everyone.

asked Oct 14, 2016 at 19:52
2
  • 1
    Do you have a firewall on your computer? Commented Oct 14, 2016 at 19:56
  • Apparently I did, now its working fine. Thanks :)) Commented Oct 14, 2016 at 20:24

1 Answer 1

2

You probably have a firewall running on your computer. Disable it or open up the desired port.

answered Oct 14, 2016 at 21:29
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.