A VelBus server-mode tool

Hello to all,

I’ve been playing with VelBus for about four days now and started programming for it right away.
After reading along the threads on this forum I noticed that a lot of people are complaining about the lack of
a server mode in the newest versions of VelBusLink and the costs of HomeCenter (which does implement a socket server).
That’s why I developed a little commandline tool that acts as a server.
Most likely others did the same thing before me, but I couldn’t find an implementation anywhere.

The purpose of this tool would probably be to enable controlling and configuring VelBus from remote and multiple locations.
This can be done by running the program on the pc connected to the serial interface and connect to it from VelBusLink 8.0 on the same or another computer.

The tool uses the .NET Framework 4.0 and is written in C#.
It exists of a modified version of the VelBus .NET Library (libvelbus-server.dll; basicly the class ‘Server’ is added) and a command line interface wrapped around it.

Example usage: “velbus-server.exe COM1 8445”
where COM1 could be any serial port and 8445 is the port you wish to listen on.
Running it without any parameters shows the same help and a list of serial ports that were found by the system.

You can download the tool (which includes the library) and the source code. You can do with it as you please. : )

binary: danssaert.be/downloads/velbus-server-bin.zip
source: danssaert.be/downloads/velbus-server-source.zip

Questions or bugs? I will be monitoring this thread and try helping you out.

Greetings

[quote=“danssaertd”]Hello to all,

I’ve been playing with VelBus for about four days now and started programming for it right away.
After reading along the threads on this forum I noticed that a lot of people are complaining about the lack of
a server mode in the newest versions of VelBusLink and the costs of HomeCenter (which does implement a socket server).
That’s why I developed a little commandline tool that acts as a server.
Most likely others did the same thing before me, but I couldn’t find an implementation anywhere.

The purpose of this tool would probably be to enable controlling and configuring VelBus from remote and multiple locations.
This can be done by running the program on the pc connected to the serial interface and connect to it from VelBusLink 8.0 on the same or another computer.

The tool uses the .NET Framework 4.0 and is written in C#.
It exists of a modified version of the VelBus .NET Library (libvelbus-server.dll; basicly the class ‘Server’ is added) and a command line interface wrapped around it.

Example usage: “velbus-server.exe COM1 8445”
where COM1 could be any serial port and 8445 is the port you wish to listen on.
Running it without any parameters shows the same help and a list of serial ports that were found by the system.

You can download the tool (which includes the library) and the source code. You can do with it as you please. : )

binary: danssaert.be/downloads/velbus-server-bin.zip
source: danssaert.be/downloads/velbus-server-source.zip

Questions or bugs? I will be monitoring this thread and try helping you out.

Greetings[/quote]

I will try it as soon as possible but it seems to be a great tools, thanks !!! :wink:

Man, this is exact what I needed!
I’m not able to create one myself, since I’m not a .NET developer.

I will use it for my Flex tool at forum.velleman.eu/viewtopic.php?f=26&t=1710&start=0&st=0&sk=t&sd=a.

I just tested is and it seams to work :slight_smile: I’ll keep you informed about issues. And let you know if all works just good also :wink:

Thanks a lot!

[quote=“GertSt”]Man, this is exact what I needed!
I’m not able to create one myself, since I’m not a .NET developer.

I will use it for my Flex tool at forum.velleman.eu/viewtopic.php?f=26&t=1710&start=0&st=0&sk=t&sd=a.

I just tested is and it seams to work :slight_smile: I’ll keep you informed about issues. And let you know if all works just good also :wink:

Thanks a lot![/quote]

I’m glad you like it. If you find anything that’s not working quite as it’s supposed to or if you have some feature requests let me know.
Your Flex tool looks interesting to me as I see a lot of potential in web interfaces for Velbus. Certainly when it prevents running loads of software on all clients and especially when it’s flex. : )

Anyway, let me know if I can help you with the socket server part of your project. I’m definitely taking a look at your project.

Cheers,
David

Your socket server is running for about a month now and it never crashed till now and I never had an issue with it.
So it looks pretty stable and has no memory leaks. :slight_smile:

i downloaded
:
1-now playing plugin
2-velbus-server.exe
3-VelbusSocket.exe

couldnt make it work, can you give me a step by step tutorial pls!

Launched :
velbus-server.exe
VelbusSocket.exe
named a play list “wolf”

having this message:
trying to connect to 127.0.0.1:3788
playlists found: 2
currentPlayList:[Playlist wolf]
Unable to connect: socket error.
lcd: wolf
lcd: Not playing

Hi Ciceron,

