So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By cjohnweb
#81352 Hi there,

I come from the web development world: php, javascript, python, etc but I've taken a love for IoT, and started a project that I've been thinking about for the last 3 years or so.

I've got my ESP8266 NodeMCU 0.9 ESP-12 module that has an attached SSD1306 OLED screen. I've been able to get the screen working and all that pretty smoothly but it's the HTTP transactions I'm having trouble with.

I grabbed some demo code, it seems to work but then after just a couple times through the loop it resets with this:

Decoding stack results
0x40202674: loop() at /Users/jminton/Desktop/esp/httpsTest/httpsTest.ino line 46
0x402040c8: loop_wrapper() at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/core_esp8266_main.cpp line 125


Code: Select all#include <ESP8266WiFi.h>

const char* ssid = "ssid";
const char* password = "";

const char* host = "site.com";
const int port = 80;
const String url = "/api/temperatureAlarmMonitor.php";

WiFiClient client;

void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.print("connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
  WiFiClient client;
}

void loop() {


  Serial.printf("\n[Connecting to %s ... ", host);
  if (client.connect(host, port))
  {
    Serial.println("connected]");

    Serial.println("[Sending a request]");
    client.print(String("GET /api/temperatureAlarmMonitor.php") + " HTTP/1.1\r\n" +
                 "Host: " + host + "\r\n" +
                 "Connection: close\r\n" +
                 "\r\n"
                );

    Serial.println("[Response:]");
    while (client.connected() || client.available()) //// <<< -----------------here line 46
    {
      if (client.available())
      {
        Serial.println(client.readStringUntil('\n'));
      }
    }
//    client.stop();
    Serial.println("\n[Disconnected]");
  }
  else
  {
    Serial.println("connection failed!]");
//    client.stop();
  }
  delay(5000);
}


What am i doing wrong? what else do you need to help me?

Thanks!
User avatar
By cjohnweb
#81364 Here us another example, stripped down to the bare minimum:

Code: Select all#include <ESP8266WiFi.h>
const char* ssid = "ssid";
const char* password = "pass";
const char* host = "site.com";
const int port = 80;
const String url = "/api/temperatureAlarmMonitor.php";

WiFiClient client;

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  Serial.print("Connecting to "+String(ssid));
  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
    Serial.print(".");
  }
  Serial.println("WiFi connected");
}
 
 
void loop() {
  Serial.println("Attempting client.connect:");
  if (client.connect(host,port)) {
    Serial.println("client.connect successful");
    String postStr = "data=its working\r\n\r\n";
    Serial.println("sending post data to client: "+postStr);
    client.print("POST "+url+" HTTP/1.1\n");
    client.print("Host: "+String(host)+"\n");
    client.print("Connection: close\n");
    client.print("Content-Type: application/x-www-form-urlencoded\n");
    client.print("Content-Length: ");
    client.print(postStr.length());
    client.print("\n\n");
    client.print(postStr);
    Serial.println("success!");
  }
 
  client.stop();
  Serial.println("loop done wait 3 seconds.");   
  delay(3000);
}


The serial console gives me this:

Code: Select allConnecting to ssid.............................WiFi connected
Attempting client.connect:

Exception (9):
epc1=0x4000dee8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000006 depc=0x00000000

>>>stack>>>

ctx: sys
sp: 3fffed50 end: 3fffffb0 offset: 01a0
3fffeef0:  4021ce09 00000000 3ffe9c44 3ffe9c50 
3fffef00:  3ffe9c50 00000084 00000000 0000002c 
3fffef10:  00000002 3ffe9c5a 4022697b 3ffec7c0 
3fffef20:  3ffe9c44 3fffdcc0 3ffe8de8 3ffe8de8 
3fffef30:  00000080 3ffec7c0 00000000 3fffdcb0 
3fffef40:  4022623b 3fffdab0 00000000 00000001 
3fffef50:  3ffe8de8 40000f49 3fffdab0 40000f49 
3fffef60:  40000e19 40001878 00000002 00000000 
3fffef70:  3fffff10 aa55aa55 00000020 40104748 
3fffef80:  4010474e 00000002 00000000 61f6dcf6 
3fffef90:  4010000d 89a4bf10 ea1a35df fe10294f 
3fffefa0:  401009d8 3fffef3c 40100985 3ffffed8 
3fffefb0:  3fffffc0 00000000 00000000 feefeffe 
3fffefc0:  feefeffe feefeffe feefeffe feefeffe 
3fffefd0:  feefeffe feefeffe feefeffe feefeffe 
3fffefe0:  feefeffe feefeffe feefeffe feefeffe 
3fffeff0:  feefeffe feefeffe feefeffe feefeffe 
3ffff000:  feefeffe feefeffe feefeffe feefeffe 
3ffff010:  feefeffe feefeffe feefeffe feefeffe 
3ffff020:  feefeffe feefeffe feefeffe feefeffe 
3ffff030:  feefeffe feefeffe feefeffe feefeffe 
3ffff040:  feefeffe feefeffe feefeffe feefeffe 
3ffff050:  feefeffe feefeffe feefeffe feefeffe 
3ffff060:  feefeffe feefeffe feefeffe feefeffe 
3ffff070:  feefeffe feefeffe feefeffe feefeffe 
3ffff080:  feefeffe feefeffe feefeffe feefeffe 
3ffff090:  feefeffe feefeffe feefeffe feefeffe 
3ffff0a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff0b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff0c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff0d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff0e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff0f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff100:  feefeffe feefeffe feefeffe feefeffe 
3ffff110:  feefeffe feefeffe feefeffe feefeffe 
3ffff120:  feefeffe feefeffe feefeffe feefeffe 
3ffff130:  feefeffe feefeffe feefeffe feefeffe 
3ffff140:  feefeffe feefeffe feefeffe feefeffe 
3ffff150:  feefeffe feefeffe feefeffe feefeffe 
3ffff160:  feefeffe feefeffe feefeffe feefeffe 
3ffff170:  feefeffe feefeffe feefeffe feefeffe 
3ffff180:  feefeffe feefeffe feefeffe feefeffe 
3ffff190:  feefeffe feefeffe feefeffe feefeffe 
3ffff1a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff1b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff1c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff1d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff1e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff1f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff200:  feefeffe feefeffe feefeffe feefeffe 
3ffff210:  feefeffe feefeffe feefeffe feefeffe 
3ffff220:  feefeffe feefeffe feefeffe feefeffe 
3ffff230:  feefeffe feefeffe feefeffe feefeffe 
3ffff240:  feefeffe feefeffe feefeffe feefeffe 
3ffff250:  feefeffe feefeffe feefeffe feefeffe 
3ffff260:  feefeffe feefeffe feefeffe feefeffe 
3ffff270:  feefeffe feefeffe feefeffe feefeffe 
3ffff280:  feefeffe feefeffe feefeffe feefeffe 
3ffff290:  feefeffe feefeffe feefeffe feefeffe 
3ffff2a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff2b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff2c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff2d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff2e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff2f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff300:  feefeffe feefeffe feefeffe feefeffe 
3ffff310:  feefeffe feefeffe feefeffe feefeffe 
3ffff320:  feefeffe feefeffe feefeffe feefeffe 
3ffff330:  feefeffe feefeffe feefeffe feefeffe 
3ffff340:  feefeffe feefeffe feefeffe feefeffe 
3ffff350:  feefeffe feefeffe feefeffe feefeffe 
3ffff360:  feefeffe feefeffe feefeffe feefeffe 
3ffff370:  feefeffe feefeffe feefeffe feefeffe 
3ffff380:  feefeffe feefeffe feefeffe feefeffe 
3ffff390:  feefeffe feefeffe feefeffe feefeffe 
3ffff3a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff3b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff3c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff3d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff3e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff3f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff400:  feefeffe feefeffe feefeffe feefeffe 
3ffff410:  feefeffe feefeffe feefeffe feefeffe 
3ffff420:  feefeffe feefeffe feefeffe feefeffe 
3ffff430:  feefeffe feefeffe feefeffe feefeffe 
3ffff440:  feefeffe feefeffe feefeffe feefeffe 
3ffff450:  feefeffe feefeffe feefeffe feefeffe 
3ffff460:  feefeffe feefeffe feefeffe feefeffe 
3ffff470:  feefeffe feefeffe feefeffe feefeffe 
3ffff480:  feefeffe feefeffe feefeffe feefeffe 
3ffff490:  feefeffe feefeffe feefeffe feefeffe 
3ffff4a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff4b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff4c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff4d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff4e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff4f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff500:  feefeffe feefeffe feefeffe feefeffe 
3ffff510:  feefeffe feefeffe feefeffe feefeffe 
3ffff520:  feefeffe feefeffe feefeffe feefeffe 
3ffff530:  feefeffe feefeffe feefeffe feefeffe 
3ffff540:  feefeffe feefeffe feefeffe feefeffe 
3ffff550:  feefeffe feefeffe feefeffe feefeffe 
3ffff560:  feefeffe feefeffe feefeffe feefeffe 
3ffff570:  feefeffe feefeffe feefeffe feefeffe 
3ffff580:  feefeffe feefeffe feefeffe feefeffe 
3ffff590:  feefeffe feefeffe feefeffe feefeffe 
3ffff5a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff5b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff5c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff5d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff5e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff5f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff600:  feefeffe feefeffe feefeffe feefeffe 
3ffff610:  feefeffe feefeffe feefeffe feefeffe 
3ffff620:  feefeffe feefeffe feefeffe feefeffe 
3ffff630:  feefeffe feefeffe feefeffe feefeffe 
3ffff640:  feefeffe feefeffe feefeffe feefeffe 
3ffff650:  feefeffe feefeffe feefeffe feefeffe 
3ffff660:  feefeffe feefeffe feefeffe feefeffe 
3ffff670:  feefeffe feefeffe feefeffe feefeffe 
3ffff680:  feefeffe feefeffe feefeffe feefeffe 
3ffff690:  feefeffe feefeffe feefeffe feefeffe 
3ffff6a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff6b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff6c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff6d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff6e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff6f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff700:  feefeffe feefeffe feefeffe feefeffe 
3ffff710:  feefeffe feefeffe feefeffe feefeffe 
3ffff720:  feefeffe feefeffe feefeffe feefeffe 
3ffff730:  feefeffe feefeffe feefeffe feefeffe 
3ffff740:  feefeffe feefeffe feefeffe feefeffe 
3ffff750:  feefeffe feefeffe feefeffe feefeffe 
3ffff760:  feefeffe feefeffe feefeffe feefeffe 
3ffff770:  feefeffe feefeffe feefeffe feefeffe 
3ffff780:  feefeffe feefeffe feefeffe feefeffe 
3ffff790:  feefeffe feefeffe feefeffe feefeffe 
3ffff7a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff7b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff7c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff7d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff7e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff7f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff800:  feefeffe feefeffe feefeffe feefeffe 
3ffff810:  feefeffe feefeffe feefeffe feefeffe 
3ffff820:  feefeffe feefeffe feefeffe feefeffe 
3ffff830:  feefeffe feefeffe feefeffe feefeffe 
3ffff840:  feefeffe feefeffe feefeffe feefeffe 
3ffff850:  feefeffe feefeffe feefeffe feefeffe 
3ffff860:  feefeffe feefeffe feefeffe feefeffe 
3ffff870:  feefeffe feefeffe feefeffe feefeffe 
3ffff880:  feefeffe feefeffe feefeffe feefeffe 
3ffff890:  feefeffe feefeffe feefeffe feefeffe 
3ffff8a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff8b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff8c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff8d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff8e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff8f0:  feefeffe feefeffe feefeffe feefeffe 
3ffff900:  feefeffe feefeffe feefeffe feefeffe 
3ffff910:  feefeffe feefeffe feefeffe feefeffe 
3ffff920:  feefeffe feefeffe feefeffe feefeffe 
3ffff930:  feefeffe feefeffe feefeffe feefeffe 
3ffff940:  feefeffe feefeffe feefeffe feefeffe 
3ffff950:  feefeffe feefeffe feefeffe feefeffe 
3ffff960:  feefeffe feefeffe feefeffe feefeffe 
3ffff970:  feefeffe feefeffe feefeffe feefeffe 
3ffff980:  feefeffe feefeffe feefeffe feefeffe 
3ffff990:  feefeffe feefeffe feefeffe feefeffe 
3ffff9a0:  feefeffe feefeffe feefeffe feefeffe 
3ffff9b0:  feefeffe feefeffe feefeffe feefeffe 
3ffff9c0:  feefeffe feefeffe feefeffe feefeffe 
3ffff9d0:  feefeffe feefeffe feefeffe feefeffe 
3ffff9e0:  feefeffe feefeffe feefeffe feefeffe 
3ffff9f0:  feefeffe feefeffe feefeffe feefeffe 
3ffffa00:  feefeffe feefeffe feefeffe feefeffe 
3ffffa10:  feefeffe feefeffe feefeffe feefeffe 
3ffffa20:  feefeffe feefeffe feefeffe feefeffe 
3ffffa30:  feefeffe feefeffe feefeffe feefeffe 
3ffffa40:  feefeffe feefeffe feefeffe feefeffe 
3ffffa50:  feefeffe feefeffe feefeffe feefeffe 
3ffffa60:  feefeffe feefeffe feefeffe feefeffe 
3ffffa70:  feefeffe feefeffe feefeffe feefeffe 
3ffffa80:  feefeffe feefeffe feefeffe feefeffe 
3ffffa90:  feefeffe feefeffe feefeffe feefeffe 
3ffffaa0:  feefeffe feefeffe feefeffe feefeffe 
3ffffab0:  feefeffe feefeffe feefeffe feefeffe 
3ffffac0:  feefeffe feefeffe feefeffe feefeffe 
3ffffad0:  feefeffe feefeffe feefeffe feefeffe 
3ffffae0:  feefeffe feefeffe feefeffe feefeffe 
3ffffaf0:  feefeffe feefeffe feefeffe feefeffe 
3ffffb00:  feefeffe feefeffe feefeffe feefeffe 
3ffffb10:  feefeffe feefeffe feefeffe feefeffe 
3ffffb20:  feefeffe feefeffe feefeffe feefeffe 
3ffffb30:  feefeffe feefeffe feefeffe feefeffe 
3ffffb40:  feefeffe feefeffe feefeffe feefeffe 
3ffffb50:  feefeffe feefeffe feefeffe feefeffe 
3ffffb60:  feefeffe feefeffe feefeffe feefeffe 
3ffffb70:  feefeffe feefeffe feefeffe feefeffe 
3ffffb80:  feefeffe feefeffe feefeffe feefeffe 
3ffffb90:  feefeffe feefeffe feefeffe feefeffe 
3ffffba0:  feefeffe feefeffe feefeffe feefeffe 
3ffffbb0:  feefeffe feefeffe 40227397 00000001 
3ffffbc0:  ffffffff 00000000 3ffe8e81 00000008 
3ffffbd0:  402273e6 3ffec4a0 3ffeedec 00000001 
3ffffbe0:  402274f2 3ffec4a0 3ffeedec 3ffec4a0 
3ffffbf0:  00000002 00000000 00000020 4010123a 
3ffffc00:  3ffe8d32 402264a3 3ffec4a0 3ffef980 
3ffffc10:  00000000 4021974f 3ffed958 feefeffe 
3ffffc20:  00000000 00000002 00000001 3ffec4a0 
3ffffc30:  3ffef4ca 40104cc7 3ffef980 3ffef1b4 
3ffffc40:  3ffef494 00080000 feefeffe feefeffe 
3ffffc50:  00000000 4020bc61 3ffee7b0 3ffef1b4 
3ffffc60:  3ffef4ca 0000002a 00000060 40100748 
3ffffc70:  3ffffc80 0000001c 3ffef514 00000006 
3ffffc80:  3ffeebdc 3ffeeba4 40227397 00000001 
3ffffc90:  ffffffff 00000000 3ffe8e81 00000008 
3ffffca0:  402273e6 3ffec4a0 3ffeedec 00000001 
3ffffcb0:  402274f2 3ffec4a0 3ffeedec 3ffec4a0 
3ffffcc0:  00000002 00000000 00000020 4010123a 
3ffffcd0:  3ffe8d32 402264a3 3ffec4a0 3ffef980 
3ffffce0:  00000000 4021974f 3ffed958 00000008 
3ffffcf0:  00000000 00000002 00000000 3ffec4a0 
3ffffd00:  3ffef74a 40104cc7 3ffef980 3ffef1b4 
3ffffd10:  3ffef714 00000001 00000000 3ffef514 
3ffffd20:  3ffeeba4 4020bc61 3ffee7b0 3ffef1b4 
3ffffd30:  3ffef74a 0000003e 3ffeebb0 feefeffe 
3ffffd40:  3ffe8970 feefeffe feefeffe 00000000 
3ffffd50:  3ffeebdc 3ffeeba4 3ffef714 4020bee3 
3ffffd60:  3ffe0000 3ffeeba4 3ffef714 4020c2d4 
3ffffd70:  3ffeea28 3ffee7e8 3ffeeba4 402143fc 
3ffffd80:  40105064 0000b4b7 3ffed930 3ffeea2c 
3ffffd90:  3ffeebdc 00000000 3ffeeba4 402137e0 
3ffffda0:  00000011 3ffeeb18 3ffec7c0 3ffed8f8 
3ffffdb0:  00000000 3ffef714 3ffed800 3ffef514 
3ffffdc0:  3ffee7e8 3ffef514 3ffeecbc 3ffef714 
3ffffdd0:  3ffef714 3ffeebb0 3ffeeba4 402139e4 
3ffffde0:  ffff0000 0137f10c 40102566 40210440 
3ffffdf0:  3ffef758 3ffef518 3ffeeba4 402143fc 
3ffffe00:  3ffeeba4 3ffeeba8 00000035 3ffef578 
3ffffe10:  00000014 3ffef514 000000ff 00000000 
3ffffe20:  00000006 3ffeeb18 3ffeecbc 40210497 
3ffffe30:  3fff001e 3ffe84e8 3ffe86c2 3ffef514 
3ffffe40:  3ffef67c 3ffeeba4 00000000 40214444 
3ffffe50:  3ffeeba4 00000000 00000000 40214ecc 
3ffffe60:  00000000 4bc6a7f0 00005b71 4021446a 
3ffffe70:  3ffeeba4 00000000 00000000 40214fdf 
3ffffe80:  00000119 00000040 00005c6b 402113c2 
3ffffe90:  3ffeeba4 00000000 3ffee808 4020d985 
3ffffea0:  00000001 3ffef518 3ffef598 00000000 
3ffffeb0:  00000000 00000000 3ffee648 3ffeeba4 
3ffffec0:  40105064 00261f48 3ffee760 00000000 
3ffffed0:  3ffee040 3ffee760 3ffe8514 3ffee760 
3ffffee0:  00000000 3fffff40 40203ec0 3fffefa0 
3ffffef0:  3ffee760 00000000 00001388 40201417 
3fffff00:  00000000 3ffef494 3ffee648 40203611 
3fffff10:  00000050 0000001a 3ffee6a0 4020376c 
3fffff20:  3fffdad0 3ffee6a0 3ffee6a0 3ffee708 
3fffff30:  3ffe84dc 00000050 3ffee648 40202bcc 
3fffff40:  40204510 66ec448a 3ffee6a0 40203a14 
3fffff50:  3ffe86a6 3ffee708 3ffee6a0 40203a60 
3fffff60:  3ffeedec 3ffee6a0 3ffee648 40202599 
3fffff70:  3ffe84e4 3ffee66c 3ffee6a0 4020251e 
3fffff80:  00000000 00000000 00000000 00000000 
3fffff90:  00000000 00000000 feefeffe feefeffe 
3fffffa0:  3fffdad0 00000000 3ffee6d8 40203f6c 
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(1,6)


 ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset



