Here is my Pi code:
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ip = "PC's ip address" port = 5005 serverAddress = (ip, port) socket.bind(serverAddress) socket.listen(1) print("Waiting for connection") connection, add = socket.accept() data = connection.recv(2048)
Here is my PC code
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ip = "PC's ip address" port = 5005 serverAddress = (ip, port) socket.connect(serverAddress) message = "Hello".encode() socket.send(message)
When I run the pi code (first), I get the following error "Bind Failed" and then it just waits. I then run the PC code, and I get the following error "[Winerror 10061] No connection could be made because the target machine actively refused it"
Has anyone ever run into this problem before? I have spent hours trying to figure this out and I have no idea what is wrong. I am guessing it has something to do with what IP address I am using and/or the configuration of Ethernet, but I really don't know. Any help would be appreciated. Thanks!