These are chat archives for esp8266/Arduino

23rd
Apr 2016
geman220
@geman220
Apr 23 2016 00:17
@skorokithakis I have a quick question for you if you don't mind.
Stavros Korokithakis
@skorokithakis
Apr 23 2016 00:52
sure
geman220
@geman220
Apr 23 2016 00:55
So I wanted to get started on at least prototyping the MQQT servo project. I ordered a WICED Feather on Amazon and it got here today. Adafruit's website says "You write your code in the Arduino IDE using the same standard libraries you've always used (Wire, SPI, etc.), compile locally, and the device is flashed directly from the IDE over USB." Except it doesn't support Servo.h....... Anyway, I got MQTT to work and I can do a simple test to have it Serial.print a message depending on what is posted to the broker. I actually have 2 questions. 1) For some reason this program is just eventually disconnecting from the MQTT broker and I have to reboot the device to have it connect again. 2) Whenever I can actually get a servo hooked up, it should just be as easy as replacing the Serial.print with the servo infromation, correct?
Stavros Korokithakis
@skorokithakis
Apr 23 2016 00:59
hmm, does the feather have an ESP?
geman220
@geman220
Apr 23 2016 00:59
No it doesn't but I was just using it as a stop gap to try and hammer out the code and functionality so when my ESPs get here I can just load up some code (save a few changes).
I specifically looked for something that claimed to support all default libraries... I'm getting very fed up with Adafruit for a few reasons -.-
Stavros Korokithakis
@skorokithakis
Apr 23 2016 01:02
not sure man :/ should have gotten a huzzah
geman220
@geman220
Apr 23 2016 01:02
Sold out wouldn't have fixed my gap =(
Stavros Korokithakis
@skorokithakis
Apr 23 2016 01:02
ah :/
geman220
@geman220
Apr 23 2016 01:02
Any idea why the MQTT is disconnecting? Is there a keepalive or loop I should be running?
Stavros Korokithakis
@skorokithakis
Apr 23 2016 01:03
have a look at my library above, it has a working mqtt example
there's a loop afaik, yeah
Keith Andrew Hill
@vic10us
Apr 23 2016 01:07
Why doesn't ESP need the loop method? I thought you could make everything event driven like in LUA?
I meant DOES
Stavros Korokithakis
@skorokithakis
Apr 23 2016 01:08
not sure how lua works :/
Keith Andrew Hill
@vic10us
Apr 23 2016 01:08
Isn't the ESP multithreaded?
Stavros Korokithakis
@skorokithakis
Apr 23 2016 01:08
not that i know of
Michael Miller
@Makuna
Apr 23 2016 01:15
Arduino is not multithreaded, and this is an Arduino environment. If you want "true" multithreaded support you won't be working in Arduino. If your Ok with "non-preemptive" and want to remain with Arduino, I have a task library (github/makuna/task) that is cross Arduino supported and I also believe the included Ticker library also provides similar functionality.
@vic10us Don't confuse a hardware platform (Esp8266) with a Dev Environment (Arduino).
Event Driven doesn't mean multithread either. Generally "async" programming models are "event driven" models. While most Arduino libraries or features are not "async" due to historic reasons around complexity and target audience of Arduino, with a little work they could be. I personally prefer async.
tzapu
@tzapu
Apr 23 2016 03:25
@skorokithakis you know what would look nice in your boilerplate? WiFiManager to handle all the wifi configuration, maybe mqtt server, ntp server as well at setup time :D
Lars Englund
@larsenglund
Apr 23 2016 04:20
@igrr @me-no-dev a solution has been found for the NMI problem! :smile: larsenglund/esp8266_arduino_nmi_timer#1
Stavros Korokithakis
@skorokithakis
Apr 23 2016 06:51
@tzapu What do you mean? That's literally all it does.
sticilface
@sticilface
Apr 23 2016 08:19
@Makuna that makes a lot of sense. And maybe why I was still getting variable sizes just using standard sizes. Will report back. Thanks.
Me No Dev
@me-no-dev
Apr 23 2016 08:27
@larsenglund nice find! elegant solution as well :)
marksev1
@marksev1
Apr 23 2016 10:12
sticilface are you maybe also active on irc somewhere? or just gitter
fmgomes
@fmgomes
Apr 23 2016 11:01
I have a project working with previous esp/arduino version 2.1.0, that to save battery enters in power down mode using the CH_PD pin, waking up through an external signal that is connected to the CH_PD. This is working well, but now I've upgraded to esp/arduino version 2.2.0, and it isn't working anymore, when the signal connected to the CH_PD pin apear, it enters in programming mode if using the latest V2.2.0, but starts in normal mode if using V2.1.0. Was there any change that might trigger this different behavior? GPIO0 has a pull-up resistor (and a push button connected to ground that I press to put in programming mode when neessary)
The message I get in the serial port at 76800 bps now with version 2.2.0 is the following:

ets Jan 8 2013,rst cause:1, boot mode:(3,7)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

fmgomes
@fmgomes
Apr 23 2016 18:23
Updating my last message, I was wrong saying that it was booting in programming mode. But nevertheless it is not booting well, and one thing I observe is that with version 2.1.0 I see: ets Jan 8 2013,rst cause:1, boot mode:(3,6)
and with version 2.2.0 I get: ets Jan 8 2013,rst cause:1, boot mode:(3,7)
Is there any documentation about the meaning of the second digit in the boot mode message?
Full boot message with version 2.1.0:

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

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

Full boot message with version 2.2.0 (exactly the same software and the same hardware):
ets Jan 8 2013,rst cause:1, boot mode:(3,7)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld