Loading...
Pages: [1]   Go Down
Author Topic: How to send data to a webserver w/o uing the "client.print" command?  (Read 398 times)
0 Members and 1 Guest are viewing this topic.
Buenos Aires, Argentina
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I'm working in a project to display the status and activation time of several digital inputs in a webserver based in an Arduino UNO + Ethernet shield + RTC module.
The problem I have is that the SRAM of the Arduino UNO gets easily full due to the "client.print" command line sed to display the data in the webserver. Because of this, I am currently analysing the possibility of programming a webserverd stored in the Ethernet shiled's SD card, inspired in the TinyWebServer.
The question I have is how to send Arduino data to the webserver without using the "client.print" comand line. Any suggestion to start?
(I'm not a HTML or Java expert)

Thank you very much.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5170
CMiYC
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

client.print(F("whatever"));

F() keeps the const char in PROGMEM.
Logged

www.cmiyc.com - A guide to being an Enginerd

0
Offline Offline
Tesla Member
***
Karma: 50
Posts: 6548
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Below is a short example of the F() progmem macro.

Code:
          client.println(F("<HTML>"));
          client.println(F("<HEAD>"));
          client.println(F("<TITLE>Arduino GET test page</TITLE>"));
          client.println(F("</HEAD>"));
          client.println(F("<BODY>"));

          client.println(F("<H1>Zoomkat's simple Arduino button</H1>"));
         
          client.println(F("<a href='/?on''>ON</a>"));
          client.println(F("<a href='/?off''>OFF</a>"));

          client.println(F("</BODY>"));
          client.println(F("</HTML>"));
 
Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
GOOGLE ADVANCED FORUM SEARCH BELOW!  
Go to:  http://www.google.com/advanced_search?hl=en
put in key search words,
use site or domain:  http://arduino.cc/forum
or in a google search box put key words site:http://arduino.cc/forum

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 315
Posts: 35519
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem is not with the client.print() or client.println() function taking space in SRAM. It is with the constant data being printed being stored in SRAM that can be a problem.

Code:
client.print(file.read());
will use no SRAM.

Not that sending one character at a time is good idea, but it illustrates a point.
Logged

Pages: [1]   Go Up
Print
 
Jump to: