These are chat archives for esp8266/Arduino

8th
Jan 2017
simonliu009
@simonliu009
Jan 08 2017 07:07
@Makuna Yes, I did. So my understanding is there are 2 ways to operate the ESP8266 flash to store customize data: 1) use EEPROM class (with 512 bytes limitation). 2) Use SPIFFS class to read/write data in a file. Is that correct? And if I use EEPROM class , is it going to screw up the saved SSID and password of the WiFiManager ? The link here https://github.com/esp8266/Arduino/blob/master/doc/filesystem.md shows the WiFi config data of SDK was store in a different area with "EEPROM" but I'm not sure how Wifi Manager works. I posted an issue on the WiFi manager repository about the flash location but there is no response yet.
simonliu009
@simonliu009
Jan 08 2017 07:19
I just learned that WiFi Manager is using WiFi Client, so it is likely the SSID/Password were stored in a different place with "EEPROM".
simonliu009
@simonliu009
Jan 08 2017 07:57
I found more information about the EEPROM class, igrr mentioned " This is a bit different from standard EEPROM class. You need to call EEPROM.begin(size) before you start reading or writing, size being the number of bytes you want to use. Size can be anywhere between 4 and 4096 bytes. " This is fantastic.
Victor Tseng
@Palatis
Jan 08 2017 07:58
yeah it is
and it's shadowed in ram
so if you EEPROM.begin(4096), it occupies 4kb of ram.
so just begin() with the size you really want to use.
simonliu009
@simonliu009
Jan 08 2017 08:00
Thank you Victor, that's cool.
Good hint for the RAM shadow
Victor Tseng
@Palatis
Jan 08 2017 08:02
spi nor flash layout is roughly [bootloader][sketch][spiffs][eeprom][system eeprom]
simonliu009
@simonliu009
Jan 08 2017 08:07
I think all my questions are answered. Just use EEPROM straight .
Akash Ashok
@thehellmaker
Jan 08 2017 11:46
hi guys .....
i am facing thsi wierd problem that only in one house esp8266 is going bad regularly
after the mcu goes bad
vcc and ground are shorted
Victor Tseng
@Palatis
Jan 08 2017 11:50
vcc 3v3?
Akash Ashok
@thehellmaker
Jan 08 2017 11:50
yes vcc is 3.3V
we are not sure if there are voltage spikes in this house
Victor Tseng
@Palatis
Jan 08 2017 11:50
tvs diode protected?
Akash Ashok
@thehellmaker
Jan 08 2017 11:52
yes
its a non isolated smps
this is the power 3.3v supply
Stavros Korokithakis
@skorokithakis
Jan 08 2017 17:48
What's the best and most reliable way for two ESP8266 to communicate over one or two wires (digitally), or, say, an ESP8266 with an Arduino?
Serial feels too complex
Michael Miller
@Makuna
Jan 08 2017 18:00
@skorokithakis PJON is a one wire solution. There is always I2S.
Stavros Korokithakis
@skorokithakis
Jan 08 2017 18:01
Is I2S? Is that like I2C?
PJON seems nice, thank you
It has error handling as well, that's great
Also, I'm making a thermostat that connects to MQTT, are interrupts a good way to handle the button inputs that change temperature without lagging? I've found that polling in loop() lags too much
Michael Miller
@Makuna
Jan 08 2017 18:20
If polling in the loop has to much lag, then something in your code is eating too many cycles at one time (pretty common with the way Arduino is taught). You need to avoid using the delay() in your code with anything other than a single digit value.
The problem with button triggering actions on the interrupt is that many things can not be called from within an interrupt; so you will have to queue the input and then in the loop look for the input being present. This still is a good way as it makes the input detection more accurate; but doesn't solve any lag caused by slow loop code.
In my Task Library you will find some examples that show doing similar things. It might help to glance at that.
Stavros Korokithakis
@skorokithakis
Jan 08 2017 18:46
Hmm, yeah. I just realized that I was going to do the processing in the loop too. I literally have nothing but an MQTT loop in the loop, and the button handling code
Maybe it's the debouncing lib, but at 20ms how laggy can it be?
Michael Miller
@Makuna
Jan 08 2017 18:50
20ms is not noticeable by 99.99% of human population; only video gamers state they can feel it ;-)
Martin Ayotte
@martinayotte
Jan 08 2017 19:02
:smile:
Stavros Korokithakis
@skorokithakis
Jan 08 2017 21:16
Yeah, so that can't be it...
Victor Tseng
@Palatis
Jan 08 2017 21:18
20ms... if it happens once every second you probably won't notice nothing
if it happens once every 40ms you definitely notice a lag.
Stavros Korokithakis
@skorokithakis
Jan 08 2017 21:37
I'll test some more and see, thanks
Now I have a different problem, I need to drive two relays over one wire
So I'm thinking something that will connect the wire either to ground, or Vcc, or will leave it open
The first two are fine, but I'm not sure how I can just have a wire float without another relay
Martin Ayotte
@martinayotte
Jan 08 2017 21:46
What do you mean by "two relays over one wire" ? Do you mean using OneWire protocol or the PJON mentioned above ?