Announcement

Collapse
No announcement yet.

Stick7 on a RPi with Ser2Net

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Richel
    replied
    After a great deal of trial-and-error and searching the web, I have gotten this to work on an RPi 3. I was getting the error "ser2net invalid port name/number." The solution came from this site: https://github.com/cminyard/ser2net/issues/52.
    In the folder /lib/systemd/system, I edited the ser2net.service file by adding "Requires=network.target" under [Unit]; and added [Timer] with the lines "OnBootSec=1m" and "Unit=ser2net.service".

    Leave a comment:


  • johnny_holden
    replied
    zwolfpack. I followed every instruction with a different Pi and fresh install but still failed. However, I come across THIS and added in /lib/systemd/system/ser2net.service the following:

    After=network-online.target
    Wants=network-online.target

    from the 4th line and it worked ! Thank you :-)

    EDIT: Although it's working fine, for some reason, my log keep registering an error "Zstick7: The serial port (COM2) was not found in the system. Will keep waiting for it..." from when is was directly connected. Any suggestions? Only have one plugin (3.0.10.0) with one interface to ethernet interface.

    Leave a comment:


  • zwolfpack
    replied
    I don't know. I just verified the setup on a RPi4. Before I was using a Pi3, but the Pi4 works the same.

    Suggest following the steps below and post details of any differences encountered.

    System info:
    Code:
    pi@HS4Pro:~ $ uname -a
    Linux HS4Pro 5.15.32-v7l+ #1538 SMP Thu Mar 31 19:39:41 BST 2022 armv7l GNU/Linux
    
    pi@HS4Pro:~ $ more /etc/os-release
    PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
    NAME="Raspbian GNU/Linux"
    VERSION_ID="11"
    VERSION="11 (bullseye)"
    VERSION_CODENAME=bullseye
    ID=raspbian
    ID_LIKE=debian
    HOME_URL="http://www.raspbian.org/"
    SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
    BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
    Steps performed...

    1) install ser2net
    Code:
    sudo apt install -y ser2net
    1a) verify ser2net version
    Code:
    pi@HS4Pro:~ $ ser2net -v
    ser2net version 4.3.3
    2) replace /etc/ser2net.yaml with
    Code:
    %YAML 1.1
    ---
    
    default:
      name: kickolduser
      value: true
    
    default:
      name: speed
      value: 115200n81
    
    connection: &con2001
      accepter: tcp,2001
      timeout: 120
      enable: on
      connector: serialdev,/dev/ttyUSB0
    3) Add lines to /lib/systemd/system/ser2net.service
    Code:
    [Unit]
    Description=Serial port to network proxy
    Documentation=man:ser2net(8)
    After=network-online.target
    Wants=network-online.target
    ​
    [Service]
    EnvironmentFile=-/etc/default/ser2net
    ExecStart=/usr/sbin/ser2net -n -c $CONFFILE -P /run/ser2net.pid
    Type=exec
    Restart=on-failure
    RestartSec=5
    
    [Install]
    WantedBy=multi-user.target
    4) reboot

    5) verify service running correctly
    Code:
    pi@HS4Pro:~ $ service ser2net status
    ● ser2net.service - Serial port to network proxy
    Loaded: loaded (/lib/systemd/system/ser2net.service; enabled; vendor prese>
    Active: active (running) since Sun 2022-08-14 13:38:52 PDT; 34s ago
    Docs: man:ser2net(8)
    Main PID: 615 (ser2net)
    Tasks: 1 (limit: 4915)
    CPU: 21ms
    CGroup: /system.slice/ser2net.service
    └─615 /usr/sbin/ser2net -n -c /etc/ser2net.yaml -P /run/ser2net.pid
    
    Aug 14 13:38:52 HS4Pro systemd[1]: Starting Serial port to network proxy...
    Aug 14 13:38:52 HS4Pro systemd[1]: Started Serial port to network proxy.
    6) verify by adding Z-Wave controller to HS4 - see image.
    Attached Files

    Leave a comment:


  • johnny_holden
    replied
    zwolfpack I'm struggling. I'm just a simple linux starter. However, I checked the ser2net version, and as you highlighted for ver 4, I edited the ser2net.service with adding 4th line and also the YAML file with your suggested code (with correct double space on indentations) but had raspberrypi ser2net[354]: Invalid port name/number: Invalid data to parameter on line 16 column 0 (last line of Yaml file). I also tried various other formats found HERE with same parameters. Reboot inbetween. But still Invalid error. In HS4, I'm using ethernet connection with IP address (fixed) and correct port as per Yaml. I also had a go with Trueport on a Windows PC to try and connect, but no luck. Rpi to HS4\PC is on same subnet\LAN.
    I've confirmed interface using tail -f /var/log/syslog and get usb 1-1.3: cp210x converter now attached to ttyUSB0. So obviously your config was same.
    What am I missing?

    Leave a comment:


  • zwolfpack
    replied
    Check ser2net status via
    Code:
    ser2net -v
    and
    Code:
    service ser2net status
    The command line is shown in the 'service' command output. The configuration file is specified via the '-c' option.
    On Debian 11, I believe you'll find that you're running ser2net version 4. With this, the configuration file is changed to 'ser2net.yaml', which has a different format than the old ser2net.conf.

    Try setting the config as follows. Indentation is important.
    Code:
    %YAML 1.1
    ---
    
    default:
      name: kickolduser
      value: true
    
    default:
      name: speed
      value: 115200n81
    
    connection: &con2001
      accepter: tcp,2001
      timeout: 120
      enable: on
      connector: serialdev,/dev/ttyUSB0
    Edit: to fix an issue mentioned in another thread, where ser2net doesn't start properly at reboot, edit file /lib/systemd/system/ser2net.service and add the lines shown below (starting with 'After=').
    Code:
    [Unit]
    Description=Serial port to network proxy
    Documentation=man:ser2net(8)
    After=network-online.target remote-fs.target
    Wants=network-online.target remote-fs.target
    
    [Service]
    EnvironmentFile=-/etc/default/ser2net
    ExecStart=/usr/sbin/ser2net -n -c $CONFFILE -P /run/ser2net.pid
    Type=exec
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target

    Leave a comment:


  • johnny_holden
    started a topic Stick7 on a RPi with Ser2Net

    Stick7 on a RPi with Ser2Net

    I want to relocate my Stick7 and attempted to use RPi4 with Ser2Net. Installed Pi OS Lite (Debian v11) and Ser2Net. Plugged in stick and identified it as 'ttyUSB0'. Fixed IP and checked connection from Windows PC ok. Configured ser2net.conf with '2001:raw:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT -XONXOFF -RTSCTS' but couldn't get HS4\z-wave plugin to recognise it.

    Stick works directly plugged into HS4 PC okay.

    Anyone be able to advise? I did have Z-net SD card and tried using that, but the image I think is too old as it didnt even detect Stick to configure.

    Essentially my goal is to get my stick accessible on RPi4 just as remote interface so my Windows\HS4 can access it.


    HS4 Pro Edition 4.2.13.0 (Windows), BLBackup 2.0.63.0,BLDenon 2.0.58.0,BLLAN 2.0.45.0,BLOccupied 2.0.28.0,BLPlex 2.0.22.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,BLUPS 2.0.26.0,JowiHue 2.1.2.1,Modbus 3.9.6431.26038,Pushover 3P 0.0.0.52,RaspberryIO 3.0.0.20,SMS-Gateway 3.3.5.17921,Z-Wave 3.0.10.0
Working...
X