How can I send data from Arduino to C# server?

Hello!

I need a program that would send data from Arduino to a c# server trought WiFi (and the data will be stored but I can do that myself). I have never done something like this before so I don't even know where to start. If you could help I would be grateful. P.S. if it's not that big of a problem please don't send windows forms code.

I'm sorry for my English.
Have a nice day :wink:

The Arduino Wifi library examples demonstrate all the internet protocols that you can use to communicate with a server. Everything else is on the server side, it's up to you to figure out how to configure it. That part is not really an Arduino question, it's a C# question.

What protocol will you use? UDP? TCP/IP? HTML get/put?

Ok, here's your breakdown.

It doesn't matter what you program your remote host in. What matters is the form of the data that it expects. Once you have that, you need to solve the issue of..

Getting your Arduino to go online
Connect to the other host and..
Transfer the kind of data the other side expects.

-jim lee

aarg:
The Arduino Wifi library examples demonstrate all the internet protocols that you can use to communicate with a server. Everything else is on the server side, it's up to you to figure out how to configure it. That part is not really an Arduino question, it's a C# question.

What protocol will you use? UDP? TCP/IP? HTML get/put?

As I said I have no idea how does it work so I don't know which protocol should I use

jimLee:
Ok, here's your breakdown.

It doesn't matter what you program your remote host in. What matters is the form of the data that it expects. Once you have that, you need to solve the issue of..

Getting your Arduino to go online
Connect to the other host and..
Transfer the kind of data the other side expects.

-jim lee

I want do send string/text data

Then it's time to do a little research. You mentioned C#, is that your preferred method for setting something up on your server?

A common method is to build a web page and pass your data to it through a GET request. So far though, from the little detail provided, its hard to make recommendations.

you can send data via a raw TCP connection. Arduino acts as TCP client and your C# program acts as server.
You may make a question that "how can C# program know where a message is started and ended". The simple answer is:

  • If it is string/text data, choose a special character as the delimiter.
  • If it is binary data, you may need to implement a data frame format.