-
Notifications
You must be signed in to change notification settings - Fork 94
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
Async message parsing #57
Comments
The way we handle messages and events has always bugged me. I fully support this approach, but it will take a reasonable effort |
…ht handlers regardless of order they come in.
…ht handlers regardless of order they come in.
Benefits: Status messages are not get lost if an event comes in. Great performance improvements. No idea if Serial is working in this branch. Testing required. |
@jpbarraca We probably want to switch to aioserial in this branch. |
yes. But lets test, we introduced many changes since the last merge to master |
Panel: EVO192
|
@yellowonblack I am not sure if @jpbarraca has fixed Serial connection already. |
Just tried now and it seems that not: message = Special events: WinLoad in (connected) |
The panel is correctly identified but when trying to get most probably label data it fails. I can provide full debug log file if needed. 2019-04-03 22:42:36,990 - INFO - PAI - Starting Paradox Alarm Interface |
Panel: EVO192 Very Good:
Not so good:
That might be related to some error which appears in the logs: 2019-04-03 23:38:01,671 - WARNING - PAI.paradox.paradox - Missing element with ID 12 in zone/1_LivingW |
@yellowonblack Do you have in configuration for EVO?
|
IP150 v4.30 with siteID connects? That is a surprise. I thought I broke it while rewriting to async 😄 |
The issue with missing labels could be related to the messages rate, which is much higher. An MG panel takes 70ms to 100ms to issue a reply and we easily send messages with less interval. |
I have not seen this issue with IP150 module. I run at full speed without any problems. |
Throttling may be applicable for Serial only. |
I updated my pai.conf as @yozik04 mentioned and now all partitions are identified correctly, although if I use 'partition': range(1, 9) and I only have 4 partition, this will cause creation of a bad topic on MQTT paradox/states/partitions// (with double / at the end) probably because of the missing partition labels names. Now the only warning remaining is: 2019-04-04 09:46:28,294 - INFO - PAI.paradox.paradox - Connecting to panel |
It connects as you see, but something strange appears in the first log lines after I connect: Panel version 20, firmware: 4.48,. Do you have any idea why? 2019-04-04 09:46:26,707 - INFO - PAI - Using IP Connection |
@yellowonblack You can safely ignore those warnings, they are used to pinpoint sub optimal processing. |
Thanks for clarifications @jpbarraca. I will keep the IP siteID connection running and let you know if I find problems. Also, if you fix things on the serial connection, I will test it and sent you feedback. Another problem quite important (also referenced in #55 (comment)):
2019-04-04 15:01:44,782 - INFO - PAI.paradox.paradox - Disconnected from the Alarm Panel
That would be very useful to get the offline messages on the topic. |
@yellowonblack I tested with a serial connection and it works. Which problems are you facing? |
Here I mentioned what is happening: #57 (comment) + #57 (comment) I tried again now and the same error. |
Send me full log from latest asyncio. With Debugs on. |
Full log has been sent. |
Currently we have situation that sometimes a message response comes out of an order and we fail to map it to a request as that request already failed. I periodically see this when loading labels and some events kick in.
I propose having a different model of request parsing.
When we issue a request that waits for a response we register it's handler in a queue. Then when a response comes we iterate through all handlers in a queue to find matching request handler. Request handler can tell if passed response was intended for it.
This handler queue can have permanent Event handler in it so all events are processed separately.
All this will allow us to start using async await in our code.
The text was updated successfully, but these errors were encountered: