Last active
December 8, 2022 17:52
-
-
Save wardbeyens/28521e456fa1617cb455118027f09ed1 to your computer and use it in GitHub Desktop.
ser2net.yaml for dsmr4 protocol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update -y | |
sudo apt-get install -y ser2net | |
sudo apt-get install -y cu | |
sudo cp /etc/ser2net.yaml /etc/ser2net.yaml.bak | |
[test] | |
cu -l /dev/ttyUSB0 -s 115200 --parity=none -E q | |
[exit] | |
q. | |
curl -Lo /tmp/ser2net.yaml "https://gist.githubusercontent.com/wardbeyens/28521e456fa1617cb455118027f09ed1/raw/0cf931bbd6447e94cdffb8e0c463bf0509faf2af/ser2net.yaml" | |
cat /tmp/ser2net.yaml | |
sudo chmod 775 /tmp/ser2net.yaml | |
sudo mv /tmp/ser2net.yaml /etc/ser2net.yaml | |
sudo systemctl restart ser2net.service | |
sudo systemctl status ser2net.service | |
LOCALIP=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1') | |
echo "${LOCALIP}" | |
sudo apt-get install telnet -y | |
telnet $LOCALIP 20202 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%YAML 1.1 | |
--- | |
define: &banner \r\nser2net port \p device \d [\B] (Debian GNU/Linux)\r\n\r\n | |
connection: &con01 | |
accepter: tcp,20202 | |
connector: serialdev,/dev/ttyUSB0,115200n81,local | |
enable: on | |
options: | |
max-connections: 3 | |
kickolduser: true | |
telnet-brk-on-sync: true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment