from Arduino to a local host

Hi guys,
I am currently doing my senior design project. And I am kind of new to the world of Arduino and software market. I have the data displayed on the Arduino interface, and all what I want to do is to take these data and put it in my "locatlhost" or anythoing from which I can export to the localhost.
Do you guys have any solutions or recommendations ? what kind of codes should I write ? if you can post the code I will be appreciated.

Thank you
Ahmed

localhost is a description of a web server running on the local machine. Does the Arduino have an ethernet shield, so that it can access the web server?

Actually I have a wireless shield that supports Wifly. But can I do it through a USB cable

Thank you

But can I do it through a USB cable

No. You can send a GET request to the serial port, but there needs to be something that bears a strong resemblance to a httpd that is monitoring that serial port. The httpd that is running on your localhost does NOT monitor the serial port.

Now, Processing could be used to talk to the Arduino and make get requests on its behalf.

What is the server going to do with the data?

I really appreciate your efforts. so, the localhost will receive the data, its basically 0 or 1 and put them in Mysql table for which we have some PHP files that run our algorithm. So the ethernet shield will be responsible for these requests from the serial ports?? and in which language can we send these get requests ??

Thank you

Do you understand what "localhost" is?

I think that's going to be a key component to making your project work?

If you have more information than I do please share ? what is a "Localhost". I will be really appreciated if you have an answer to my main question and mean while give me some useful information about what is a localhost.

Thank you

I have read it. and still it does not answer my main question. Thank you anyway . I really appreciate your time and efforts.

Thank you

Do you actually have a localhost as defined in the wiki article or are you just using the word "localhost" to mean the computer that your Arduino is connected to via USB ? Either way it is possible to send data to the computer.

Perhaps if you could clear that question up we could give more advice.

If I understand your question correctly and you want to output data from the Arduino and then display it via a webserver and considering what the other person says, what you need to make happen is to have an interface that listens to serial communication and then forwards it to a script running on the webserver.

As far as I know this should be possible (but I only got my Arduino two days ago)

In networking localhost just refers to the local machine, whatever it is. If you send something to localhost by name or IP address (eg 127.0.0.1), it does not really get routed anywhere but the local machine. It'll just connect directly to the service, like the webserver, bypassing some of the layers that it would otherwise have gone through and putting less load on the network interfaces. Also called the loopback address.

In networking localhost just refers to the local machine, whatever it is.

But, generally, the term is used to refer to the local machine as the server, when pointing a web browser to a web server.

You need to have something like Apache installed on the PC that you want the Arduino to send data to. Apache, PHP, and MySQL play well together, and are collectively referred to as LAMP (for Linux) or WAMP (for Windoze). I'm not sure what the equivalent is for the Mac, being a Mac owner for less than 24 hours.

The Arduino will not be accessing localhost, though. Your web server has a name that it is referred to by when being accessed from other devices on the network.

Personally, I think you should forget about the Arduino for a while. When you can get another PC to access a script on your server, and send it data/get data from it, then you can make the Arduino do the same thing. By then, the whole client/server architecture will be a lot clearer to you, and you will be able to ask questions using proper terms. You'll fully understand the scope of "localhost".

Of course, the first step is to understand how a client accesses a script on the server. This is far easier to understand, develop, and debug when the client and server are running on the same machine, known as localhost. When a client, running on the server, can access a script, even if the script is nothing more than a "Hello world" type example (no dynamic content), then learn how to access that server/script from another machine (not localhost any more).

Then, move on to getting dynamic content. Then, sending data to the server to store.

When that all works, from two PCs on the same local area network, you can get the Arduino to do the same thing as the PC client, if it is wearing an ethernet shield and is part of the same local area network.

PaulS:

In networking localhost just refers to the local machine, whatever it is.

But, generally, the term is used to refer to the local machine as the server, when pointing a web browser to a web server.

You need to have something like Apache installed on the PC that you want the Arduino to send data to. Apache, PHP, and MySQL play well together, and are collectively referred to as LAMP (for Linux) or WAMP (for Windoze). I'm not sure what the equivalent is for the Mac, being a Mac owner for less than 24 hours.

AFAIK PHP can't read /dev/ streams, I think that with a Perl script running as CGI on Apache etc could listen to /dev/[USB] and then output stuff (It might be possible in PHP I just feel like PHP is much much much less then Perl, oh and in theory he could write the CGI in C).

But we would need to know if he have a webbserver setup etc

AFAIK PHP can't read /dev/ streams

I'm not sure the relevance of this observation. I have WAMP running on my PC, and my Arduino is able to contact the server, and cause PHP scripts to be executed, storing data in, or fetching data from, a MySQL database.