Pages: 1 [2]   Go Down
Author Topic: Arduino SPI Ethernet interfacing problems  (Read 3720 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using an arduino 2009 and the size is:

 "Binary sketch size: 10070 bytes (of a 30720 byte maximum)".

Alvaro ,Thank you very much for your support...
Logged

Rio de Janeiro, Brazil
Offline Offline
Jr. Member
**
Karma: 1
Posts: 85
Software developer, free software activist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using an arduino 2009 and the size is:

 "Binary sketch size: 10070 bytes (of a 30720 byte maximum)".

Alvaro ,Thank you very much for your support...


Here the size of the example WebServerSimpleLED compiled to Arduino Duemilanove is 10,018 bytes. So, I think you are not compiling the same thing. Maybe you *are not* compiling the standard Arduino Ethernet library because it generally has smaller size than my library. But, if your compiled code is greater than mine, probably you are compiling something different from me.

Is the debugging feature enabled? Check if the line "#define ETHERSHIELD_DEBUG" utils/socket.h is commented.
Logged

Blog pt_BR: http://blog.justen.eng.br/
Curso de Arduino (Arduino Course, in Brazil) - http://www.CursoDeArduino.com.br/

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using an arduino 2009 and the size is:

 "Binary sketch size: 10070 bytes (of a 30720 byte maximum)".

Alvaro ,Thank you very much for your support...


Here the size of the example WebServerSimpleLED compiled to Arduino Duemilanove is 10,018 bytes. So, I think you are not compiling the same thing. Maybe you *are not* compiling the standard Arduino Ethernet library because it generally has smaller size than my library. But, if your compiled code is greater than mine, probably you are compiling something different from me.

Is the debugging feature enabled? Check if the line "#define ETHERSHIELD_DEBUG" utils/socket.h is commented.

No,the ETHERSHIELD_DEBUG line is commented in utils/socket.h ...If i "de-comment" this line,the new binary sketch is 13162 bytes.
I tried to eliminate all libraries in the library directory of arduino's IDE;I've re-downloaded from your link https://github.com/turicas/Ethernet_ENC28J60/ from the button download easly,I've extracted it with winrar and i've re-named the directory extracted,cause Arduino's IDE otherwise say me that the library's name should contains only basic numbers and ASCII characters,so new name is turicas.When i compile the size of the binary rest the same I posted you some post ago(10070 bytes).
The version of Arduino's IDE I use is the 022,and the java version on my system is 1.6.0.25 (64 bit version...)

The sketch i compile is which i found on the library's examples named WebServerSimpleLED (as you suggested to compile)
Its content is this:


#include <Ethernet.h>
#define LED 8

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 123 };
char link[30], LEDStatus[4];

Server server(80);

void setup() {
  pinMode(LED, OUTPUT);
  Ethernet.begin(mac, ip);
  server.begin();
}

void loop() {
  Client client = server.available();
  if (client) {
    char request[10];
    int i = 0;
    boolean current_line_is_blank = true;
    request[9] = '\0';
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (i < 9) {
          request = c;
          i++;
        }
        if (c == '\n' && current_line_is_blank) {
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          
          client.println("<html><head><title>Arduino etherShield</title></head><body>");
          client.println("<h1>Arduino etherShield Example</h1>");
          client.println("<table>");
          client.print("<tr><td>Analog inputs:</td><td><b>");
          for (int x = 0; x < 6; x++) {
            client.print(x);
            client.print(" = ");
            client.print(5000 * (analogRead(x) / 1024.0));
            client.print(" mV<br>");
          }
          client.println("</b></td></tr><tr><td>uptime:</td> <td><b>");
          client.print(millis() / 1000.0);
          client.println(" seconds</b></td></tr>");
          if (strncmp("GET /off", request, smiley-cool == 0) {
            digitalWrite(LED, LOW);
            sprintf(LEDStatus, "OFF");
            sprintf(link, "<a href=\"/on\">Turn on</a>");
          }
          else {
            sprintf(LEDStatus, "ON");
            digitalWrite(LED, HIGH);
            sprintf(link, "<a href=\"/off\">Turn off</a>");
          }
          client.print("<tr><td>LED status:</td> <td><b>");
          client.print(LEDStatus);
          client.println("</b></td></tr><tr><td colspan=\"2\" align=\"center\">");
          client.println(link);
          client.println("</td></tr></table></body></html>");
          break;
        }
        if (c == '\n') {
          current_line_is_blank = true;
        } else if (c != '\r') {
          current_line_is_blank = false;
        }
      }
    }
    delay(1);
    client.stop();
  }
}

At this point,if you can send me your binary file of WebServerSimpleLED ,if you can,so i can try it and eliminate all duobts about the compiled file version that i use...

Thanks
« Last Edit: August 28, 2011, 12:40:11 pm by LoScuby » Logged

Pages: 1 [2]   Go Up
Jump to: