Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index.htm try to load a page from sd card #69

Closed
NitrofMtl opened this issue Sep 29, 2015 · 3 comments
Closed

index.htm try to load a page from sd card #69

NitrofMtl opened this issue Sep 29, 2015 · 3 comments

Comments

@NitrofMtl
Copy link

Hi.

I'm just begun to use this lib, and I try to fit it with a sketch a have already begun. In that on, my page template is store on the sd card. I do not understand all the example because I'm a newbie in programming in both web page and c++.

I've tried to modify the example and It compile but the page only respond with a bunch on html call text:

0HTTP/1.0 200 OK Server: Webduino/1.7 Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 33HTTP/1.0 200 OK Server: Webduino/1.7 Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 68HTTP/1.0 200 OK Server: Webduino/1.7 Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 79HTTP/1.0 200 OK Server: Webduino/1.7 Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 67HTTP/1.0 200 OK Server: Webduino/1.7 Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 84HTTP/1.0 200 OK Server: Webduino/1.7 Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 89HTTP/1.0 200 OK Server: Webduino/1.7 Access-Control-

here what I've done so far:

void outputPins(WebServer &server, WebServer::ConnectionType type, bool addControls = false) // this function should be replace by loadhtml
{

          // web page request
        // send web page
        webFile = SD.open("index.htm");        // open web page file
        if (webFile) {
          while (webFile.available()) {
            server.httpSuccess();
            server.print(webFile.read()); // send web page to client
          }
          webFile.close();
        }

}

but here is the idea: can it be possible to include file template or file get request on it.. that could very simplify both html and c++ coding.... (so I think so... :P)

and also: Is client post method support nested arrays ?

thanks

@unwiredben
Copy link
Collaborator

I do not recommend using SD library with this. Both the SD card and the WS5100 use the SPI connection and it's possible that accessing SD card can interfere with the network connection.

@systronix
Copy link

But why not, if the SPIs have different slave selects? They are completely separate in that case.

@unwiredben
Copy link
Collaborator

When I originally wrote this library, the SD card slot on the Ethernet shield wasn't working well and may have been wired incorrectly. This looks to have been addressed with later revisions.

I also think the original Ethernet library wasn't so careful about deasserting chip select between operations.

Anyway, this library is no longer being actively maintained; I accept pull requests, but I don't have a use for this myself anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants