i hardly find examples on socat that would suit this requirement (or may be i don't know what keyword i should use). I want to get rid of the 3 wires connected to R-Pi UART. Then virtual serial port can be opened for that TCP packets and perform serial communication. It also decodes incomming TCP packets and writes them to serial port. How should i do it with socat? I don't want to change the script but just to manipulate some configuration in socat (or something else) that would forward the command to the device's IP. In our example data sent to serial port (which is used as terminal port in regular Micropython ESP32 device) will be send via WiFi using TCP protocol. ^CLI1234^M //this is an example of the serial command sent to the device from Raspberry Pi terminal i could send netcat command one at a time like this: nc 10.0.0.55 1001 The serial port of Raspberry Pi is /dev/ttyAMA0 and say the device has an IP of 10.0.0.55. Serialport.write("\x03LI%s\x0D"%passcode)Ĭurrently I am using direct 3 wires (gnd, txd, rxd) from Raspberry Pi to the device's (gnd, rxd, txd). Serialport=serial.Serial ("/dev/ttyAMA0", 9600, timeout=0.5) Print "logging in using passcode %s"%passcode ,type(passcode) TCP/IP Socket Example - get connected, show details about the connection, and send a command Serial (RS-232) Example - get connected, optionally setting the. I have a web application that will constantly post some queries and get replies from a device through the serial port on Raspberry Pi.
0 Comments
Leave a Reply. |