Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Emile Nijssen
@WeeJeWel

Hi guys! I want to debug ESP8266httpUpdate, but my board (Wemos D1 Mini) has no 'Debug' option available under 'Tools'. So I tried adding the defines manually:

#define DEBUG_ESP_HTTP_UPDATE 1
#define DEBUG_ESP_PORT Serial

I still don't see debug messages though. Any advice?

Bert Melis
@bertmelis
find your boards.txt file and replace contents by this https://pastebin.com/GmcqavV0
restart Arduino and you'll have your debug menu options
Ivan Grokhotkov
@igrr
OMFG. I have just realized that add_hmac_digest from axTLS tries to allocate another 16k in addition to the existing 16k fragment buffer.
No wonder it's running out of RAM
Ivan Grokhotkov
@igrr
Yay, easy fix, ssl_fragment_size less heap usage for TLS! :fireworks:
Me No Dev
@me-no-dev
this is in the lib itself right?
Ivan Grokhotkov
@igrr
Yes.
igrr/axtls-8266#45
For servers which don't support fragment size negotiation, TLS is going to become much more usable.
Me No Dev
@me-no-dev
nice!
Tejas H
@CodingCreate101
It's available as update now?
Ivan Grokhotkov
@igrr
No, just a PR in the axTLS repo
mega-hz
@mega-hz
Can someone help me please? i have setup a little webserver on esp wich switches a relays like 192.168.2.221:84/relays-on or 192.168.2.221:84/relays-off. this works on a browser. Now there is another webserver running on an arduino uno with ethernet, this one must call the esp to switch relays on/off. HOW is the syntax for such a webcall please?
brutzler
@brutzler
Does anybody know the right way to setup the hostname of an esp-board?
I do not get this working ...
mega-hz
@mega-hz
WiFi.hostname("Name");
brutzler
@brutzler
Yes, but I do not see the hostname in the network :-(
mega-hz
@mega-hz
maybe you must restart windows, it takes some time to get the new devices or maybe have a look in your router?
brutzler
@brutzler
ok try later on
Martin Ayotte
@martinayotte
WiFi.hostname() only advertise its name to AP router during DHCP request. For any other purposes, you need to have mDNS service, and of course on Windows you need Bonjour, Linux already managing that using Avahi.
Steve Nelson
@zenmanenergy
Is there a built-in, non-blocking way to automatically reconnect to Wifi if the connection is dropped? I'm looking through the source , but I don't see anything yet.
Emile Nijssen
@WeeJeWel
@bertmelis Thank you a lot, it works great! (Regarding the Debug on Wemos D1)
Steve Nelson
@zenmanenergy
wait, forget it. Looks like the blocking call in the wifiMulti is purely from the delay() in the example code.
copercini
@copercini
yeah, wifiMulti enter in a infinite loop if found the router but don't get an IP
copercini
@copercini
If WiFi.status(); return another code or return nothing, this while became an infinite loop https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp#L118
and WDT doesn't reset because the delay(10);
mega-hz
@mega-hz
Can someone help me please? i have setup a little webserver on esp wich switches a relays like 192.168.2.221:84/relays-on or 192.168.2.221:84/relays-off. this works on a browser. Now there is another webserver running on an arduino uno with ethernet, this one must call the esp to switch relays on/off. HOW is the syntax for such a webcall please?
Omair Misbah
@MisbahOmair_twitter
Guys what is ESP8266 and what it do ?
rneurink
@rneurink
@mega-hz try to use a get request. Otherwise you could use an http client
mega-hz
@mega-hz
and how do i write that get request to the ip?

EthernetClient client = server.available(); // try to get client

if (client)
{ // got client?
boolean currentLineIsBlank = true;

while (client.connected())
{
  int count = 0;
  if (client.available())
  { // client data available to read
    char c = client.read(); // read 1 byte (character) from client
    // limit the size of the stored received HTTP request
    // buffer first part of HTTP request in HTTP_req array (string)
    // leave last element in array as 0 to null terminate string (REQ_BUF_SZ - 1)
    if (req_index < (REQ_BUF_SZ - 1))
    {
      HTTP_req[req_index] = c;          // save HTTP request character
      req_index++;
    }
    // last line of client request is blank and ends with \n
    // respond to client only after last line received
    //        if (c == '\n' && currentLineIsBlank)
    if (c == '\n')
    {
      client.println(F("HTTP/1.1 200 OK"));
      client.println(F("Access-Control-Allow-Origin: *"));
      // nur Ajax requests - send XML file
      if (StrContains(HTTP_req, "ajax_inputs"))
      {
        digitalWriteFast(A0, HIGH);               // LED einschalten
        // send rest of HTTP header
        client.println(F("Content-Type: text/xml"));
        client.println(F("Connection: keep-alive"));
        client.println();
        SetLEDs();                                // alle Ausgangs - Zustände setzen
        // send XML file containing input states
        XML_response(client);                     // alle Daten zurücksenden
        digitalWriteFast(A0, LOW);                // LED ausschalten
      }

      // reset buffer index and all buffer elements to 0
      req_index = 0;
      StrClear(HTTP_req, REQ_BUF_SZ);

      break;
    }

    // every line of text received from the client ends with \r\n
    if (c == '\n')
    {
      // last character on line of received text
      // starting new line with next character read
      currentLineIsBlank = true;
    }
    else if (c != '\r')
    {
      // a text character was received from client
      currentLineIsBlank = false;
    }             // end if (client.available())
  }               // end while (client.connected())
}
delay(1);     // give the web browser time to receive the data

client.stop();  // close the connection

} // end if (client)

can i insert that get request a line before client.stop?
rneurink
@rneurink
This site explains the Get requests with an ESP8266. you can form this so your arduino can get the data from the hosted site on the esp https://techtutorialsx.com/2016/07/17/esp8266-http-get-requests/
Martin Ayotte
@martinayotte
This is the client of your server web page, probably a browser on PC. It is not the same client used to issue a GET request to your other ESP. You need to instantiate another client.
mega-hz
@mega-hz
if i understand it right, the routine above must be 2x times? one with the ip of the esp and the other one?
Martin Ayotte
@martinayotte
Nope, the above is server handling an incoming request. What you are looking for is how to send an outgoing request.
Mike Kranidis
@mikekgr
Hello friends! Hello @igrr
Is there any roadmap when the esp8266/Arduino core will be updated to 2.4.0 version? In the upcoming release, shall we have the new, corrected version SPIFFS v 3.6 ?
Thanks in advance.
Mike Kranidis
That's the list of stuff to do for 2.4.0
All bugs which have appeared after 2.3.0 need to be fixed (at least)
is this the update of SPIFFS you have mentioned? esp8266/Arduino#2456
Mike Kranidis
@mikekgr
@igrr Yes without been expert on this, I suppose that this is it.
Thanks Ivan for the very fast answer and for your invaluable contribution to esp8266 Arduino core.
Have a nice day!
paraflou
@paraflou
Hi there. I am using spi slave library and every time i get some spi data interrupts occur and i set a flag to true. Inside loop() i check the spi flag and if true i send spi data through http rest post to a server. Because of rest latency i miss interrupts. Is there any sort of queue to buffer incoming spi data so that i dont miss them?
riataman
@riataman
@igrr: should probably consider dropping bountysource. they appear almost dead.
riataman
@riataman
I tried to withdraw money from there and doesn't seem to be working.
Ivan Grokhotkov
@igrr
:cry: that's disappointing...
it worked a couple of months ago. but now it seems there isn't any activity on their own repos...