I'm a bit new to the Arduino, I can read and understand the code, but I'm a little rusty on writing it.
I've been working on this for a week now, I've been searching everywhere but have not found any answers that help me. edit: I'M GOING CRAZY!!! :-?
>I'll explain what I'm attempting to do to give you a better idea of what I need.
If you don't want to read everything I typed, then just scroll to the bottom of my post.
Basic Project description:
I'm working on a project that needs to get data from a web page and store that data as a variable which I can call on later and display that on a set of 7-segment led displays. I am using a Duemilanove board with an adafruit xport shield and an xport direct (not a plus).
First thing's first:
I need the arduino to connect to a web server via the xport (telnet through port 80). The server uses some php code to get and process data from a MSSQL database. The only thing this page displays is 2 numeric characters and at times, 1 alpha character.
Therefore, using a simple "GET /whatever.php" command should work. (This works perfectly and only returns 2-3 characters when I telnet into the server from my pc.)
Once this command is issued, the server should send a couple numbers to the arduino. Eventually I will need those numbers to be displayed on a sign, but I'm not ready for that step.
I would rather just use the normal serial port (0,1) because I wont be using it for anything else in the final project and because my understanding is that it's more reliable than SoftSerial. Also, neither the AFSoftSerial, the AF_XPort, or the NewSoftSerial have worked so far (lack of documentation) so I'm down to my last resort of using the built-in standard serial pins. If any of these above mentioned libraries work, then I have no problem using them.
Here is what I have so far
#define rxPin 0
#define txPin 1
#define rsPin 4
int incomingtxt = 000;
void setup()
{
Serial.begin(9600);
}
void loop()
{
xportReset();
httpRequest();
}
void xportReset()
{
pinMode(rsPin, OUTPUT);
digitalWrite(rsPin, LOW);
delay(100);
digitalWrite(rsPin, HIGH);
delay(5000);
}
void httpRequest()
{
Serial.println("GET /displayfiles/db.php");
incomingtxt = Serial.read();
Serial.println(incomingtxt, DEC);
}
I KNOW the code is wrong, trouble is, I don't know how to see what I'm receiving back other than to serial.print it. And I know that serial.read only reads 1 byte. So what I need is a way to read 2-3 characters. I have the xport set up to auto connect to an IP and port in order to slim down the code size.
XPort Setup:
Baudrate (9600) ?
I/F Mode (4C) ?
Flow (00) ?
Port No (80) ?
ConnectMode (05) ?
Send '+++' in Modem Mode (N) ?
Show IP addr after 'RING' (Y) ?
Auto increment source port (N) ?
Remote IP Address : (172) .(030) .(231) .(068)
Remote Port (80) ?
DisConnMode (00) ?
FlushMode (33) ?
DisConnTime (00:00) ?:
SendChar 1 (00) ?
SendChar 2 (00) ?
Bottom Line:
Any suggestions on how I can go about sending a "GET / " command and receive, store, and display a 2-3 character number?
THANK YOU!!!!! for any help you can give me.