New openHab2 EnOcean binding

Sure this is the code I use:

#!/bin/bash
# https://community.openhab.org/t/cant-use-forwarded-socat-serial-port-in-lgtvserial-binding-ioexception/97965
# https://community.openhab.org/t/forwarding-of-serial-and-usb-ports-over-the-network-to-openhab/46597

# use while loop to restart socat on connection end
while /bin/true; do
    socat -d -d -s -T 1200 -lf /openhab/userdata/logs/socat_proxy.log pty,link=/dev/ttyNET0,raw,user=openhab,group=openhab,mode=777 pty,link=/dev/ttyNET1,raw,echo=0
    sleep 1
done &> /dev/null &

In the comments you find references to the threads where I got the idea from. You probably don’t need the -T 1200, it was working for me so I did not try to remove this.

Edit: For completeness this is the first socat command:

#!/bin/bash
# https://community.openhab.org/t/cant-use-forwarded-socat-serial-port-in-lgtvserial-binding-ioexception/97965
# https://community.openhab.org/t/forwarding-of-serial-and-usb-ports-over-the-network-to-openhab/46597

# use while loop to restart socat on connection end
sleep 5
while /bin/true; do
    socat -d -d -s -T 600 -lf /openhab/userdata/logs/socat.log /dev/ttyNET1,raw tcp:10.9.50.202:9999,connect-timeout=30,forever,intervall=10
    sleep 1
done &> /dev/null &