These are chat archives for esp8266/Arduino

16th
May 2016
Michael Miller
@Makuna
May 16 2016 17:24
Just ran across this: Esp8266 Running on Button Cells
Vague Rabbit
@thewhiterabbit
May 16 2016 18:35
I watched that video ^. I'm now using deep sleep to conserve power!
Mario Mikočević
@mozgy
May 16 2016 18:36
220R connecting GPIO16-RST is on all my PCBs :)
Vague Rabbit
@thewhiterabbit
May 16 2016 18:38
I have an API that is responding with only a single line of json. But it seems that I am not able to put the 'sleep_interval' into my sleepTime variable to set the deep sleep duration.
String response;
long sleepTime = 0;
while(client.available()){
response = client.readString();
}
Serial.print(response);
JsonObject& responseObj = jsonBuffer.parseObject(response);
sleepTime = responseObj["sleep_interval"];
if (sleepTime == 0) {
sleepTime = 600000000;
}
ESP.deepSleep(sleepTime)
@mozgy That's the ticket! :)
Does the ESP need to receive HTML also or can it receive only json string with success?
Vague Rabbit
@thewhiterabbit
May 16 2016 18:45
Also my json response looks like this:
{"status":1,"message":"Data successfully saved.","sleep_interval":300000000}
Mario Mikočević
@mozgy
May 16 2016 18:49
try if (!responseObj.success()){Serial.println("B0rken!");}
just after .parseObject
Vague Rabbit
@thewhiterabbit
May 16 2016 18:59
Wow. I just noticed that the serial isn't even printing output after 'tail 0' 'chksum'
But the server is getting hit and recording to the database... Weird
Martin Ayotte
@martinayotte
May 16 2016 19:05
Do you mean the Serial.print(response) doesn't print anything ? Are you waiting for the response from server before doing while(client.available()){ ?
Vague Rabbit
@thewhiterabbit
May 16 2016 19:07
@mozgy I added that code, @martinayotte nothing coming in through serial monitor at all. delay(100); after the client.print
Hmm. The connection status isn't even printing to serial anymore.
Martin Ayotte
@martinayotte
May 16 2016 19:09
delay(100) is maybe not enough. Personally, I never do a delay, using a loop with 5 sec timeout until another client.available() become true.
Vague Rabbit
@thewhiterabbit
May 16 2016 19:10
I don't want to flood the chat with full code... I will paste bin it
I'm new to c++ so I could be doing many things wrong, who knows >.<
Vague Rabbit
@thewhiterabbit
May 16 2016 19:32
Serial port just caused my Mac to crash. Well, I guess it was a bad idea to buy LoLin NodeMCUs
Martin Ayotte
@martinayotte
May 16 2016 19:45
I don't see anything wrong for now. Your crash on Mac is maybe cause by bad serial driver. I've heard that some people got problems.
Vague Rabbit
@thewhiterabbit
May 16 2016 19:52
Thank you @mozgy and @martinayotte for the help. I'll reboot with the new driver and see if that helps. I couldn't see any other reason that Serial port would cause crashing or fail to print either. Thank you for the link!
Mario Mikočević
@mozgy
May 16 2016 19:52
yw
Vague Rabbit
@thewhiterabbit
May 16 2016 20:20
I have installed the updated driver, restarted, but still nothing incoming on that serial port. Not crashing anymore, so far, bauds match up. I can upload sketches and the device operates as expected, but it seems like the serial port is blind to the device printing to it. So strange. Sorry, I know it's not ESP related, but I can't debug my ESP code if I can't see serial output. Sad day today. lol
Doh! Needed to have Both CR and NL selected in the IDE.
Vague Rabbit
@thewhiterabbit
May 16 2016 21:59
Well, I was able to get some Serial.print output when using a test sketch from the examples section, but it still will not print to serial in my custom sketch. I read about a gcc compiler problem on linux based systems that somehow effects Serial.print. I can't even get consistent results using the example code. One time it prints to serial, the next it doesn't, or the serial.print is intermittent. I'm starting to pull my hair out now. Should I just throw these LoLin NodeMCUs out and buy genuine ones?
Vague Rabbit
@thewhiterabbit
May 16 2016 22:08
Another crash... Kernel Extensions in backtrace:
wch.usb.usb(1.0)[EA641D5C-6B8B-3281-85B4-9D52DB2C11BB]@0xffffff7f908b5000->0xffffff7f908bcfff
I can see this will clearly not be a stable platform to proceed with. Any suggestions for a WiFi device that is stable?