Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
sticilface
@sticilface
This message was deleted
sticilface
@sticilface
Can anyone else confirm that having more than one Arduino IDE open on the same LAN causes ESPs with the OTA enabled to reboot every 5min. I have 5 of them, rock solid, been running the same sketch for a while now.. all of a sudden they started rebooting every 5min... the cause having another arduino IDE open in a VM, on another machine. I shut it down, and they are back to being very stable..
ok maybe it is not that... ugh!
they just restarted... two of them at exactly the same time! wierd
sticilface
@sticilface
got a stack dump, and it is UDP related
epc1=0x402055ff epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000008 depc=0x00000000
        size_t cur_size = _tx_buf_head->tot_len;
402055fd:    7c28          l32i.n    a2, a12, 28
402055ff:    0412d2            l16ui    a13, a2, 8
        if (size < cur_size)
40205602:    d735d7            bltu    a5, a13, 402055dd <_ZN10UdpContext6appendEPKcj+0x21>
            return;
brutzler
@brutzler
Hi, is there somewhere a doc for the "ESP8266WebServer". Found nothing on reference.md or in the ESP-Book from Kolban. Actually setting up on the "advanced server"-example provided with the library. would like to see, what is coming back from browser on a method=get form. In the example I only see a "server.on as" a function like a jump distributor. In the keywords there are a lot of different things, but without explanation....
Martin Ayotte
@martinayotte
@brutzler, although there is no details about it, the AdvancedWebServer.ino is printing the arguments of GET or POST in handleNotFound(). I've used that to create my own SaveConfig() from a POST form. In summary, server.args() returns the number of arguments, server.argName(i) allows to get the argument name, server.arg(i) and server.arg(name) actually return value of the argument, and there is also server.hasArg(name) which return boolean if argument exist.
brutzler
@brutzler
Hey martin. You are my hero. The arg-stuff makes life for me very easy. I want to send two values to my ESP. With this:
<form action="/Uhrzeit" method="get">
<fieldset>
  <label for="Startzeit">Startzeit:</label>
  <input id="Startzeit" name="Startzeit" size="5" maxlength="5" value="02:00">
  <label for="Stopzeit">Endzeit:</label> 
  <input id="Stopzeit" name="Stopzeit" size="5" maxlength="5" value="04:00">
  <button type="submit" name="action" value="0">Werte senden</button> 
</fieldset>       
</form>
I get the needed infos already in the server.args(x) . Handling on "server.on("/Uhrzeit", handleTime);"
I like this :-)
sorry: server.arg(x) is correct
Martin Ayotte
@martinayotte
@brutzler, if you don't want to bother parsing the whole form in your handleTime(), you can simply do something like 'if (servers.hasArg("Startzeit") { Startzeit = servers.arg("Startzeit") };'
brutzler
@brutzler
@martinayotte: Thx fpr the hint. But there is no need for parsing. "handleTime()" is only called , if I press the button "Werte senden" in my website. And then the I know, that the two values are in server.arg(0) and server.arg(1).
Juppit
@Juppit
Hi @all, I have build a clock library with NTP time.
If anyone is interested, I would be happy for any comments and reviews.
@igrr maybe there are some parts in Time.h for the axtls project.
see: https://github.com/Juppit/esp8266-NtpClock
Steve Nelson
@zenmanenergy
That looks great Juppit.
Matt Kocaj
@cottsak
@all anyone know of a lib that wraps up WiFiClient (or WiFiClientSecure?) that makes sending GET and POST requests easier than passing a massive concat string into client.print() .. ?
ie, does all of the base64 encoding (HTTP basic auth), url encoding (Content-Type: application/x-www-form-urlencoded), saves you building up the raw request using strings, and returns the response in a nice usable way (JSON deserialisation would be handy too) .. ?
Neil Kolban
@nkolban
@igrr Howdy ... back on Sept 5th you mentioned that you might find time to write some docs on how to use the yield() technology that you invented for the Arduino project. Did you ever get around to doing that?
Steve Nelson
@zenmanenergy
Is there already an example in the works to download a file from a url and store it in spiffs?
Martin Ayotte
@martinayotte
I don't think there is an already cooked example, but this should be pretty easy by mixing WifiClient download with SPIFFS write file.
Steve Nelson
@zenmanenergy
Ok. I’m working on one right now, I just didn’t want to duplicate it if someone already wrote one.
Steve Nelson
@zenmanenergy
Does an https request have a different request string than a port 80? I would have thought you just change the port to 443 in the client.connect(host,port) method?
Martin Ayotte
@martinayotte
Although I didn't play with SSL yet, with the latest staging, you need to use WifiClientSecure class instead of WifiClient, and yes, it is on 443. Take a look at the example libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
Steve Nelson
@zenmanenergy
oh sweet. I don’t see that in my examples, has that example not made it into the staging codebase?
I don’t see it in the IDE, I do see it on github though.
thank you
Martin Ayotte
@martinayotte
The example has been added 10 days ago, so if your install is older, you need manual merge from GitHub. Keep me inform, since I didn't try it out, but it is interesting me.
Steve Nelson
@zenmanenergy
Seems straight forward enough,include another .h file and change: WiFiClient client; to WiFiClientSecure client;…..although it’s crashing for me. I’ll try again after lunch.
Martin Ayotte
@martinayotte
@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
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
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
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
When is it expected that the SSL functionality will be available at "staging"?
Steve Nelson
@zenmanenergy
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
@zenmanenergy, about spiffs, it is implemented to be derived from File class, so every functions such write(), read(), seek(), are available.
Kiril Zyapkov
@kzyapkov
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
i test you line and is working fine, i think its part of a macro can you post it?
Gustavo Freddo Breunig
@gustavobreunig
Hi everyone, can someone give one minute to my question? esp8266/Arduino#812
Kiril Zyapkov
@kzyapkov
@Links2004 its just expanded ICACHE_RODATA_ATTR and the "optimized" os_printf()
fmgomes
@fmgomes
@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?