I'm playing with making a esp8266 WIFI server for the arduino.
So I'm making a server and it loads an HTML page from an SD card. It works fine when I client.write(myFile.read()), one byte at a time. It's slow to load so I have it loading chunks (64 bytes) at a time which works on the Arduino but it's giving me error on the esp8266.
while(myFile.available())
{
myFile.read(tBuf,64);
client.write(tBuf, myFile.position() - lastPosition);
lastPosition = myFile.position();
//yield for esp8266 processes
yield();
//multiple bytes doesn't work for esp8266
//client.write(myFile.read());
}
Here's the error. Not sure what it means. I've looked into the 'Core' and it looks like the methods are available.
In file included from /Users/minh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/ESP8266WiFi.h:39:0,
from /Users/minh/Documents/Arduino_esp8266/ESP8266_WAAC_WebServer/ESP8266_WAAC_WebServer.ino:6:
/Users/minh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/WiFiClient.h: In instantiation of 'size_t WiFiClient::write(T&, size_t) [with T = unsigned char [64]; size_t = unsigned int]':
/Users/minh/Documents/Arduino_esp8266/ESP8266_WAAC_WebServer/ESP8266_WAAC_WebServer.ino:202:67: required from here
/Users/minh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/WiFiClient.h:123:36: error: request for member 'available' in 'source', which is of non-class type 'unsigned char [64]'
size_t left = source.available();
^
/Users/minh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/WiFiClient.h:127:5: error: request for member 'read' in 'source', which is of non-class type 'unsigned char [64]'
source.read(buffer.get(), will_send);
^