kopia lustrzana https://github.com/Links2004/x6100-armbian
add network CAT control
rodzic
1d14aae1cb
commit
fddad7f080
25
README.md
25
README.md
|
@ -53,8 +53,31 @@ with armbian booted the X6100 will open a TCP server on port 7000 to allow acces
|
||||||
this will create a `X6100_RX.monitor` pulse device and connect in to the X6100
|
this will create a `X6100_RX.monitor` pulse device and connect in to the X6100
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
export X6100_IP=<IP of the x6100>
|
||||||
pactl load-module module-null-sink sink_name=X6100_RX sink_properties=device.description=X6100_RX
|
pactl load-module module-null-sink sink_name=X6100_RX sink_properties=device.description=X6100_RX
|
||||||
gst-launch-1.0 tcpclientsrc port=7000 host=<IP of the x6100> ! audio/x-raw,rate=16000,channels=2,format=S16LE ! pulsesink device=X6100_RX client-name=X6100
|
gst-launch-1.0 tcpclientsrc port=7000 host=${X6100_IP} ! audio/x-raw,rate=16000,channels=2,format=S16LE ! pulsesink device=X6100_RX client-name=X6100
|
||||||
|
```
|
||||||
|
|
||||||
|
# CAT via Network
|
||||||
|
|
||||||
|
the X6100 runs a `rigctld` on TCP port 4532.
|
||||||
|
|
||||||
|
for RAW Serial access via Network us TCP port 9990.
|
||||||
|
|
||||||
|
## Virtual Serial port on Linux
|
||||||
|
```sh
|
||||||
|
export X6100_IP=<IP of the x6100>
|
||||||
|
sudo socat pty,link=/dev/ttyX6100Cat,raw,echo=0,user=${USER} tcp:${X6100_IP}:9990
|
||||||
|
```
|
||||||
|
|
||||||
|
# Xorg
|
||||||
|
|
||||||
|
## virtual FHD
|
||||||
|
|
||||||
|
for setting up the screen with a virtual FHD resulution
|
||||||
|
|
||||||
|
```sh
|
||||||
|
xrandr --output None-1 --mode 480x800 --panning 1920x1080
|
||||||
```
|
```
|
||||||
|
|
||||||
# build steps
|
# build steps
|
||||||
|
|
|
@ -72,10 +72,19 @@ Main() {
|
||||||
|
|
||||||
# startup
|
# startup
|
||||||
systemctl enable x6100_chroot.service
|
systemctl enable x6100_chroot.service
|
||||||
|
systemctl enable x6100_socat_cat.service
|
||||||
systemctl enable x6100_app.service
|
systemctl enable x6100_app.service
|
||||||
systemctl enable lightdm_x6100.service
|
systemctl enable lightdm_x6100.service
|
||||||
systemctl enable novnc.service
|
systemctl enable novnc.service
|
||||||
|
|
||||||
|
wget https://github.com/Links2004/x6100-cat-mux/releases/download/1.0.2/x6100_cat_mux -O /root/x6100_cat_mux
|
||||||
|
chmod +x /root/x6100_cat_mux
|
||||||
|
|
||||||
|
systemctl enable x6100_cat_mux.service
|
||||||
|
systemctl enable rigctld_socat.service
|
||||||
|
systemctl enable rigctld.service
|
||||||
|
systemctl enable usbc_port_cat.service
|
||||||
|
|
||||||
# disable not needed services
|
# disable not needed services
|
||||||
systemctl disable smbd.service
|
systemctl disable smbd.service
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=USB-C Port RAW CAT control
|
||||||
|
Requires=x6100_socat_cat.service
|
||||||
|
Requires=x6100_cat_mux.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
ExecStart=/usr/bin/socat /dev/ttyS2_USB_CAT,b19200,raw,echo=0 tcp:127.0.0.1:9090
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -3,6 +3,7 @@ Description=x6100 APP
|
||||||
Requires=x6100_chroot.service
|
Requires=x6100_chroot.service
|
||||||
Requires=amixer.service
|
Requires=amixer.service
|
||||||
Requires=gpio_setup.service
|
Requires=gpio_setup.service
|
||||||
|
Requires=x6100_socat_cat.service
|
||||||
ConditionKernelCommandLine=x6100_app=1
|
ConditionKernelCommandLine=x6100_app=1
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=x6100 CAT MUX Server
|
||||||
|
Requires=x6100_chroot.service
|
||||||
|
Requires=x6100_socat_cat.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
ExecStart=/root/x6100_cat_mux
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=x6100 CAT redirect
|
||||||
|
Requires=x6100_chroot.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
ExecStart=/root/run_x6100_socat_app.sh start
|
||||||
|
ExecStop=/root/run_x6100_socat_app.sh stop
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -1,7 +1,19 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
CAT_DEV=/dev/ttyS2
|
||||||
|
CAT_DEV_NEW=/dev/ttyS2_VIRT
|
||||||
|
|
||||||
function cleanup()
|
function cleanup()
|
||||||
{
|
{
|
||||||
echo 0 > /sys/class/gpio/gpio138/value
|
echo 0 > /sys/class/gpio/gpio138/value
|
||||||
|
|
||||||
|
if [ -e "/mnt/x6100/${CAT_DEV}" ] ; then
|
||||||
|
umount /mnt/x6100/${CAT_DEV} || true
|
||||||
|
fi
|
||||||
|
if [ -f "/mnt/x6100/${CAT_DEV}" ] ; then
|
||||||
|
rm /mnt/x6100/${CAT_DEV}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
@ -30,5 +42,18 @@ else
|
||||||
EOL
|
EOL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
until [ -e ${CAT_DEV_NEW} ] ; do
|
||||||
|
echo "waiting for ${CAT_DEV_NEW}"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -e "/mnt/x6100/${CAT_DEV}" ] ; then
|
||||||
|
umount /mnt/x6100/${CAT_DEV} || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch /mnt/x6100/${CAT_DEV}
|
||||||
|
mount -o bind ${CAT_DEV_NEW} /mnt/x6100${CAT_DEV}
|
||||||
|
|
||||||
echo 1 > /sys/class/gpio/gpio138/value
|
echo 1 > /sys/class/gpio/gpio138/value
|
||||||
|
|
||||||
chroot /mnt/x6100 /bin/bash -c 'source /etc/profile && nice --5 /usr/app_qt/x6100_ui_v100'
|
chroot /mnt/x6100 /bin/bash -c 'source /etc/profile && nice --5 /usr/app_qt/x6100_ui_v100'
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
ACTION=start
|
||||||
|
|
||||||
|
CAT_DEV=/dev/ttyS2
|
||||||
|
CAT_DEV_NEW=/dev/ttyS2_VIRT
|
||||||
|
CAT_DEV_ORG=/dev/ttyS2_USB_CAT
|
||||||
|
|
||||||
|
if [ "$1" != "" ] ; then
|
||||||
|
ACTION=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$ACTION" == "start" ] ; then
|
||||||
|
if [ -e "${CAT_DEV}" ] ; then
|
||||||
|
rm ${CAT_DEV}
|
||||||
|
fi
|
||||||
|
if [ -e "${CAT_DEV_NEW}" ] ; then
|
||||||
|
rm ${CAT_DEV_NEW}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "${CAT_DEV_ORG}" ] ; then
|
||||||
|
# create orginal
|
||||||
|
mknod -m 660 ${CAT_DEV_ORG} c 4 66
|
||||||
|
chown root:dialout ${CAT_DEV_ORG}
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec socat pty,link=${CAT_DEV_NEW},raw,user=root,group=dialout,echo=0 tcp-listen:9990,bind=127.0.0.1,fork
|
||||||
|
else
|
||||||
|
if [ -e "${CAT_DEV_ORG}" ] ; then
|
||||||
|
rm ${CAT_DEV_ORG}
|
||||||
|
fi
|
||||||
|
if [ -e "${CAT_DEV}" ] ; then
|
||||||
|
rm ${CAT_DEV}
|
||||||
|
fi
|
||||||
|
if [ -e "${CAT_DEV_NEW}" ] ; then
|
||||||
|
rm ${CAT_DEV_NEW}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "/mnt/x6100/${CAT_DEV}" ] ; then
|
||||||
|
umount /mnt/x6100/${CAT_DEV}
|
||||||
|
fi
|
||||||
|
# restore orginal
|
||||||
|
mknod -m 660 ${CAT_DEV} c 4 66
|
||||||
|
chown root:dialout ${CAT_DEV}
|
||||||
|
|
||||||
|
fi
|
Ładowanie…
Reference in New Issue