VEL448
June 11, 2019, 12:20pm
1
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
MDAR
July 1, 2019, 6:39am
2
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
MDAR
July 1, 2019, 7:19am
4
Thanks
I meant to start the service at boot up
Hi MDAR,
It starts automatically at boot up.
You can check the status of the snap with
snap services velbus-tcp
It should say
Startup: enabled
Current: active
1 Like
MDAR
January 9, 2020, 8:04am
6
Hi
I’ve got some bad news
I tried to install this Snap on a fresh Ubuntu 18 device and it failed
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
VEL448
January 9, 2020, 8:30am
7
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
Swimmer
February 26, 2020, 4:32pm
8
And how do you connect if all is ok, from Velbuslink ? Chosing Network connection adding the IP and the port, or Signum/USBIP choice ?
VEL448
February 26, 2020, 5:18pm
9
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
VEL448
September 10, 2020, 11:13am
11
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
MDAR
August 21, 2021, 8:52am
13
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 :-
opened 11:45AM - 19 Aug 21 UTC
Installed it on a Odroid C4 system - installation was successful and easy
but… VelbusLink version: 10.6.0.0 crashes on connect :
(an error occurred while performing the operation. A report will be made at ...
[sniplet]
exception number : 4
exception class : EIdSocketError
exception message : Socket Error # 10054 Connection reset by peer.
Also tried the VelServ on exactly the same infra - and that does work so it's not the connection itself.
RCZ
August 22, 2021, 6:13am
14
Got it working - on an Odroid C4 with the following:
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
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,
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
MDAR
August 23, 2021, 9:38am
15
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)
VEL448
August 25, 2021, 9:56am
16
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;
raise ValueError("Couldn't find a port to open communication on")
self.__serial_port = serial.Serial(
port = self.__port,
baudrate = 38400,
parity = serial.PARITY_NONE,
stopbits = serial.STOPBITS_ONE,
bytesize = serial.EIGHTBITS,
xonxoff = 0,
timeout = None,
dsrdtr = 0,
rtscts = 0,
)
if not self.__serial_port.isOpen():
raise Exception("Couldn't open port {0}".format(self.__port))
# Now that we're connected, set connected state
self.__connected = True
self.__in_error = False
We’ll try to get a fix out for this soon
1 Like
MDAR
August 25, 2021, 11:19am
17
This wouldn’t be an issue if there was a USB port on the top edge…
I’ve been asking for years
However, I know there are installations that only use the RS232 connection.
I’ll just continue with my little hack for now.
1 Like
RCZ
October 27, 2021, 1:30pm
18
hi
was there an update on this one already? can we use the RS232 now?
VEL524
October 29, 2021, 7:37am
19
It’s in our backlog to implement this. We’ll also accept pull requests.
1 Like
MDAR
November 15, 2021, 1:14pm
20
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
RCZ
November 15, 2021, 2:07pm
21
did you also do the pull request and editted for serial connections?