How to send data from serial port over wifi?

8,570

Solution 1

Use Ncat (http://nmap.org/ncat/). It is multiplatform, and it comes installed by default in many GNU/Linux distributions.

On your PC, listen with Ncat ( here we are using port 55555, but you can use any port):

nc -l 55555

On your CuBox, connect to the listener:

nc <Your PC's IP> 55555

Then if you type something in your CuBox, it will be sent to your PC (type something and press enter to see how it works).

With bash, you could easily redirect your serial data received in the CuBox through the USB to nc. Example (using screen for reading serial data from the terminal):

screen /dev/ttyUSB0 | nc 192.168.1.20 55555

Notice you should change your tty device and substitute 192.168.1.20 with your PC's IP.

Solution 2

Also helpful might be socat, a multipurpose socket tool. It can do the same things nc does, but also supports bidirectional forwarding between two endpoints.

Share:
8,570

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I have microcontroller device which reads data from sensors and sends it via Serial to USB converter (ftdi232 cable). This Serial to USB converter is connected to ARMv7 mini-computer - CuBox with Ubuntu 13.04. I have also connected WiFi USB adapter to CuBox.

    I would like to read data from serial port and send it via WiFi and receive on Windows PC. It is possible without network socket programming, using available tools? Something like pipe/bridge/redirection between serial port and WiFi. I don't need to communicate with this box, so constant and one-way stream of data over WiFi will be sufficient.

    Thanks you for any resources and ideas how to set up this communication.