ESP 32 alarm keypad + website access

Hi, I have an alarm with keypad and I want also to control that alarm with website so I have function void alarm_website() that check status in firebase database and it works. I have only problem with LCD I don't know how to make it cooperate with status from website when I use a keypad it works fine but when I for example turn on alarm on website it still shows "disarmed" even though the alarm is on. I tried to change some things but it never worked perfectly, maybe you have any idea what should i change ?

I suggest using the ESP32's default I2C pins, makes things a lot lot more simple.

You understand that the ESP32 has 2 ports? PortA and portB. portB is setup for analog inputs.
GPIO & RTC GPIO - ESP32 - — ESP-IDF Programming Guide latest documentation (espressif.com)

You realize that the ESP32 has 3 hardware serial ports that you can use? You will find software serial does not work very well on an ESP32.

You realize that one of those pins is, also, the built in LED. That the pin drives an LED has caused me issues in the past.

Be careful when using those pins that during programing and boot those pins sate are not changed by an external signal. See the GPIO link.

When using freeRTOS DO NOT HAVE code in loop(). Code in loop() is NOT guaranteed to run.

I recommend addressing the above things before going further. The issues presented by the above are significant at this point.

Why the code in loop() is not guaranteed to run ? I thought as long as tasks don't have priority higher than 1, the loop() will run

The why is in there somewhere: API Reference - ESP32 - — ESP-IDF Programming Guide latest documentation (espressif.com)

The other thing, if there is code in loop() freeRTOS does not do memory cleanup.

From where did you conclude that in this case freeRTOS is used?

I don't know much about how enabling using the Arduino-IDE for ESP32/ESP8266 is done in the backround.

Deep down in a dark corner of my memory I remember foggy that RTOS is running in the backround anyway.

Is this correct? If yes do you mean using ESP32 in a "standard"-way like any example-code does it should not have code inside loop() ???!!

Can you please clarify this aspect?

best regards Stefan

From the code in the original post that is no longer there xTaskPinnedToCorre was used in setup(), xTaskPinnedToCore.

freeRTOS, the OS built into the ESP32 runs house keeping chores when loop() is ran and when loop() does not have any code. Also, loop() runs as the lowest priority task. With loop() being the lowest priority task loop() is NOT guaranteed to run in a timely fashion. If this does not make sense then here's the docs: API Reference - ESP32 - — ESP-IDF Programming Guide latest documentation (espressif.com)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.