diff --git a/socat-at-bridge/killsmd7bridge b/socat-at-bridge/killsmd7bridge new file mode 100644 index 0000000..9f63b06 --- /dev/null +++ b/socat-at-bridge/killsmd7bridge @@ -0,0 +1,4 @@ +#!/bin/bash + +# Look for the process by its command and kill it so socat can have smd7 instead +pkill -f "/usr/bin/port_bridge smd7 at_usb2 1" diff --git a/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7-from-ttyIN.service b/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7-from-ttyIN.service new file mode 100644 index 0000000..4821e57 --- /dev/null +++ b/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7-from-ttyIN.service @@ -0,0 +1,14 @@ +[Unit] +Description=Read from /dev/ttyIN2 and write to smd7 +BindsTo=socat-smd7.service +After=socat-smd7.service + +[Service] +ExecStart=/bin/bash -c "/bin/cat /dev/ttyIN2 > /dev/smd7" +ExecStartPost=/bin/sleep 2s +StandardInput=tty-force +Restart=always +RestartSec=1s + +[Install] +WantedBy=multi-user.target diff --git a/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7-to-ttyIN.service b/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7-to-ttyIN.service new file mode 100644 index 0000000..75755b3 --- /dev/null +++ b/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7-to-ttyIN.service @@ -0,0 +1,14 @@ +[Unit] +Description=Read from /dev/smd7 and write to ttyIN2 +BindsTo=socat-smd7.service +After=socat-smd7.service + +[Service] +ExecStart=/bin/bash -c "/bin/cat /dev/smd7 > /dev/ttyIN2" +ExecStartPost=/bin/sleep 2s +StandardInput=tty-force +Restart=always +RestartSec=1s + +[Install] +WantedBy=multi-user.target diff --git a/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7.service b/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7.service new file mode 100644 index 0000000..6b8b1bd --- /dev/null +++ b/socat-at-bridge/smd7_tty2_systemd_units/socat-smd7.service @@ -0,0 +1,13 @@ +[Unit] +Description=Socat Serial Emulation for smd7 +After=ql-netd.service + +[Service] +ExecStart=/usrdata/socat-at-bridge/socat-armel-static -d -d pty,link=/dev/ttyIN2,raw,echo=0 pty,link=/dev/ttyOUT2,raw,echo=1 +# Add a delay to prevent the clients from starting too early +ExecStartPost=/bin/sleep 2s +Restart=always +RestartSec=1s + +[Install] +WantedBy=multi-user.target diff --git a/socat-at-bridge/systemd_tty2_units/socat-smd11-from-ttyIN.service b/socat-at-bridge/systemd_tty2_units/socat-smd11-from-ttyIN.service new file mode 100644 index 0000000..b2199fa --- /dev/null +++ b/socat-at-bridge/systemd_tty2_units/socat-smd11-from-ttyIN.service @@ -0,0 +1,14 @@ +[Unit] +Description=Read from /dev/ttyIN2 and write to smd11 +BindsTo=socat-smd11.service +After=socat-smd11.service + +[Service] +ExecStart=/bin/bash -c "/bin/cat /dev/ttyIN2 > /dev/smd11" +ExecStartPost=/bin/sleep 2s +StandardInput=tty-force +Restart=always +RestartSec=1s + +[Install] +WantedBy=multi-user.target diff --git a/socat-at-bridge/systemd_tty2_units/socat-smd11-to-ttyIN.service b/socat-at-bridge/systemd_tty2_units/socat-smd11-to-ttyIN.service new file mode 100644 index 0000000..00a0ae2 --- /dev/null +++ b/socat-at-bridge/systemd_tty2_units/socat-smd11-to-ttyIN.service @@ -0,0 +1,14 @@ +[Unit] +Description=Read from /dev/smd11 and write to ttyIN2 +BindsTo=socat-smd11.service +After=socat-smd11.service + +[Service] +ExecStart=/bin/bash -c "/bin/cat /dev/smd11 > /dev/ttyIN2" +ExecStartPost=/bin/sleep 2s +StandardInput=tty-force +Restart=always +RestartSec=1s + +[Install] +WantedBy=multi-user.target diff --git a/socat-at-bridge/systemd_tty2_units/socat-smd11.service b/socat-at-bridge/systemd_tty2_units/socat-smd11.service new file mode 100644 index 0000000..9add91d --- /dev/null +++ b/socat-at-bridge/systemd_tty2_units/socat-smd11.service @@ -0,0 +1,13 @@ +[Unit] +Description=Socat Serial Emulation for smd11 +After=ql-netd.service + +[Service] +ExecStart=/usrdata/socat-at-bridge/socat-armel-static -d -d pty,link=/dev/ttyIN2,raw,echo=0 pty,link=/dev/ttyOUT2,raw,echo=1 +# Add a delay to prevent the clients from starting too early +ExecStartPost=/bin/sleep 2s +Restart=always +RestartSec=1s + +[Install] +WantedBy=multi-user.target