Go Down

Topic: TCP DIALOG between ARDUINO and VB.NET program (Read 2200 times) previous topic - next topic


I have this gola : collect with arduino a digital input and send it on tcp/ip to a VB.NET program that write a string on DB every time the digital input comes.

I've got 2 Option
1) Arduino is the server and open a prt, VB.NET application is a client that connect to ARDUINO port
2) Vb.NET program is the server that open a port, Arduino connect as clinet to taht port

Wich solution is better?


I have setup the arduino as a tcp server in my home heating setup.
My argument was that the PC wouldn't always be on, so there was no need for the
Arduino to try to connect to it.

Hope this helps - it seems like you have posted the same question in the Italian section


get an ethernet shield and start sending the data via the Webclient example. Or... post the digital pin status to Pachube and check it online... or, put the arduino running a webserver that receives a configuration from the client computer in case you need to change something.

To be honest, whoever is the server doesn't quite make a big difference, unless you plan on using HTTP... other than that, I think that it really depends on your application. You may end up needing both cases.

Say you want to turn off a light via a web browser (or an "internet" application), then your Arduino needs to be receiving connections (being a server) so that your computer can tell it to turn off the light.

But say that you are monitoring the temperature of your living room... then Arduino needs to send data to the server, so it will be a client. See where I'm getting at?

This... is a hobby.

Go Up