Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created July 3, 2025 00:51
Show Gist options
  • Select an option

  • Save noslin005/ddc4ceceab8d981a3716f7fbb970910c to your computer and use it in GitHub Desktop.

Select an option

Save noslin005/ddc4ceceab8d981a3716f7fbb970910c to your computer and use it in GitHub Desktop.

Revisions

  1. noslin005 created this gist Jul 3, 2025.
    15 changes: 15 additions & 0 deletions socat-serial.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # Socat

    **Receiver**

    ```bash
    socat -d -d UDP-RECV:9000,ip-add-membership=239.0.0.1:0.0.0.0,interface=eth0,reuseaddr FILE:/dev/ttyS1,raw,echo=0
    socat -d -d UDP-RECV:9000,ip-add-membership=239.0.0.1:0.0.0.0,interface=eth0,reuseaddr PTY,raw,echo=0,link=/tmp/virtual-tty
    socat -d -d UDP-RECV:9000,ip-add-membership=239.0.0.1:0.0.0.0,reuseaddr SYSTEM:'tee /dev/ttyS1 > /tmp/mirror'
    ```

    **Sender**

    ```
    socat -d -d PTY,raw,echo=0,link=/dev/ttyS1 UDP-DATAGRAM:239.0.0.1:9000,interface=eth0
    ```