-->
Page 1 of 1

ESP8266 resets when sends data to thingspeak

PostPosted: Wed Mar 20, 2019 12:41 pm
by panoss
I have a board with ESP8266 (on it's breakout board), Nokia 5110 LCD and a Lora module.
The problem is that when the ESP tries to send tha data to thingspeak it...resets!

I have tried with another power supply whih can supply a lot of power in case it 's a lack of current.
But no, no change.
With the multimeter I see no voltage drop when it resets. (maybe my multimeter is not fast enough or maybe there is no voltage drop)

The code where it happens is this:
Code: Select allint sendToThingSpeak(String dataFieldOneValue) {
  display_show_text("Sending to thingspeak...");
  delay(1000);

  ThingSpeak.setField( dataFieldOne, dataFieldOneValue );
  display_show_text("Sending Step 1...");
  delay(1000); 
   
  int writeSuccess = ThingSpeak.writeFields( channelID, writeAPIKey );
  display_show_text("Sending Step 2...");
  delay(1000);
  return writeSuccess; 
}


The reset is happening at 'ThingSpeak.writeFields'.

Pins I use for LCD, Lora and for an interrupt:
LCD.....................ESP
CLK.....................GPIO10
DIN......................GPIO2
DC.......................GPIO0
CE.......................GPIO1
RST.....................GPIO3

Lora...................ESP
SS......................GPIO15
RESET................GPIO4
MOSI..................GPIO13
MISO..................GPIO12
SCK....................GPIO14

For the interrupt I use pin GPIO5.








i

Re: ESP8266 resets when sends data to thingspeak

PostPosted: Thu Mar 21, 2019 6:39 am
by btidey
Two things.

You can't use GPIO10 as it is one of the interface signals to the onboard flash chip. You can use GPIO16.

You get resets from the watchdog timer if something takes too long to execute. If the Thingspeak call is taking more than a few seconds to complete then you will get a reset.

Re: ESP8266 resets when sends data to thingspeak

PostPosted: Thu Mar 21, 2019 10:26 am
by panoss
I now use GPIO16 instead of GPIO10, but nothing changed.
Nothing takes too long to execute.

So it must be something else.

Re: ESP8266 resets when sends data to thingspeak

PostPosted: Thu Mar 21, 2019 1:34 pm
by panoss
The problem was in the code...I had forgot a few...things... :roll:
Code: Select allWiFiClient  client;
.....
ThingSpeak.begin(client);

With these works fine.
Thank you!