And that stack trace reads:

Code: Select all

Decoding stack results
0x4020bc61: glue2esp_linkoutput at glue-esp/lwip-esp.c line 299
0x40100748: malloc at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/umm_malloc/umm_malloc.c line 1673
0x4020bc61: glue2esp_linkoutput at glue-esp/lwip-esp.c line 299
0x4020bee3: new_linkoutput at glue-lwip/lwip-git.c line 233
0x4020c2d4: ethernet_output at netif/ethernet.c line 312
0x402143fc: ip4_output_if_opt_src at core/ipv4/ip4.c line 1007
0x402137e0: etharp_output_to_arp_index at core/ipv4/etharp.c line 770
0x402139e4: etharp_output_LWIP2 at core/ipv4/etharp.c line 885
0x40210440: udp_sendto_if_src at core/udp.c line 893
0x402143fc: ip4_output_if_opt_src at core/ipv4/ip4.c line 1007
0x40210497: udp_sendto_if at core/udp.c line 692
0x40214444: ip4_output_if_opt at core/ipv4/ip4.c line 820
0x40214ecc: mem_malloc at core/mem.c line 210
0x4021446a: ip4_output_if at core/ipv4/ip4.c line 793
0x40214fdf: ip_chksum_pseudo at core/inet_chksum.c line 395
0x402113c2: tcp_output at core/tcp_out.c line 1361
0x4020d985: sys_timeout_abs at core/timeouts.c line 189
0x40203ec0: esp_yield() at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/core_esp8266_main.cpp line 91
0x40201417: delay at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/core_esp8266_wiring.c line 51
0x40203611: WiFiClient::connect(IPAddress const&, unsigned short) at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/libraries/ESP8266WiFi/src/include/ClientContext.h line 136
0x4020376c: HardwareSerial::write(unsigned char const*, unsigned int) at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/HardwareSerial.h line 174
0x40202bcc: WiFiClient::connect(char const*, unsigned short) at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/libraries/ESP8266WiFi/src/WiFiClient.cpp line 133
0x40203a14: Print::println() at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/Print.cpp line 178
0x40203a60: Print::println(char const*) at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/Print.cpp line 190
0x40202599: loop() at /Users/jminton/Desktop/esp/httpsTest/httpsTest.ino line 25
0x4020251e: setup() at /Users/jminton/Desktop/esp/httpsTest/httpsTest.ino line 20
0x40203f6c: loop_wrapper() at /Users/jminton/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.0/cores/esp8266/core_esp8266_main.cpp line 125


I've read here and there about certain seemingly random issues caused by not enough power, I am running this off the USB of a Macbook Pro....should be enough, right? Could this be a power related problem? How can I verify or test this? I've got a 2amp charger but then I dont see serial data.

I'll might try another example code, this is proving to be a lot more frustrating than I initially hoped for. I feel like the error / stack trace tells me where problems are occurring but not why...like something is missing that just makes it kind of hard to understand.
User avatar
By QuickFix
#81366 Insert a yield() or delay(0) inside the while (client.connected() || client.available())-loop: you're choking the WiFi-stack now. :idea:

Although adequate for testing purposes, you should consider a state machine for real applications.