Page 1 of 1

Standalone mode

Posted: 24 Aug 2019, 19:03
by mackowiakp
I want to use one nodeMCU in standalone mode. Is it any possibility to use any real time clock module in easyESP ?
And second question. nodeMCU reboots itself sometimes and power supply can be loss, That is why I need to restore the state of relays before reboot or power loss. Is it possible to save it, for example, as a variable in non-volatile memory?

Re: Standalone mode

Posted: 24 Aug 2019, 23:44
by TD-er
To answer the last question first, nope not yet.
And about the clock issue.
One thing that will work for sure, is using a GPS module.
I don't know if there is a RTC module supported. (so assume it isn't)

Re: Standalone mode

Posted: 25 Aug 2019, 08:49
by enesbcs
TD-er wrote: 24 Aug 2019, 23:44 To answer the last question first, nope not yet.
And about the clock issue.
One thing that will work for sure, is using a GPS module.
I don't know if there is a RTC module supported. (so assume it isn't)
If somebody implements plugin callable "settime()" function into ESPEasy core and time related functions will work with disabled NTP state, than i can update my DS3231 plugin. (Which did not work from last year october when the time related core functions changed.)
https://github.com/letscontrolit/ESPEas ... DS3231.ino

Re: Standalone mode

Posted: 25 Aug 2019, 08:55
by mackowiakp
Yep. But using GPS module is extremely expensive comparing to RTC module, witch costs a few cents. Additionally, such RTC`s in most cases have on-board 4k or 8k EEPROM, available on other I2C address. Of course, such EEPROM is not equivalent to "real" NVRAM but is is enough to store several parameter in case of reboot or power failure.
Anyway, be so kind treat it as a kind of "future request".

Re: Standalone mode

Posted: 25 Aug 2019, 20:18
by TD-er
Do you have a link for such a RTC module with also I2C EEPROM?

Re: Standalone mode

Posted: 25 Aug 2019, 20:30
by Shardan

Re: Standalone mode

Posted: 25 Aug 2019, 20:32
by mackowiakp
So You have:
https://botland.com.pl/pl/moduly-rtc/12 ... iecia.html

Sorry, it is in Polish language, so use G-translator. It costs appx 1,2 Euro and have 32k of EEPROM. I use similar in my RPi but with 4k EEPROM (oldest one). It works properly (both RTC and EEPROM) with Python based driver.

Re: Standalone mode

Posted: 25 Aug 2019, 20:39
by TD-er
So the Ali link https://www.aliexpress.com/item/1876368 ... lsrc=aw.ds

@enesbcs Is this one also compatible with your playground plugin?

Re: Standalone mode

Posted: 25 Aug 2019, 20:46
by mackowiakp
And sample of Arduino lib for RTC and EEPROM

https://github.com/fstimer/RTCLib

Re: Standalone mode

Posted: 25 Aug 2019, 20:54
by TD-er
If the EEPROM is just another I2C device on the bus, then it should be no problem.

Re: Standalone mode

Posted: 25 Aug 2019, 21:00
by mackowiakp
Yes, it is totally separated. Except power supply of course and I2C bus.

Re: Standalone mode

Posted: 25 Aug 2019, 22:25
by enesbcs
TD-er wrote: 25 Aug 2019, 20:39 So the Ali link https://www.aliexpress.com/item/1876368 ... lsrc=aw.ds

@enesbcs Is this one also compatible with your playground plugin?
Not exactly. The DS1307 that you have linked is another type, i was unable to make it work with the same library as the DS3231 (altough there are several implications that these devices are compatible), so i've made two separated experimental plugin for testing:
https://github.com/enesbcs/ESPEasyPlugi ... DS1307.ino
https://github.com/enesbcs/ESPEasyPlugi ... DS3231.ino
The RTCLib that mackowiakp posted may solve the compatiblity issue.
Also the DS3231 is more accurate so there are no real reason to use DS1307.

The latest ESPEasy build that this plugin will compile is 2018.10.01 (version from 2018.10.18 may also work, as settime() function disappeared at 2018.Oct.19, and timestruct changed on 2018.Oct.26)

Re: Standalone mode

Posted: 26 Aug 2019, 07:03
by mackowiakp
Yes. DS3231 is more accurate then DS1307. Even I found out DS3231 based module which has better quality of quartz oscillator that guarantee 2 sec per year accuracy (as docu stands). I really dont believe in that "2 sec per year" but for sure DS3231 is better than DS1307. In case of my RPi equipped with DS1307, Python driver has possibility to enter (directly in py code) "constant drift" of RTC module. It is weekly or daily difference between RTC and real time. It strongly depends on the given RTC module and is more or less constant in room temperature. In my case it is "minus 1,6 sec per day".

Re: Standalone mode

Posted: 26 Aug 2019, 09:18
by TD-er
So I will add this one to my queue of items on their way from Ali Express.

Re: Standalone mode

Posted: 26 Aug 2019, 14:15
by mackowiakp
I just bought similar one, in the shop near my house. Probably the same origin. That is O-CNN Company (Original China No-Name) :lol:

Re: Standalone mode

Posted: 26 Aug 2019, 16:30
by epost
Pay attention!!. Do use a rechargeable Lithium battery.
A normal battery is inflated during charging.
(Or remove the diode from the circuit board)

Re: Standalone mode

Posted: 26 Aug 2019, 16:54
by mackowiakp
Yes, I know. I had little explosion few months ego. Thanks God, I have no Tesla car or electric bike. Its because I could have a fire under ... well ... a certain place.

Re: Standalone mode

Posted: 27 Aug 2019, 00:40
by TD-er
mackowiakp wrote: 26 Aug 2019, 16:54 Yes, I know. I had little explosion few months ego. Thanks God, I have no Tesla car or electric bike. Its because I could have a fire under ... well ... a certain place.
As we say in Dutch: "Wie zijn billen brandt, moet op de blaren zitten" :)

Re: Standalone mode

Posted: 27 Aug 2019, 08:29
by mackowiakp
:D . G-Translator works properly !