These are chat archives for esp8266/Arduino

24th
Sep 2015
Martin Ayotte
@martinayotte
Sep 24 2015 01:21
@zenmanenergy, I've get it a try, I've got HTTPS request working if I use client.readStringUntil('\r');, but got a crash if I use client.read(msg, size); . I've submitted this bug esp8266/Arduino#813
Steve Nelson
@zenmanenergy
Sep 24 2015 02:04
oh cool, i’ll give that a shot. I haven’t tried since this morning. I did make some progress on a download url example, Although when I attempt to save the text content to a file it seems to add some extra characters at the end
do you use .println to save content ot a file? the docs on github seem to leave that out. I tried this:
File file = SPIFFS.open(fileName, "w");
file.println(content);
where filName=“/text.html” and content=“Hello world”;
but when i tried to read it, it spit back: hello world
A�?���?�
Martin Ayotte
@martinayotte
Sep 24 2015 02:18
I didn't save the content of HTTPS response into SPIFFS file, although it should be straight forward, I've simply echoed it on Serial.
Steve Nelson
@zenmanenergy
Sep 24 2015 02:23
I was trying to follow the “configfile” example. Although in the saveConfig() function he does this:

File configFile = SPIFFS.open("/config.json", "w");
if (!configFile) {
Serial.println("Failed to open config file for writing");
return false;
}

json.printTo(configFile);

seems like there should be a configFile.write() or something. i feel like I’m missing something
The closest I found on the github docs would be configFile.println().
fmgomes
@fmgomes
Sep 24 2015 10:37
When is it expected that the SSL functionality will be available at "staging"?
Steve Nelson
@zenmanenergy
Sep 24 2015 12:56
It’s in there now, you include WiFiClientSecure.h Here is a link to the .h file in the repository, it has the list of available methods
https://github.com/esp8266/Arduino/blob/8d20e8e58622d289c6195b9126b9f3674a7892c3/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiClientSecure.h
Martin Ayotte
@martinayotte
Sep 24 2015 14:34
@zenmanenergy, about spiffs, it is implemented to be derived from File class, so every functions such write(), read(), seek(), are available.
Kiril Zyapkov
@kzyapkov
Sep 24 2015 15:28
Hi all! So I'm looking at the .rodata section: it seems to be placed in RAM, and RAM is precious
When I try to mark string literals with attribute((section(".irom.text"))) the compiler doesn't like it:
error: flash_str causes a section type conflict with flash_str
  static const char flash_str[] __attribute__((section(".irom.text"))) __attribute__((aligned(4))) = fmt;
Is there an easy way to workaround this? We have lots of debug statements which really don't need to be in RAM ...
Markus
@Links2004
Sep 24 2015 15:59
i test you line and is working fine, i think its part of a macro can you post it?
Gustavo Freddo Breunig
@gustavobreunig
Sep 24 2015 17:42
Hi everyone, can someone give one minute to my question? esp8266/Arduino#812
Kiril Zyapkov
@kzyapkov
Sep 24 2015 18:01
@Links2004 its just expanded ICACHE_RODATA_ATTR and the "optimized" os_printf()
fmgomes
@fmgomes
Sep 24 2015 18:42
@zenmanenergy, regarding SSL/TLS, I have the latest staging version from Sep 9, and I don't have a WiFiClientSecure.h file, are you sure SSL/TLS is included in the staging version? I was thinking that I had to build Arduino from source. Can you confirm if it is possible to build a SSL/TLS client with the current staging version?
fmgomes
@fmgomes
Sep 24 2015 18:49
@zenmanenergy , sorry, my mistake, it has WiFiClientSecure.h. Now I'll try to use it :smile:
Markus
@Links2004
Sep 24 2015 18:52
@gustavobreunig for my understanding of the compiler it is looking good. I have add some more details to issues. #812
@kzyapkov i can compile this macro, but not have a esp here to flash it.
Gustavo Freddo Breunig
@gustavobreunig
Sep 24 2015 19:04
@Links2004 thanks, I did not knew that is backwards
Markus
@Links2004
Sep 24 2015 19:05
@gustavobreunig this is depending of the internal architecture of the hardware big endian / little endian
in our case its backwards
fmgomes
@fmgomes
Sep 24 2015 20:43
Running the HTTPSRequest.ino example I get the following result:

connecting to api.github.com
requesting URL: /repos/esp8266/Arduino/commits/esp8266/status
request sent
esp8266/Arduino CI has failed

reply was:

==========
closing connection

So it seems that the reply is an empty line
Any idea why?
fmgomes
@fmgomes
Sep 24 2015 21:05
It should print "headers received" and it shouldn't print "esp8266/Arduino CI has failed"
I'm using the staging version and commented the verify method call in the example, since it doesn't exist in the staging version, could this be the problem?