Pages: [1]   Go Down
Author Topic: HTTP Response Data - User checkin - wiznet?  (Read 410 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 87
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi...  My application involves using RFID and an internet server/database that monitors RFID cards to tell which one being read is valid or not.  If it is valid, then a user is allowed entrace into a building.  

I have a processing program that will submit a php program which in turn sends data to an oracle database. Once it is successful, the oracle database will return a value and the php program will display that value. I then use a routine to return the value to my processing program.  

My problem is that the response back to my processing program is painfully slow - up to 10 seconds or so due to the length of data in the http reponse header.

I would like the response as quick as possible - is there another way to do it? Would using something like Wiznet allow for a quicker response?
 
I have based my program and logic on Tom Igoe's sample program "A networked cat".

Here is the code behind getting the http response value:


// **************************************************************************************
void checkNetClient() {
  // available() returns how many bytes have been received by the client:
  if (client.available() > 0) {
    // read a byte, convert it to a character, and add it to the string:
    responseString +=char(client.read());  
   // print the response:
    //println(responseString);
   //much of the data being returned is HTTP header information
  
    // add to a line of |'s on the screen (crude progress bar):
   print("|");
  }
  // if there's no bytes available, either the response hasn't
  // started yet, or it's done:
  else {
    // if responseString is longer than 0 bytes, the response has started:
    if(responseString.length() > 0 )  {
      // you've got some bytes, but now there's no more to read. Stop:
      if(requestInProgress == true) {
        //println ("REQUEST IS NOW OVER - REQUEST IS NOW OVER - REQUEST IS NOW OVER - REQUEST IS NOW OVER");
        
        // print the response:
        println(responseString);
        
        // note that the request is over:  
        requestInProgress = false;
        
        // reset the string  for future requests:
        responseString = "";
        
        // turn led off
        //myPort.write('0');
        //myPort.write('2');
        //myPort.write('3');
        
      }
    }
  }
}
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How much data are you sending (I'm guessing that you're sending it via serial)?

I have an Ethernet shield with a Wiznet on it,  so I could run a couple of benchmarks for you,  if you have something to try.

I'm not sure what sort of throughput you can get with the Wiznet:  there are lots of possible bottlenecks,  and the chip internals are not exactly "extensively documented".  :smiley

Ran
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 87
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, thanks so much for answering... I abandoned the whole http response process and came up with another method that will work for my purposes...

However, I have had limited success with the wiznet module... Which is now my center of focus...

Seeing you have it up and running, I hope you can be of help.  

I hate clogging up this forum with config/troubleshooting messages though...

Can we talk/message off line? Are you located in the states?

Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Are you located in the states?

Well,  that may depend on your politics:  a lot of the folks on Daily Kos,  and similar "liberal" venues,  are quite adamant that most of Arizona is not (or,  at the very least,  shouldn't be)   ;D

I sent you an email via the board,  so you have my address now.  But,  if you have any questions that might be of general interest,  it's probably better to ask them here:  there are other people who've also expressed frustration with getting the Wiznet module working,  and might appreciate the answers (especially if I manage to get them right).

If your Wiznet module doesn't seem to be working at all,  make sure you haven't overlooked the added wire that's needed for the reset line:  that was the mistake I made that caused me a lot of frustration.

Also do a forum search for the Ethernet2 library,  and the updated Client code.  I think the changes to Client have been incorporated into arduino-0016.  The Ethernet2 code may have been,  too:  there are some changes from 0015,  but I'm not sure whether they came from Ethernet2,  or elsewhere.

Ran
Logged

Pages: [1]   Go Up
Jump to: