arduino-libraries / ArduinoIoTCloud

Home Page:https://app.arduino.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArduinoCloud.update(); delay occures

punj opened this issue · comments

commented

Hello!,

I've attached a 3x4 matrix keypad and integrated the code with Arduino IoT cloud. However, I could see that
after writing ArduinoCloud.update(); it prints after a delay of about a second and therefore if any key is pressed during that particular moment is not being captured.

void loop() {
  ArduinoCloud.update();
  Serial.println(" PRINT CONTINUOSLY" );
}

Can somebody help me to run both of the lines of code independently without blocking?

I really appreciate any help you can provide.

@punj what board are you using? There is no RTC support for ESP boards.
I suspect the delay is due to NTP requests occurring during the update() call.

commented

@pennam Thanks for your quick reply. I am using ESP32. I think yes delay is due to an NTP request, but what is the best way to run both simultaneously? Otherwise, Keypad, RFC522, and other sensors all will have to face this delay issue. Thanks

I would say the best option is to add the RTC support, maybe this can help you espressif/arduino-esp32#3641

commented

@pennam, Thanks but I am not looking solution for using Real Time Clock and I need the solution that helps to capture keypad keypressed immediately. Right now, due to some reason appx 1 second delay is taking place, so in the meantime it doesn't capture keyPressed.

If you need a solution to reduce the dealy caused by NTP requests adding RTC support is the correct thing to do.