Pages: [1]   Go Down
Author Topic: How to send data to a webserver w/o uing the "client.print" command?  (Read 747 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
Online Online
Faraday Member
**
Karma: 71
Posts: 6141
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

F() keeps the const char in PROGMEM.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
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

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48556
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
Jump to: