I’ve to make my apologize to danssaertd who have done a great job too !
I’ve downloaded it server (a long time ago)but by mistake, never tried it !
This time, I check it and this should do the job for me until VEL448 has completed it own soft.
It’s like an educational project : Cisco has began with free course, then exam and now every students (in computer and networking) knows better IOS Cisco rather opposite OS (like JunOS, etc.)
It’s very important for Velbus community to have an IP/USB server because lot of developpers (and lot of language) are more aware about TCP connexions. More applications gives more power to Velbus domotic knowledge, then more Google answers to “domotic example”… get to Velbus community, then… more Velbus sells
It’s a pitty that Velleman removed the server functionality in the first Velbuslink software versions and never came up with a decent alternative, although they promised to do so several times.
Of course there’s a commercial server available now (part of the Home Center package). I hope this is not the reason why Velleman did not work anymore on the promised free version … Velleman, please say you have other reasons!
So please Velleman, make a decent version or work together with already existing ones like the server of Danssaertd. It’s already a very good one, in fact.
@GerSt : I think that’s not the reason because it’s more a limitation rather an expansion. There are other limitation like (maybe)…
a new Ethernet module,
multiples commands in same time (through Ethernet and Velbulink and pushbutton) : how to manage ?
developpement (for Windows, linux, MAC, etc.) ?
However, my experience is just on network : Ethernet/TCP-IP still there because other protocol like FDDI, ATM, etc. were too much expensive and commercials. TCP/IP is educationnal : free, so easy to use and to learn.
Althrough, maybe VEL448 isn’t listen in Velbus hierarchy and it dev is private only, not official. In this way, VEL448 couldn’t give officialy a definitive code because Velleman don’t decide to use it…
Hi there…
danssaertd : sometime, the ethernet server seems to be freezing, not exactly doing nothing but when my program close unexpectedly, it seems to have an interaction with your server module… is there a way to debug ? next time it arrived, I will send you the last message in server mode EXE (from DOS command line)
However, thanks a lot for this autostart able program (I’ve put it in Start menu of windows).
Hi,
I’ve experienced something like that before myself. Apparently my program doesn’t handle interrupted connections in a very nice way. I thought that, on my server, the program continued working anyway But maybe I’m wrong. I’m really busy right now with exams and other stuff. But as soon as I find some time, I will fix this and the other ‘abnormality’ that someone mentioned earlier.
[quote=“danssaertd”]Hi,
An error message would sure help a lot. : )
Greetings[/quote]
here it is…
Client #11 connected.
Client #11 disconnected.
Client #10 disconnected.
Client #12 connected.
An existing connection was forcibly closed by the remote host
System.Net.Sockets.SocketException (0x80004005): An existing connection was forc
ibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte] buffer, Int32 offset, Int32 size, So
cketFlags socketFlags)
at libvelbusserver.Server.Send(Byte] data)
Client #13 connected.
System.Net.Sockets.SocketException (0x80004005): An existing connection was forc
ibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte] buffer, Int32 offset, Int32 size, So
cketFlags socketFlags)
at libvelbusserver.Server.Send(Byte] data)
An existing connection was forcibly closed by the remote host
Like you can see, I’ve launch few time my apps (the server-mode was running since around one week). After stopping/started again server-mode, and started again my apps, it OK… else no data are displayed and my apps hang (or freeze) with 50% CPU.
The cause of that error is someone trying to send data over a closed socket, a mistake that is made a lot because you don’t always take into account that the person on the other side might be closing the socket on you
So the error is not that the socket is disconnected (TCP/IP allows it), the error is because of a send (or receive) on a closed socket
[quote=“VEL448”]The cause of that error is someone trying to send data over a closed socket, a mistake that is made a lot because you don’t always take into account that the person on the other side might be closing the socket on you
So the error is not that the socket is disconnected (TCP/IP allows it), the error is because of a send (or receive) on a closed socket[/quote]
Not clear for me : is it my program or the ‘server’ wich send data ?
However, my program don’t check Ethernet socket before sending : I’l add one check
Starting server on serial bus “COM4” and TCP/IP port 8080…
Client #1 connected.
An existing connection was forcibly closed by the remote host
System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at libvelbusserver.Server.Send(Byte] data)
I don’t know, my program will use a watchguard with network connection but for now, I can’t access through VelbusLink software if I don’t reset server-mode
My debug is following
NET BUFFER = 14
0FF8C604002000000F040000000000
Trame débute à 1 pour longeur 4
1 -----------------------
analyse sur ---> 0FF8C604002000000F04
NET BUFFER = 1470
0FF8C604002000000F04000000000FF8C604002000000F04000000000FF8C604002000000F04000000000FF8C604002000000F04000000000FF8C604002000000F04
...
0FF8C604002000000F04000000000FF
Trame débute à 1 pour longeur 4
Trame débute à 0 pour longeur 0
1 -----------------------
analyse sur ---> 0FF8C604002000000F04
NET BUFFER = 2048
0FF8C604002000000F0400000000
0FF8C604002000000F0400000000
0FF8C604002000000F0400000000
0FF8C604002000000F0400000000
0FF8C604002000000F0400000000
...
0FF8C604002000000F04...]
Trame débute à 1 pour longeur 4
Trame débute à 1169 pour longeur 4
Trame débute à 1169 pour longeur 4
... (hang)
After creating a WHILE loop with condition on buffer lengh < 2048 (and reading data in the loop), I couldn’t clear the buffer (still at 2048 as I programmed).
It’s like the server send the last packet seen of something like this.
Next time it hang, I’ll give send/receive packets through TCPView (Sysinternal tools).
Client #11 connected.
Client #11 disconnected.
An existing connection was forcibly closed by the remote host
System.Net.Sockets.SocketException (0x80004005): An existing connection was forc
ibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte] buffer, Int32 offset, Int32 size, So
cketFlags socketFlags)
at libvelbusserver.Server.Send(Byte] data)
Again… never at same time or duration or event… like an hazardeous bug.
My program have now a watchguard and ended if Ethernet buffer still full after 20 time reading/flushing it (my buffer is 2048 bytes).
But for information, the connection is permanent (bug around one time by week).
Sorry, can’t help more
As already mentioned by Vel448 you’re getting this exception because you try sending to a closed socket.
The socket can be unexpectedly closed due to networking problems or a bug in your code, this just happens…
You’ll have to handle the error (on both sides, server and client) and add a reconnect function to the client if desired.
Maybe found the problem in my program : function plot for temperature hang my program if temp below graph image (like a kind of poke)… that’s why it hang in the night (when I was sleeping of course )
Not sure but there is a problem : my configuration is velbus-server on a PC (192.168.1.250)
VelbusLink 8.4.6.1687 is running on PC 192.168.1.30
velbus-server configured : COM4 8080
Connecting by Network and use [Scan] function.
For my part, here is the result :
C:\Partage\Velbus\velbus-server>velbus-server COM4 8080
Starting server on serial bus "COM4" and TCP/IP port 8080...
Client #1 connected.
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at libvelbusserver.Packet.Clone()
at libvelbusserver.Dispatcher.Dispatch(Packet packet)
at libvelbusserver.SerialBus.Send(Packet packet)
at libvelbusserver.Server.VelBusSend(Byte] data)
I’ve finally found my mistake : when sending a 8 bytes messages I was sending 9 bytes… as buffer change, last byte could make errors.
That’s corrected since Christmas… but I still developp a server too to enhance my knowledge !