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

Hi All,

I’m targeting to run the software components on my raspberry PI in containers/dockers
Do we have a fully configured recent raspbian velserver available as ARM?
I found this 3Y old docker:
https://hub.docker.com/r/tomvancutsem/velserv/tags

I’m targeting to run it on a new Raspberry Pi 4
Thanks a lot,

1 Like

Hi

I’m not aware of a Deb version of VelServ.
You’d have to ask @jeroends

However, this script downloads everything and completes the setup in less than 10 seconds, so I’m not sure there’s anything to be gained.

https://forumtest.velbus.eu/t/how-to-install-and-run-velserv-a-velbus-tcp-gateway/15422/21

I’ve got it running on loads of ODroid C2 machines and recently some C4, so there’s no reason why it wouldn’t work on a Raspberry Pi 4

Hello,
there’s idd no deb package. Because the simplicity of installation I never even thought about making one :slight_smile:
I see nothing that would prevent velserv to work on a pi4 because everything depends on the system you 're running, not the hardware.
I’m planning myself also a pi4 as openhab server.

2 Likes

Hi All,
I’ve velserv running on pi4 and VelbusLink is working like a charm.
I was also able to connect in OpenHab 2.5.9 and Velbus Network Bridge. Next controlling the switches is fine as well (though Control) but I’m not receiving (auto) updates. Status when manually changing the light bulbs and temperature values etc. Do we need some kind of “push event” setting enabled on either Velserv or openHab?
(I had the same problem 2y ago with first attempt pi3 and reverted back to Velbus Serial Bridge)
Any tips?

note: reason why checking docker was for port mapping, but velserv can change the ports by default.

Hello :smile:

There’s nothing that needs enabling, so I suspect there is something going on within openHAB2 that is stopping the update messages getting through.

What does the openHAB log files indicate?

If you disable & re-enable the Velbus bridge, does that restore the connection? (You can do this within PaperUI, RestAPI or by using a Curl command)

At worst, does it require a restart of VelServ to get you back up and running?

Hi Maarten

Thanks for this report.

Cédric has found a small bug in the 2.5.9 version of the binding that was pushed into the official openHAB repository that was blocking incoming packets from the TCP network bridge.

He has worked his magic and fixed it, which should be available via PaperUI when the 2.5.10 release is available.

I would strongly recommend going back to the 2.5.4 version of the binding that is downloadable from my website using the update script. (I’ve fixed the error on my website now)

http://www.mdar.co.uk/dl/openhab/update-velbus-jar.sh

If you want to try the very latest version of Cédric’s Velbus binding, you can download it from here —

https://openhab.jfrog.io/openhab/libs-snapshot-local/org/openhab/addons/bundles/org.openhab.binding.velbus/2.5.10-SNAPSHOT/org.openhab.binding.velbus-2.5.10-20201006.033435-11.jar

or here

https://openhab.jfrog.io/openhab/libs-snapshot-local/org/openhab/addons/bundles/org.openhab.binding.velbus/2.5.10-SNAPSHOT/org.openhab.binding.velbus-2.5.10-20201013.033427-15.jar

This will work in OH2.5.9

In OH2.5.9 you will need to add the V1 serial binding to get it to work.

Be aware that there are breaking changes in how some channels are named, so you will need to remove the affected Things from PaperUI and re-add them.

Then adapt your Items to suit.

To make it easier, I have created a Generic_Items Template file that has all these changes in.

You can download everything in this ZIP file

http://www.mdar.co.uk/dl/openhab/AAA_Generic_template.zip

Hi MDAR & Cedric,
Special thanks a to provide the bug fix and clear instructions on such a short notice, by far meeting any company SLA response times ! Happy to let you know setup PI4 + docker + openhab + velserv is working perfectly. Upon initial testing all events are captured.
(note: a reboot is recommended :wink: )

1 Like

Hi @MDAR ,
I’m trying to re-install velserv with your script. It worked before, but now I’m getting a “could not resolve www.mdar.co.uk” error when I try to do “wget http://www.mdar.co.uk/dl/velserv-setup.sh

Any ideas? I wanted to re-install velserv because I noticed it’s using A LOT of CPU since I did an update of my DietPi installation yesterday. It was idling before, but now it uses 50 - 75% of CPU consistently…

Thanks for your help!

How odd

This is working for me

https://mdar.co.uk/dl/velserv-setup.sh

Or you can try the Velbus Snap package

https://forumtest.velbus.eu/t/bridging-velbus-with-tcp-through-snap-package/15814

Thanks for the super fast reply!
I think I found a DHCP setting change because of the DietPi update, which causes my server to connect to the wrong gateway IP. I’m checking this our right now and trying to fix. I’m quite sure that’s the issue, so it’s on my end and not yours. I’m curious if this also causes the high CPU spike of Velserv service… we’ll see.

1 Like

Oh is this an official Velbus package to be used to read out the Velbus bus channel?
Aka: a kind of successor to Jeroen’s Velserv ?

