Go Down

Topic: webserver - doubts (Read 980 times) previous topic - next topic

simmete

I would like to better undestand the webserver concept regarding arduino boards:

I am using the Arduino Ethernet board right now (later the MEGA+ETH Shield) and the webduino library.

I am including right now the jquery.js file in this way:

Code: [Select]
P(http200Ok) ="HTTP/1.1 200 OK";
P(httpContentJavascript) = "Content-Type: application/javascript";

void loadJS(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete){
  server.printP(http200Ok);
  server.println();
  server.printP(httpContentJavascript);
  server.println();
  server.println();
  myFile = SD.open("jquerym.js", FILE_READ);
  int16_t c;
  while ((c = myFile.read()) >= 0) {
    server.print((char)c);
  }
  myFile.close();
}


The file is about 90KB and it takes too much time to load it.

Is there any better way to menage this? Maybe reading more bytes o others solutions?

I cannot connect the board to internet:
Code: [Select]
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>

Is there any lighter verion of this? I tried the mobile version but the result is tha same...

How do U menage this?

PaulS

Quote
The file is about 90KB and it takes too much time to load it.

What file is? Are you referring to jquerym.js?

Quote
How do U menage this?

Don't use java scripting.

simmete

Quote
What file is? Are you referring to jquerym.js?

yes, this:
Code: [Select]
http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js

Quote
Don't use java scripting.

So what do U use for this? like reload part of the page and easy little graphs?

thanks!

PaulS

Quote
So what do U use for this?

For one thing, I use proper spelling, like "you". This is not a texting chat room.

Some context for what you are trying to do would be appropriate.

simmete

1) I need the capability to control some output in funcion of a scheduler file that I read from the SD card during the setup() function.
2) I also have to read sensors and log it.

So:
1) I'd like to reload part of the page to keep the valued updated (almost every second)
2) display the trend of data by clear and easy graph

Go Up