I run the same Python program on Raspberry and Windows laptop to listen to a blood pressure device over peer2peer UTP cable (no router).
import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('', 281)) # sudo required but provided s.listen(5) conn, addr = s.accept()
The program works on laptop, the same program copied to Raspberry Pi 3B+ does not work: no exceptions, but no accepted incoming connection either.
I use superuser rights (sudo), Python 3.7.3.
Raspberry has both a WiFi and wired connection (where it listens to different ports)
I can ping the device (using -I eth0) so the network connection should be there.
I did not install a firewall - checked and it is disabled.
what am I doing wrong?
can I somehow specify that the socket should be over cable/eth0/wifi/wlan0?
I think it is related to IP traffic: I think my socket listens to wlan0 but traffic is expected via eth0.
Responses must also be returned via eth0.
How could I easily check this/configure this?