- Sat Dec 05, 2015 2:27 pm
#186361
Hello,
I am using RedBoard with ESP8266. I have tried the basic example (ESP8266_Shield_Demo) and it worked fine:
* https://learn.sparkfun.com/tutorials/es ... at-library
However, after I tried to extend the example I have started to hit some yet invisible wall.
It looks like as the web server would have certain limit in bytes it is willing to send in response. I have added the Time library and simply try to show in the web page the current time. Well, it gives no result. It looks like as the calls to the Time library functions would be simply ignored.
If I try in the extended code:
Furthermore, the original code contains the reading and displaying of analog inputs:
What is puzzling me is that after construction of the htmlBody String there is the line in the code that actually sends the html page:
But the result is strangely selective, if I would try to extend the code... as the program would suddenly say: "Arghh, lets not wait the result of these function readings or int-to-string parsing; we have more important things to do, lets send partial data..." Even more, it does not matter where I put extra text before the for loop OR after it. If the text hits "some yet-unknown limit", the result goes without indexes or values.
Well, I could still understand if there will be some sort of limited buffer, but it would be rather cutting only the end of the htmlBody String or some concrete part. Instead comes some sort of "selective" "removal" of intermediate results for the functions.
What could be the reason for such strange behaviour? Could anyone kindly bring the enlightenment by opening new horizons in understanding of programming principles for RedBoard and ESP8266?
Thank you.
I am using RedBoard with ESP8266. I have tried the basic example (ESP8266_Shield_Demo) and it worked fine:
* https://learn.sparkfun.com/tutorials/es ... at-library
However, after I tried to extend the example I have started to hit some yet invisible wall.
It looks like as the web server would have certain limit in bytes it is willing to send in response. I have added the Time library and simply try to show in the web page the current time. Well, it gives no result. It looks like as the calls to the Time library functions would be simply ignored.
If I try in the extended code:
Code: Select all
The HTML code would contain only "Current time: <br>". As the call to the Time function would not exist at all.htmlBody += "Current time: ";
htmlBody += String(now()); //Yes, for the moment just as a number of seconds elapsed since Jan 1 1970.
htmlBody += "<br>\n"
Furthermore, the original code contains the reading and displaying of analog inputs:
Code: Select all
If I simply start to add the text (even without calls of any functions/libraries) - just some text, then at some point the result of the given for loop will be presented without indexes and values. It will contain a column of "A:"s displayed in the web page.// output the value of each analog input pin
for (int a = 0; a < 6; a++)
{
htmlBody += "A";
htmlBody += String(a);
htmlBody += ": ";
htmlBody += String(analogRead(a));
htmlBody += "<br>\n";
}
What is puzzling me is that after construction of the htmlBody String there is the line in the code that actually sends the html page:
Code: Select all
client.print(htmlBody);
But the result is strangely selective, if I would try to extend the code... as the program would suddenly say: "Arghh, lets not wait the result of these function readings or int-to-string parsing; we have more important things to do, lets send partial data..." Even more, it does not matter where I put extra text before the for loop OR after it. If the text hits "some yet-unknown limit", the result goes without indexes or values.
Well, I could still understand if there will be some sort of limited buffer, but it would be rather cutting only the end of the htmlBody String or some concrete part. Instead comes some sort of "selective" "removal" of intermediate results for the functions.
What could be the reason for such strange behaviour? Could anyone kindly bring the enlightenment by opening new horizons in understanding of programming principles for RedBoard and ESP8266?
Thank you.