Austin
Austin

Reputation: 21

Communicating with sensor(ethernet static IP) via raspberry pi

I am new to writing and understanding code. I have been reading for the past week different ways to approach the task at hand, but I am running into a few problems. The sensor I am currently using is connected via ethernet and take commands via bytes. The sensor is currently set up in that it is constantly streaming data via ethernet (IP 192.168.60.3 port 9008). I am trying to set up a socket in python to communicate to the sensor but I end up getting connection refused. Is there a way to listen and record the incoming data from the ethernet? I can ping the sensors IP and can see responses roughly every second back.

I have the data sheet with command bytes for the sensor but I am unsure how to communicate with it specifically. It accepts these commands and will respond with answers. But I dont know how to establish a connection with it at first. There is a command 0x434E that is to connect to sensor. But how do I transfer that?

Any help would be greatly appreciated! I will be happy to answer any questions that I can.

Sensor link

Upvotes: 1

Views: 909

Answers (1)

Krumelur
Krumelur

Reputation: 32497

If you get "connection refused", you are using TCP. In the page you link to it clearly says it uses UDP (UDP has no concept of a connection). Also read carefully how to configure the response ports (there is probably both a local and remote port to configure, the remote port of the sensor must match the listening port on your Pi).

Upvotes: 1

Related Questions