Page 1 of 1

ESP32 Real Time Clock faild

Posted: Thu Sep 29, 2022 2:10 pm
by stefan.erni
Hi Ben

I would like to use the RTC of the ESP32 without wifi. But when I initialize the component I get a "failed"

regards

Stefan

ESP32 RTC
rtcc_2022-09-29_15-04-22.jpg
rtcc_2022-09-29_15-04-22.jpg (7.15 KiB) Viewed 4103 times

Re: ESP32 Real Time Clock faild

Posted: Wed Oct 05, 2022 1:57 pm
by BenR
Hi Stefan,

I beleive if you add the wifi component, even if you're not using it then hopefully that should allow the compilation to complete.

I'll investigate and see if there is a way to allow the build regardless.

Re: ESP32 Real Time Clock faild

Posted: Fri Oct 07, 2022 3:28 pm
by stefan.erni
Hi Ben

Yes with the wlan the RTC works.
I can also set the time with the server. All this is with Flowcode very easy to do

But with the wireless connection, the HX711 no longer works properly. Is there a way to do the waln like unconnect or can you add a dissconnectSSID command for the wlan.
That would be useful if you only need the wifi for a short time.

regards

Stefan

Re: ESP32 Real Time Clock faild

Posted: Mon Oct 10, 2022 10:00 am
by BenR
Hi Stefan,

You can disable interrupts for a while on the ESP32 by using this in a C icon. Do you want to try adding this just before sampling the HX711 and hopefully that should solve the problem for you.

c code icon
portDISABLE_INTERRUPTS();

HX711 sample

c code icon
portENABLE_INTERRUPTS();

If it works for you then I'll put the code into the time critical part of the component.

Re: ESP32 Real Time Clock faild

Posted: Tue Oct 11, 2022 10:11 am
by stefan.erni
Hi Ben

Unfortunately, disable interrupts is not an option for my program
this would be my wish...
Setting the time and date with WiFi, USB or Bluetooth
The time is set via Wlan:
If I press a button when starting up, it should turn on wifi and set the clock and date. Then the wifi should be turned off again. with an additional command disconnect SSI)

The time is set via USB or Bluetooth:
For this I wrote FC9 APP where it already works well. Sending the PC timeDate to the ESP32
with an additional command set TimeDate string while Wlan is turned of

read the time and date:
If the ESP32 starts normally I should be able to read the time and date. Just read one string is enough.
with an additional command get TimeDate string while Wlan is turned of

I will test if the ESP32 let the time run in deep sleep mode. Unfortunately I did not find a pin for an additional battery for RTCC


regards

Stefan

Re: ESP32 Real Time Clock faild

Posted: Wed Oct 12, 2022 12:24 pm
by BenR
Hi Stefan,

We can certainly look at adding a disconnect macro. Does the following C code do what you need?

Code: Select all

 esp_wifi_disconnect();
 esp_wifi_stop();
 esp_wifi_deinit();

Re: ESP32 Real Time Clock faild

Posted: Wed Oct 12, 2022 2:46 pm
by stefan.erni
Hi Ben

Yes it's working fine.

If the password is correct it's set the time (with 2hours offset)

If the password is bad it's set the time to 00:00:00 ( 2hours offset is set to 0)

Always the HX711 is working nice.

These 3 commands could also be useful for other applications, if it is not too complicated I would add them to the component.
But for me it's already perfect.


regards


Stefan
wlan_2022-10-12_15-34-01.png
wlan_2022-10-12_15-34-01.png (106.64 KiB) Viewed 3997 times

Re: ESP32 Real Time Clock faild

Posted: Wed Oct 12, 2022 4:22 pm
by stefan.erni
Hi Ben

One more reason to turn off the wifi when not in use.

A Board with Esp32, display various hardware and wlan connected, needs 165mA
If I do the commands to disconnect wlan, the board just needs 120mA

If I use a deepsleep command , the board needs 10mA and the clock(time) keeps running

But after a reset (power off), the time must be set again

regards

Stefan