How-To : Install and Run VelServ - a Velbus TCP Gateway

Oooooooo I see :smile:

That makes sense.

I thought that number was just a (random) unique ID for each Thing. I never noticed that it was the ID for the bridge (that was in play when the Thing was first created).

Either way, if the Things are working…

“Who cares which number it is” :wink:

Yeah I guess you’re right.
That’s just something autistic I can’t handle :wink:

Anyway, again a big thank you for your help. :+1: :+1:

Status updates work perfect now (which they didn’t as I mentioned before)

1 Like

Excellent news all round.

Other than the bridge number issue.

I’m not sure what to suggest if it’s really bugging you.

Other than suggest that is a nice reminder of how you got it all working in the first place.

Our software evolves like the rest of us?

The only thing to consider is if you do work out how to change the number, wouldn’t it negatively affect all the rules you’ve created?

That’s probably right.

The thing is, Habpanel is working fine on my phone, but on my laptop it doesn’t. Status updates aren’t correct, it’s like I need to push a button again to have it updated.
Same goes with basic UI, which I recently started playing around in. I had a few thinks working, but now they don’t work anymore. Maybe that has something to do with the new network bridge.

I’ll search on that another time. Since it’s Sunday, maybe I should spend some attention to my girlfriend now :wink:

Always :slight_smile:


To make life even easier to setup Velserv, I’ve created a script to download and setup.

Use a terminal and try these commands…



sudo sh

When the script has completed it’s final step, you should see something like this :

user@Linux_MiniServer:/# systemctl status velserv
● velserv.service - Velserv
   Loaded: loaded (/opt/velserv/velserv.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-03-24 17:55:34 GMT; 47s ago
  Process: 2345 ExecStartPost=/bin/bash -c /bin/pidof velserv >> /var/log/velserv.log (code=exited, status=0/SUCCESS)
  Process: 2338 ExecStartPost=/bin/bash -c /bin/echo Velserv Started $(date) >> /var/log/velserv.log (code=exited, status=0/
  Process: 2334 ExecStartPost=/bin/bash -c /bin/touch /var/log/velserv.log (code=exited, status=0/SUCCESS)
  Process: 2327 ExecStart=/opt/velserv/velserv -d /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00
 Main PID: 2332 (velserv)
    Tasks: 4
   Memory: 104.0K
      CPU: 86ms
   CGroup: /system.slice/velserv.service
           └─2332 /opt/velserv/velserv -d /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00 -p 6000

Mar 24 17:55:34 Ubuntu-Home systemd[1]: Starting Velserv...
Mar 24 17:55:34 Ubuntu-Home systemd[1]: Started Velserv.

It will stay in that state until you press q

Good luck

If you want to keep an eye on the amount of times Velserv is started at boot up, take a look at the log file it appends

cat /var/log/velserv.log

I can’t remember what inspired me to write this script, ahem… @CobleS @RossJe


Haha, great!
Keep in mind that there 's a minor update in the current version, so we’re now at version 1.6 :slight_smile:

1 Like

I’m very glad you approve :smiley_cat:

I’ve added a line in the script that will pull down the latest version of your velserv.c file from now on :smile:



Tried your script today with a friend, works perfect! :ok_hand:

1 Like

For the correct /dev/ entry, you can also create a udev rule:
cat /etc/udev/rules.d/99-usb-serial.rules :
SUBSYSTEM==“tty”, ATTRS{idVendor}==“10cf”, ATTRS{idProduct}==“0b1b”, SYMLINK+=“ttyVelbus”

This will create a /dev/ttyVelbus based on the vendor and producti ID.

This was needed when I used an older PI.
It didn’t created a symlink in /dev/servial


1 Like

Just a thought, but

How can we update to a newer version? As I mentioned :

But I already have velserv running, so now what… :thinking:



Once Jerome advised that he had added an update, I tweaked the install script to pull down the very latest code from Jerome’s website.

Simply running the script again will update VelServ.

However, the change is very minor and “If it ain’t broke, don’t fix it”

I know what you mean…
But I tried a part of your script:
wget -O /opt/velserv/velserv.c
and I got a write error. I did stop velserv before trying the update. Will your script be able to overwrite the already running/installed version?
Just me begin curious. :innocent:

Hey CobleS,
what error did you get, permission denied? Try to put sudo in front of your command, so: sudo wget -O /opt/velserv/velserv.c
After that compile the file with : gcc -o velserv velserv.c -lpthread (or if this gives you an error, sudo in front of it)

1 Like

Yeah, that’s the plan.

My installation script overwrites everything :slight_smile: (dangerous, but true)

As Jerome rightly says, try prepending sudo to give each command write privileges for everywhere.

However, unless you’re using an RS232 link to Velbus, the tweak that Jerome made won’t affect your installation.

@jeroends was right, I didn’t put “sudo” in front of the command
@MDAR I’m not using RS232, so I won’t update :slight_smile:
Still good to know that I can use the scirpt if I want to update, whatever makes my life easier :wink:

1 Like

i have installed velserv on a rasberrypi that also runs openhabian.
The VelServ works, the usb cable is also connected, the network connection installed in openhab. but no Velbus things are discovered.
Do these have to be entered manually or am I doing something wrong.:wink:

this is the log file in openhab:

2019-08-09 11:26:56.774 [vent.ItemStateChangedEvent] - VelbusNetworkBridgeHuis_LastSeen changed from 2019-08-09T11:22:14.117+0200 to 2019-08-09T11:26:56.730+0200

2019-08-09 11:27:56.804 [vent.ItemStateChangedEvent] - VelbusNetworkBridgeHuis_LastSeen changed from 2019-08-09T11:26:56.730+0200 to 2019-08-09T11:27:56.776+0200

this is the configuration in network binding:

Hostname or IP

Refresh Interval


A quick scan with the Inbox in PaperUI should find everything (eventually).

Just to double check, can you access your network with VelbusLink, via the TCP port of your PI?

Restarting openHAB2 might do the trick.

are you sure the velserv has connection? Try to connect with Velbuslink, if that works you’re sure :slight_smile: .The problem is that velserv exists in 2 parts, a distribution part and a gateway. The distribution part keeps running even when the gateway is down, so it could look like velserv is still running.

behind restarting openhab2 I see the following in the log:

but the velbus link via tcp also doesn’t work.
So I think as Jeroends says the gateway is down, How can I restart it?

I also requested the status of the velserv: