Bridging Velbus with TCP through snap package

Hello everyone

We’ve made a snap package to easily run a Velbus TCP gateway on any snapd-compatible Linux distribution.

To install, simply run these two commands;

snap install velbus-tcp
snap connect velbus-tcp:raw-usb :raw-usb

The server will now listen at 27015 (which you can connect to with VelbusLink).

Source code and further information can be found at https://github.com/velbus/velbus-tcp-snap

1 Like

Hi

Do you have a systemd service file to automate the starting and stopping of this service in Linux?

Hi MDAR,

This snap starts automatically. It does not require a systemd service file.

To start the snap:

snap start velbus-tcp

To stop the snap:

snap stop velbus-tcp

Thanks :slight_smile:

I meant to start the service at boot up :wink:

Hi MDAR,

It starts automatically at boot up. :smile:

You can check the status of the snap with

snap services velbus-tcp

It should say
Startup: enabled
Current: active

1 Like

Hi

I’ve got some bad news :frowning:

I tried to install this Snap on a fresh Ubuntu 18 device and it failed :frowning:

The commands I ran were

apt-get install snaps
 
snap start velbus-tcp

Snap installed correctly, but velbus-tcp failed.

The second snap command

snap connect velbus-tcp:raw-usb :raw-usb

Reported that there wasn’t a raw-usb plugin available

There were a number of lines of text displayed during the installation of velbus-tcp but they were on the same line so couldn’t be captured.

Extra info

root@odroid:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic

 root@odroid:~# ls /dev/serial/*
  dev/serial/by-id:
 
  


Velleman_Projects_VMB1USB_Velbus_USB_interface-if00
  
/dev/serial/by-path:
platform-dwc2_b-usb-0:1.2:1.0

Hi MDAR

To get the full output snap log, you can use ‘snap changes’ together with ‘snap tasks ’ e.g.

It seems the snap can’t be installed due to a seccomp error.

Looks like a snapd error, following a similar thread on the official snapcraft forum I found it might be kernel related:

Try to create a new thread over on their forum.

Also, you should not have to install snapd on a fresh Ubuntu 18, so might also have something to do with that.

Kind regards

1 Like

And how do you connect if all is ok, from Velbuslink ? Chosing Network connection adding the IP and the port, or Signum/USBIP choice ?

You should select ‘Network’, filling in the IP/port.

Is it also possible to use in openhab? Witch port should i use? I tried 8080 but its online for one second and then its give communication error.

Kind regards

The default port for the connection is 27015 you can check whether you can connect with VelbusLink.

For more configuration options, check https://github.com/velbus/velbus-tcp-snap

1 Like

Just an update.

I have revisited the `velbus-tcp’ snap and can report that after a little bit of a bump in the road, it’s now working perfectly and very fast.

I’ve set it up so that the local machine has a restricted unsecured connection for software like OpenRemote, openHAB & Home-Assistant.

With a second secured port (TLS, SSL & Authentication) for VelbusLink, Control4, Crestron, Elan, URC-Automation etc

I’m very happy with the setup on two different types of devices.

Everything I did can be reviewed here :-

Got it working - on an Odroid C4 with the following:

  1. Commands:
apt update
apt install snapd
snap install core
snap install velbus-tcp
snap connect velbus-tcp:raw-usb :raw-usb

had to install Snap Core manually

while core18 got installed automatically - core was required else the log indicated a failure in bind_network and main and snap connect velbus-tcp:raw-usb :raw-usb would not work

  1. Set the listening ports to dual (to have Auth/TLS enabled for VelbusLink software and no Auth/TLS for OpenHab)
snap set velbus-tcp \
    tcp.host=0.0.0.0,127.0.0.1 \
    tcp.port=27015,54934 \
    tcp.relay=true,true \
    tcp.ssl=true,false \
    tcp.auth=true,false \
    tcp.authkey=62fa0c49-b0ba-486a-abcd-blablablablabla,
  1. used serial\by-id\ for the bus connection - and set autodetect to false
snap set velbus-tcp serial.autodiscover=false 

I trying to get it to work with a USB->RS232 converter (to avoid sticking in a USB in the front of VMBRSUSB) as well as the regular USB

[for USB]

snap set velbus-tcp serial.port=/dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00

For the Serial one - it’s writing (meaning I can send controls through OpenHab) - but the receiving part is not working. I’ve checked the serial converter in Windows (VelbusLink) directly and there it works so the wired connection is okay… not sure if its a programming thing then…

[for serial RS232]

snap set velbus-tcp serial.port=/dev/serial/by-id/usb-FTDI_US232R_FTGY89BK-if00-port0
1 Like

Hi @RCZ

Great to hear the you’ve got velbus-tcp working… Almost

It suddenly occurred to me that this might be something to do with the RS242 RTS / DTS signalling.

Unfortunately that’s way beyond me, you’ll need a wizard like @VEL448 or @VEL524 to shine some light on that.

(You know what my solution is, but it’s not exactly sanctioned)

We’ve not tested the snap for correct operation with RS-232 interfaces, @MDAR might be on to something as the DTR flag is not set;

We’ll try to get a fix out for this soon

1 Like

This wouldn’t be an issue if there was a USB port on the top edge… :man_shrugging:

I’ve been asking for years :crying_cat_face:

However, I know there are installations that only use the RS232 connection.

I’ll just continue with my little hack for now.

1 Like

hi

was there an update on this one already? can we use the RS232 now?

It’s in our backlog to implement this. We’ll also accept pull requests. :slight_smile:

1 Like

Just a quick update

I’ve created a small script to automate the installation of this Snap package.
It should also add avahi and broadcast the presence of the Velbus bus connection

www.mdar.co.uk/dl/velbus/velbus-tcp.sh

mkdir /opt/velbus-tcp
cd /opt/velbus-tcp
wget www.mdar.co.uk/dl/velbus/velbus-tcp.sh -O /opt/velbus-tcp/velbus-tcp.sh
sh velbus-tcp.sh
1 Like

did you also do the pull request and editted for serial connections?