Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / email notification on: August 29, 2012, 06:17:02 am
Is there any way to send email for event notification without use any external device (like php server or whatever)?
My smpt requires SSL and username/password.
Thanks
2  Using Arduino / Programming Questions / Re: CSV integere number parsing on: August 29, 2012, 06:14:33 am
Quote
How can I parse this and convert into integer values?
First, you have to get the data off the SD card, into an array. Then, you can use strtok() to extract the tokens, and atoi() to convert the tokens to integers, where appropriate.

ok, thanks!
3  Using Arduino / Programming Questions / CSV integere number parsing on: August 29, 2012, 05:06:11 am
Hi,
I need to parse a CVS file like this:

Code:
1;0;0;1;10;0;1;one
2;0;0;5;1;0;1;two
2;0;0;8;1;0;1;three

I have this file on SD card.
All values are integers except the last.

How can I parse this and convert into integer values?

Thanks in advance.
4  Using Arduino / Storage / Re: webserver - doubts on: August 16, 2012, 12:27:20 pm
I will check.
Thanks!
5  Using Arduino / Storage / Re: webserver - doubts on: August 08, 2012, 06:56:52 am
1.
Quote
Not exactly what a browser was designed for. But, there have been all kinds of enhancements made to support all kinds of uses. Of course, they come at a price.
What kind of hardware do you think is proper to do this? I would like have only one device and not a linuxbox connected to an arduino board...

2.
Quote
One way around the "problem" is to link to the javascript from some other server.
Yes, but I cannot count on other device on the network.

So about the reload data I think the only way is a <META> on the html and about the graph... this can be menaged by other server, just getting data from arduino.
Or maybe is there any proper device? (see point 1.)
thanks again.

6  Using Arduino / Storage / Re: Webduino, getting data from SD card on: August 08, 2012, 06:47:24 am
Quote
You have two lines of code that I highlighted. The first says that the requested file does not exist. The next one says what? It says that the remaining data is to be interpreted as "Content-Type: image/png".

There being no more data, why are you saying that it is image data?

Clear.

P.S. sorry for the spelling :-)
7  Using Arduino / Storage / Re: Webduino, getting data from SD card on: August 08, 2012, 05:56:20 am
 smiley-cool
can you please better explain?

8  Using Arduino / Storage / Re: webserver - doubts on: August 08, 2012, 05:55:06 am
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
9  Using Arduino / Storage / Re: Webduino, getting data from SD card on: August 08, 2012, 05:43:22 am
can U please better explain?
thanks.
10  Using Arduino / Storage / Re: webserver - doubts on: August 08, 2012, 05:41:18 am
Quote
What file is? Are you referring to jquerym.js?
yes, this:
Code:
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!
11  Using Arduino / Storage / webserver - doubts on: August 08, 2012, 05:21:31 am
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:
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:
<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?
12  Using Arduino / Storage / Re: Webduino, getting data from SD card on: August 08, 2012, 04:59:27 am
thanks, you are right!

Do you mean somethiing like this?

Code:
myFile = SD.open(image, FILE_READ);
if(myFile){
  server.printP(http200Ok);
  server.println();
  server.printP(httpContentPNG);
  server.println();
  server.println();
  int16_t c;
  while ((c = myFile.read()) >= 0) {
    server.print((char)c);
  }
  myFile.close();
}
else{
 server.println("HTTP/1.1 404 Not Found");
 server.printP(httpContentPNG);
 server.println();
 server.println();
}
13  Using Arduino / Storage / Re: Webduino, getting data from SD card [SOLVED] on: August 07, 2012, 09:02:05 am
I found my way:
using webduino and use a GET command:

Code:
P(http200Ok) ="HTTP/1.1 200 OK";
P(httpContentPNG) = "Content-Type: image/png";

void image(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete){
  loadImage(server, "image.png");
}

void loadImage(WebServer &server, char* image){
  server.printP(http200Ok);
  server.println();
  server.printP(httpContentPNG);
  server.println();
  server.println();
  myFile = SD.open(image, FILE_READ);
  int16_t c;
  while ((c = myFile.read()) >= 0) {
    server.print((char)c);
  }
  myFile.close();
}

and on setup function:
Code:
//load image from SD
  webserver.addCommand("image.png", &image);

another way was using the bytearray of image:
Code:
void imageLedOff(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete){
  P(ledOff) ={
    0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,
    0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x08,0x02,0x00,0x00,0x00,0x90,0x91,0x68,0x36,
    0x00,0x00,0x00,0x01,0x73,0x52,0x47,0x42,0x00,0xae,0xce,0x1c,0xe9,0x00,0x00,0x00,
    0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00,0x00,0x0b,0x13,0x01,0x00,0x9a,
    0x9c,0x18,0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xdc,0x08,0x06,0x0d,0x13,
    0x34,0xf4,0xb0,0x44,0x9d,0x00,0x00,0x00,0x22,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,
    0x6d,0x65,0x6e,0x74,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,
    0x68,0x20,0x47,0x49,0x4d,0x50,0x20,0x6f,0x6e,0x20,0x61,0x20,0x4d,0x61,0x63,0x87,
    0xa8,0x77,0x43,0x00,0x00,0x00,0x16,0x49,0x44,0x41,0x54,0x28,0xcf,0x63,0xfc,0xcf,
    0x40,0x1a,0x60,0x62,0x18,0xd5,0x30,0xaa,0x61,0xd8,0x6a,0x00,0x00,0x40,0x2e,0x01,
    0x1f,0xb1,0x90,0xc2,0x4d,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
  };

  if (type == WebServer::POST){
    // ignore POST data
    server.httpFail();
    return;
  }

  // for a GET or HEAD, send the standard "it's all OK headers" but identify our data as a PNG file
  server.httpSuccess("image/png");

  // we don't output the body for a HEAD request
  if (type == WebServer::GET){
    server.writeP(ledOff, sizeof(ledOff));
  }
}

and on setup function:
Code:
/* register our image output command */
  webserver.addCommand("ledOff.png", &imageLedOff);
14  Using Arduino / Storage / Webduino, getting data from SD card on: August 05, 2012, 06:00:51 am
Ciao!
I am writing a simple applicatin that shows sensor's state on a webpage.
I am using webuino and averythings seems work.
I want right now include some images on my page and I would like store these on the SD card.
I car read and write there but I cannot undestand the way to address this images.
Any idea/example?
Thanks in advance
Pages: [1]