These are chat archives for esp8266/Arduino

25th
Aug 2015
Russ Mathis
@RussMathis
Aug 25 2015 13:17
I just cheated and created a LOCAL var and set it to the WiFiClient object before calling the report routine. :(
Kiril Zyapkov
@kzyapkov
Aug 25 2015 15:35
What would be the most effective way to send data from a File via a WiFiClient? Say I wanted to flush the entire file over a TCP connection?
Russ Mathis
@RussMathis
Aug 25 2015 16:04
@kzyapkov , I tried this but had to change so the WiFiClient was a local previously assigned in code:void sendClientLog(WiFiClient client){
File f = SPIFFS.open("/log.txt", "r");
if (f){
//Serial.println("showLog: file open");
String fOut;
client->write("\nReport Start*\n");
while (true){
fOut = f.readString();
if (fOut.length() != 0){
client->write(fOut.c_str(), fOut.length());
}
else
{
break;
}
}
client->write("\nReport End*\n");
f.close();
}
}
Note: forgot the prototype should be:
void sendClientLog(WiFiClient
client)
OK The astrisk is not showing up, probably due to Markdown feature in messenger.. :(
Russ Mathis
@RussMathis
Aug 25 2015 16:52
@Anybody, has anyone came up with a simple way to provide snprintf support for doubles, char* or floats precision?
Juppit
@Juppit
Aug 25 2015 17:08
@RussMathis something like dtostrf, see http://www.hobbytronics.co.uk/arduino-float-vars
Russ Mathis
@RussMathis
Aug 25 2015 17:21
@Juppit, yes aware of dtostrf however my strings contain more than a single number so I've been using ie snprintf(buff, sizeof(buf),"speed: %s, mics: %lu", temp); //where %s was created with dsostrf previously. This can be very annoying when there are several more vars not shown above, some int, double, char, etc. etc :(
Besides snprintf/sprintf now allowing char
they also lack other conversion features as well. Just wonder if anyone had came up with macros or refactored the ets_ulib* libraries?
Stoian Ivanov
@sdrsdr
Aug 25 2015 18:54
@RussMathis clent.write might not send the entire string in one call you must check the result of the method
alon24
@alon24
Aug 25 2015 19:13
id there a way to debug epc1 mem errors, that only give out an address? I remember ther was a way to generate a map of the bin file, and look at the closest address the the failure, does any1 know of this?
Juppit
@Juppit
Aug 25 2015 19:25
@alon24 windows with cygwin: cd
~/Arduino/build/windows/work/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/bin
./xtensa-lx106-elf-objdump.exe -S foo.elf > foo.txt
I find foo.elf the latest build directory in C:\Users[username]\AppData\Local\Temp\build3955521324917442037.tmp
alon24
@alon24
Aug 25 2015 21:04
@juppit thanks, I will try soon
Russ Mathis
@RussMathis
Aug 25 2015 22:32
@sdsdr, you may be right, however, I've formatted text in the file with \n--newline characters so the loop only picks up 1 line at a time. But as you suggest I will also check how big a string can be sent. :)
linagee
@linagee
Aug 25 2015 22:35
is there a plan to pull in SSL support from the SDK into esp8266/Arduino? (I really don't want to have to learn SDK-level stuff. :( )
(and I need the ability to authenticate responses from a server. unless there is some other clever way to do that.)