I am a control engineer and i am trying to communicate with a sensor I have spoken to the manufacturer but they cannot help with the python side.I am trying to send a message to the sensor which tells it to connect. The sensors config is ip192.168.60.3 port 9008 the PC client config inside the sensor is set to port 5634. My code below should send the message to the sensor and a reply should come back. However i get no reply and it hangs at the .recvfrom line. Any help would be great as I have never done UDP before.
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) print("Connecting....") s.connect(('192.168.60.10', 9008)) print("Connected") s.sendto(bytes(data,'UTF-8'),('192.168.60.3',9008)) print("sent:- " + data) RetMess=s.recvfrom(1024) print(RetMess) s.close()