Try the following steps and let me know if it made a difference.

  1. On Windows, open the start menu and click on “Run…”.
  2. Next type ‘cmd’ without the quotes and enter. A black command prompt will popup.
  3. Find out what the path is to ‘velbus-server.exe’ (e.g. ‘C:\directory\anotherone\velbus-server.exe’).
  4. Type the following with the path substituted with your own:
    ‘cd C:\directory\anotherone’ (again without quotes) and hit enter.
  5. Next type ‘velbus-server.exe’. A list of port names should show up.
  6. Choose the right port and type:
    ‘velbus-server.exe portname portnumber’
    e.g.: ‘velbus-server.exe COM1 3788’
  7. Run ‘VelbusSocket.exe’ as you normally would.

This is the right way of launching it. If this works, you can put the complete command in a batch file. Create a text file and save it as ‘socket server.bat’ on your desktop. To do this, you would put the following line, adapted with your values, in the file:
‘C:\directory\anotherone\velbus-server.exe COM1 3788’
Save it. Now you can doubleclick the file to launch the program.

This might be to simplistic for you, but a step-by-step guide might be usefull for anyone. : )

Let me know if this makes a difference for you.

Cheers,
David

thank you david for the prompte reply, will test it tomorrow and get back to you ASAP!

:slight_smile:

All the above worked, but:

no playlist, I see my vmb4ry, but how could I interact…?
http://www.andalussyat.com/sc.jpg

[quote=“Ciceron”]thank you david for the prompte reply, will test it tomorrow and get back to you ASAP!

:slight_smile:

All the above worked, but:

no playlist, I see my vmb4ry, but how could I interact…?
http://www.aknari.com/sc.jpg[/quote]

I can’t reach the server where the image’s on. I’m not to familiar with VelbusSocket, but I believe that you can’t interact with the modules listed in the interface. To interact with channels of certain modules you have to add the necessary data in the ‘data.xml’ file in the same directory. This will make the commands for each channel show up in the uppermost list in VelbusSocket.exe. You can then activate or deactivate each channel by clicking the right command. You can visit code.google.com/p/flexvelbussocket/ for more info on the ‘data.xml’ file.

Or did you adapt the xml-file already? If you can’t figure it out, you can ask here again and I’ll try and explain that bit too.

EDIT:
Now I see the picture. As I figured, you didn’t adapt the xml-file. Visit the website, visit this thread, give it a try and if it didn’t work we’ll try to clarify things for you.

I adapted the xml file perfect!

I can command the vbm4ry!!

How can I commande the vmb1dm?
how can i display the song status?
can you send me the .fla file so I can skin the swf?

many thanks again

I am planing on creating an automated xml file and batch file with my PHP program online…

You might have noticed that GertST is the actual creator of the Flex Velbus Socket tool, not me. But you can check here for the source of the program. Maybe you can recompile it with an adapted lay-out or something.

About controlling the vmb1dm. You can only send preset commands. So the only thing you can do is use VelbusLink to give the dimmer certain commands (e.g. on, off, 50%, …), capture the data of the commands in the log window and put it as commands in the xml file. There is a command the example XML that dims lights slowly, you could check it out.

I suggest you examine the example xml-file and the homepage for more info on implementing the song status and other things in the program.

Cheers

OK
i will contact GertST!

I programmed" switch all" and “switch off all.”

I have a bug when I switch off all , it execute and freez…
http://www.andalussyat.com/sc2.jpg
http://www.andalussyat.com/sc3.jpg

any clue?

I would like to change the kinggnare skin: ntt.cc/ext/KingnareStyle-Skin/Ki … -App.html#

It would be fun to play with colors and and pictures… :slight_smile:

velbus-server.exe says that the connection had been closed from the other side and keeps on working besides that. It’s the flex tool that closes the connection, probably because of an error. I will investigate the packet you send, can you tell me how you obtained it? (Tout éteindre: 0FF80004002000000D504)

EDIT:
I can’t seem to reproduce your error. Maybe you should check whether your button is correctly configured to activate all lights or something?

Actually it happened when i switched all on and off from the flex tool.

EDIT:
may be packet collision, since I was to fast??
just reproduced the problem, when i click to fast to change status!

And server doesnt crash until flex is closed since freezed…

obtained 0FF80004002000000D504, from velbuslink log
http://www.andalussyat.com/sc4.jpg

But you’ve configured a button to activate or deactivate all lights, right? Then it’s only one command and therefore not enough packets to collide…

try to switch between ON an OFF faster, it will crash…

may be it is the wrong commande?

No,

I programmed 2 buttons:

1-all on
2-all off

[quote=“Ciceron”]

No,

I programmed 2 buttons:

1-all on
2-all off[/quote]

Yes, that’s what I meant, so putting all the lights on equals one command, which equals one packet, right? I don’t see how you could get packet collision that way, but maybe I’m not seeing something…

When you keep VelbusLink open while sending the command and thus freezing VelbusSocket.exe, do you see the exact same packet in the log?

normally a ‘All On’ or ‘All Off’ pushbutton will send to each module the command to switch off the relays and dimmers. So when you have i.e 5 relaymodules and 5 dimmodules you have to address each module with his address and command. i think you can’t do it with one packet.