Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:18
    Tech-TX synchronize #6894
  • 00:02
    earlephilhower milestoned #6894
  • 00:01
    earlephilhower synchronize #6566
  • Dec 09 23:57
    Tech-TX edited #6894
  • Dec 09 23:55
    Tech-TX opened #6894
  • Dec 09 23:45
  • Dec 09 23:45
    earlephilhower synchronize #6566
  • Dec 09 23:45
    earlephilhower synchronize #6566
  • Dec 09 21:37
    earlephilhower edited #6893
  • Dec 09 21:27
    d-a-v synchronize #6889
  • Dec 09 21:15
    earlephilhower closed #6892
  • Dec 09 21:06
    earlephilhower synchronize #6820
  • Dec 09 20:58
    earlephilhower synchronize #6820
  • Dec 09 20:07
    earlephilhower closed #5942
  • Dec 09 20:05
    earlephilhower closed #4451
  • Dec 09 20:05
    earlephilhower closed #4437
  • Dec 09 19:33
    earlephilhower opened #6893
  • Dec 09 19:33
    earlephilhower milestoned #6893
  • Dec 09 16:49
    smartkodian opened #6892
  • Dec 09 15:11
    earlephilhower synchronize #6820
Steve Nelson
@zenmanenergy
Do HTTP redirects work with the server.send() method? Anyone know the syntax?
Ivan Grokhotkov
@igrr
@zenmanenergy this seems to work:
  server.on("/a", []() {
    String redirectUrl = "http://";
    redirectUrl += WiFi.localIP().toString();
    redirectUrl += "/about";

    server.sendHeader("Location", redirectUrl);
    server.send(301, "text/plain", "");
  });
redirects /a to /about
Steve Nelson
@zenmanenergy
sweetness. thanks
xbary
@xbary
@igrr After the latest amendments, for me everything works. a RAM average increased space of 10-15%, and 30% flash :)
Ivan Grokhotkov
@igrr
cool, thanks for testing
For those who were interested in gdb stub, i packed it into a library
xbary
@xbary
and Windows also GDBdebuger From there?
Martin Ayotte
@martinayotte
@igrr, Wow ! Thanks a lot !
Ivan Grokhotkov
@igrr
haven't tried this on windows. xtensa gdb should come along with the toolchain which is installed with the IDE.
note that with current toolchain build stack frames are a bit off...
i'm using a locally-built toolchain which is more up to date, it seems to improve things.
also it helps to change -Os to -Og -g3 in platform.txt (c and cpp flags)
but such change can not be wrapped into a library...
Steve Nelson
@zenmanenergy
I have commented out my WiFi.begin() statement, but when I reboot my ESP, it auto connects to the last SSID. I don’t see method in the docs on github or on arduino.cc to turn the auto connecting on/off.
Markus
@Links2004
WiFi.disconnect(); will delete the stored config
Luc
@luc-github
Hi is there a way to know the capacity of SPIFFS and the current available size or occupation ?
In previous API there are such functions:
// DBG_OUTPUT_PORT.printf("\n==== SPIFFS Info ====\n"); // DBG_OUTPUT_PORT.printf("FS Mount: %d\n", FS.mount()); // DBG_OUTPUT_PORT.printf("FS Size: %s\n", formatBytes(FS.size())); // DBG_OUTPUT_PORT.printf("FS Bytes: total: %s, used: %s\n", formatBytes(FS.totalBytes()), formatBytes(FS.usedBytes())); // DBG_OUTPUT_PORT.printf("FS Blocks: total: %d, free: %d, size: %s\n", FS.totalBlocks(), FS.freeBlocks(), formatBytes(FS.blockSize())); // DBG_OUTPUT_PORT.printf("FS Pages: allocated: %d, deleted: %d, size: %s\n", FS.allocatedPages(), FS.deletedPages(), formatBytes(FS.pageSize()));
but cannot find in new SPIFFS
Thanks
Ivan Grokhotkov
@igrr
esp8266/Arduino#779
not yet...
Luc
@luc-github
Ok - thanks - just wondering
Steve Nelson
@zenmanenergy
this is a crazy open ended question… but has anyone experienced WiFiClient not connecting to a server with one internet connection, but then have it work with another connection? Any idea how I could debug this?
Martin Ayotte
@martinayotte
What do you mean exactly ? Can you describe the scenario ?
Steve Nelson
@zenmanenergy
i’m in a coffee shop (i hacked into their router…guessed the password hehe, so I have access to their dd-wrt) anyway… if i connect my esp to their connection, it connects, gives me a local IP but if i do this: WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}
it fails.
if… i change my connection to my phone, the same code works.
something must be happening at the hotspot to block or timeout the connection, but I just can’t figure out what it is.
Martin Ayotte
@martinayotte
From the above snippet of code, it is hard to say what is happening. It could be a DNS issue ... Is the same setup with another WiFi router is working fine ?
Steve Nelson
@zenmanenergy
yeah, that’s what is really weird. I am doing a captive portal on this device. maybe it’s f’ing up the dns somehow. I’ll just start commenting out code.
boom! dns must be it… commented out the portal and it works again. thanks.
Steve Nelson
@zenmanenergy
it seems to boil down to these two lines:
IPAddress apIP(192, 168, 1, 1);
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
if I comment them out it works, does anything look wrong there?
this is in ap_sta mode i.e.
WiFi.mode(WIFI_AP_STA);
Markus
@Links2004
may the same ip range then the coffee shop?
Steve Nelson
@zenmanenergy
oooh. would that do it?
Markus
@Links2004
then noting will work, try to change subnet (apIP)
Steve Nelson
@zenmanenergy
i’m trying 192,168,16,1
yes! you are beautiful. thank you.
David
@dmarkey
Is there a preferred HTTP client lib that works with ESPduino?
I dont see any examples as such
David
@dmarkey
Anyone?
Steve Nelson
@zenmanenergy
dmarkey did you find the answer? If you install the ESP board into the Arduino IDE using the board manager, you’ll see a bunch of examples. There is one called “WIFIClient” under “ESP8266WIFI”
look at the section titled “Installing with Boards Manager” https://github.com/esp8266/Arduino
David
@dmarkey
Looks very manual, no HTTP abstraction.
Steve Nelson
@zenmanenergy
Yes you have to manually create the HTTP strings which is a bit of a pain, but not too difficult once you get used to it. The thing that I found a bit of the pain was dealing with urlencoding. I made an example that hasnt’ been added to the library yet to simplify url encoding. look here: https://github.com/zenmanenergy/ESP8266-Arduino-Examples
David
@dmarkey
Ah, im ging to port a library, cant be bothered with all that.
sticilface
@sticilface
I'm using El capitan and now I get a "allow incoming network dialog" everytime I try to do an OTA update. The problem is that unless i click it immediately... the update fails. I've added python to firewall, and arduino... (which also asks..) does anyone have a solution... i tried this one... http://stackoverflow.com/questions/19688841/add-python-to-os-x-firewall-options but i get an error about not having Xcode...