Here is my sloppy code, please excuse the commented out sections, I am still changing the code to minimize the need for modifications to the standard libraries. The program is still sensitive to edits and I believe that there are timing issues to address, any help will be appreciated.
The changes to the standard libraries are bad form and I apologize for them but, the edits were required to get this to work. Adding the functions worked almost instantly after a month of trying to use the unmodified libraries. I will continue to try to get the standard libraries to work, there are several interesting ideas in other threads that I am going to try.....
First the Changes to the Standard 1.0 Libraries;
// In the Ethernet libraries
// in EthernetClient.h Add
uint8_t getsocket();
//after uint8_t status();
//in EthernetClient.cpp Add
uint8_t EthernetClient::getsocket()
{
return _sock;
}
// to the end of the file
// in Ethernet Server.h add
uint8_t getsocket();
uint16_t getport();
// after EthernetClient available();
// in EthernetServer.cpp add
uint16_t EthernetServer::getport()
{
return _port;
}
uint8_t EthernetServer::getsocket()
{
for (int sock = 0; sock < MAX_SOCK_NUM; sock++) {
if (EthernetClass::_server_port[sock] == _port) {
return sock;
}
}
return MAX_SOCK_NUM;
}
// at the end of the file
// in the SD library
//in SD.h add
void dirEntry(dir_t* sd_dir);
//before using Print::write;
//in SD.cpp add
void File::dirEntry(dir_t* sd_dir) {
_file->dirEntry(sd_dir);
}
// at the end of the file
After making those edits, the code in the attached file should compile and run. The listing is too long for posting.
You will need to edit the IP and MAC address to work with your setup.
You also need to comment out and/or adjust the pin settings if you have an LCD screen, otherwise comment out any LCD lines.
Let me know if this works for you.
MegaWebserverPlus.ino (35.5 KB)