I was always afraid Velserv wouldn’t work anymore one day and thus am curious whether the velserv package needs to be updated for new Velbus features to work and/or whether a more official TCP bridge was available.
Are you saying I could replace Velserv with this Velbus Snap package and use it in my HomeAssistant installation (port 27015 instead of 6000 then obviously) ; or is there more to it?

Thanks!

@MDAR : just to quickly confirm: DHCP settings were indeed bricked after the system update. I managed to fix it just now and the hostname is able to resolve now; so all good on that part. Thanks!

@MDAR , @cereal : Do you know whether something changed in the HomeAssistant package for Velbus and Velserv?

I’ve been using this for a few years and never had issues. Since I’ve updated to HA 2022.2.3 I notice Velserv is using a lot of CPU. I also notice HomeAssistant automically detects a Velbus installation on the network since this release (have never noticed that before).
Did something change and is HA perhaps pinging the Velserv all the time which causes the CPU spike?
Any ideas on this? Just reporting it here so you are aware :slight_smile:

All help would be very appreciated! Thanks!

** Update: after fully deleting the Velbus integration and reconfiguring it, plus restarting the Velserv. service , it seems to have calmed down and is back to 0 to 1% of CPU. Not sure what caused it before, will monitor further.
I now seem to have issues with Velbus integration itself ; it loaded all modules but isn’t working, all entities are unavailable…
but I might need to discuss this in another thread (not on the Velbus forums but some thread we use to track these Velbus x HomeAssistant issues ?)

** Update 2: after a HomeAssistant restart and full Velbus scan (via HomeAssistant services), all seems to be working fine again.
Again: not sure what happened by updating DietPi system and HomeAssistant, but the whole HomeAssistant x Velbus seemed to break because of it. I’ve had this issue before when updating HomeAssistant (I think from 2020.x to 2021.x , but not sure of the exact versions anymore)

1 Like

Okay, so just for clarity (I’m sure @jeroends will agree) VelServ is pretty rock solid and just works.

All it does is pass the USB packets back and forth to a TCP Port.

There’s probably more to it, but essentially that’s what it’s doing.

It doesn’t care what the packets are, so if there’s an incorrectly formatted packet or a brand new style, VelServ won’t care.

You could…

Or you can leave VelServ in place.

I can’t speak for HomeAssistant, but I would assume that it’s not yet (probably one day) able to support TLS secured packets.

The advantage of the official Velbus Snap package is that it can be configured to offer a localhost / loopback unsecured port, that only applications on the same machine can access.

For example, Port 6000 for HomeAssistant, Node-Red or openHAB (or whichever port you want)

It can also offer a second (,third or fourth etc) TLS secured port for external applications, like Velbuslink or Control4 to use across the network.

There are full instructions on the Velbus GitHub page or you can use the script I’ve created to pull down everything you need.

{ note that your machine needs to install a Snap package called Core18, if it can’t find that package, it won’t be able to run Velbus-tcp, I know that Odroid C4 DietPi works very well, but Odroid C2 machines can’t install Core18 }

Does this help you?

Home assistant does support tla communications to the bus (like used by the signum).

The initial startup of home assistant it will need to scan the full bus once, so it reads all the modules and names from velbus and keeps it in a local cache (since 2020.10 release).
So in the first startup it can be heavy for a diet pi, but after this initial scan all will calm down.

1 Like

Great :smiley:

That’s excellent news

This definitely helps, thanks!
I thought Velserv interpreted the messages instead of just being a passthrough. It’s the integration in OpenHab and HomeAssistant that interpret the messages of Velbus then (which it receives from Velserv), so only that integration needs to change / update for changes or new features. Very clear to me now, thanks!

I’ll take a look at the Snap package but as long as Velserv is doing its thing, it’s definitely a robust and fine solution for me.

Thanks again all! Crazy how active you are here.

Can I ask where it’s best to report issues / bugs for Velbus integration for HomeAssistant to the active developers (mainly @cereal i think atm?) ?

Thanks! :pray:

1 Like

for issues with homeassistant:

or

this is a bit dependant on what th errors exactly is

2 Likes

Just a thought, maybe @cereal can confirm.

Are homeAssistant & VelServ fighting for the same TTY port?

The service file I wrote for VelServ will attempt to restart every few seconds of it can’t connect to TTY port.

My thought is that HA is connecting to the TTY port before VelServ can grab it.

@MDAR Thank you for the work on the server & the installation script! Can I take it and save a copy on gitlab, obviously with keeping all authors as authors? Alternatively I can assist with the process of setting up a git repo (very easy). The reason is that the link to http://leachy.homeip.net/velbus/velserv.c is already dead, rest of the code is on mdar.co.uk webpage (you change domain or move server and we have a problem). Keeping the code on gitlab makes it more future proof to some extent. It’s also easier to keep versions tagged, make releases, etc. It also allows external contributors to submit code amendments.

Also, is there a licence attached? Am I allowed to modify the code? :stuck_out_tongue_winking_eye:

P.S. I just become an owner of tiny working velbus installation :heart_eyes: and openHAB integration is most likely a next step.

1 Like