-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection from ESP32 to the Alarm is slow and hangs very often #25
Comments
@qntris thanks for your kind words, I have seen this as well with my esp32. I am suspecting the PubSubClient on the esp32, its not recovering the mqtt connection ofter a timeout. The thing is I do not have the time to debug this, my day job is too demanding. |
My hunch was correct so the pubsubclient is crashing together with the wifimanager, so I will upload a an update soon, like we say back to basics, I am running this on my installation and so far it looks stable. |
@maragelis great news, and I am glad you managed to figure it out. I suppose that's the reason for the "hanging" part, but what's the culprit for the slow response when issuing commands - several seconds for arming_home is definitely not expected. As I said, the WiFi connection is good on my end, ping is perfect, MQTT broker is stable... Do you suspect that the pubsubclient was to blame for that slowness as well? |
@maragelis @qntris It is always good idea to add autoreboot in case MQTT cannot relive the connection. I had such problems with ESP266 and ESP32.... I continue to use ESP8266 for my alarm but here are some tips: `void handleMqttKeepAlive() { if (!client.connected()) {
} else {
} }` in reconnect before else delay(5000) add lastConnected=millis(); Sorry the code is for ESP8266, but you should got the idea and can quickly adapt it for ESP32 :) And if you decide to use raspberry pi you can check this @maragelis You can check it also - I extracted some useful conversions - now by me panel status instead of giving some not understandable numbers for DC voltage, battery voltage etc. gives readable voltage values... Also there is mistake in your logic for calculating PIN which you send to alarm (thats why you dont prefer zeroes in the PIN code), but I discovered that before seeing this soft. This is the correct way to calc the pin: ` byte str2byte(String str) { byte ReplaceZeroes(byte c) { byte t1 = c & 0x0F; byte t2 = (c >> 4) & 0x0F; if (t1 == 0) t1 = 0x0A; if (t2 == 0) t2 = 0x0A; return t2 * 16 + t1; } void PanelPassword() { pass1 = ReplaceZeroes(str2byte(String(PIN).substring(0, 2))); pass2 = ReplaceZeroes(str2byte(String(PIN).substring(2, 4))); }` Btw, the above soft works with EVO also - I see a lot of requests here for EVO (and in the old 8266 thread) - so someone can directly use it or extract the protocol.... |
Hi @maragelis,
Thank you for the great work you are doing to make our SP systems smarter than they are. I've decided to make the move from ESP8266 to ESP32 on my SP5500 board.
This is the ESP-32 30PIN that I have bought (3 pieces) from aliexpress:
I have the below setup:
So far so good. However, I have the following issues:
I have tried with each of the 3 pieces of ESP32s I have (to rule out faulty board)- the result is absolutely the same. My setup is quite simple I think and really have run out of options.
Let me know if you want some further details from me so that we can find the issue, or if you want to do a join debugging session - my email address is: ipuzunov at gmail dot com
Thank you in advance for your help and really hope that the ESP32 can prove to be the better option.
The text was updated successfully, but these errors were encountered: