-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
External reconnect fails as long as "old" connection has not been terminated gracefully #843
Comments
To clarify, this is about XML-RPC. But only for HmIP. There are no problems with the old wired and wireless protocols. |
thought maybe we can come a step further when more guys are involved..... |
@n0l0cale Please provide adequate example XMLRPC communication output between home assistent and the CCU/RaspberryMatic/HmIPServer where the issue is demonstrated. Only with detailed information you will have any chance that this issue will get fixed by eQ3. |
@danielperna84 - could you please give me assistance with providing such a sample? I think you are deeper in this than I am.... |
@n0l0cale |
Ok, so I have created the following test-script: https://gist.github.com/danielperna84/28653b1ebf760064cdbecf5f4828f5f3 Adjust the variables at the top (the IP addresses mainly), then execute it with On the CCU / RaspberryMatic you'll get something the following when the second
This only happens for HmIP. Doing the same with port 2001 shows no errors in the At the bottom of the script the wait times could be increased. What will be observed is, that after the first That being said, the reason for this behavior seems to be, that we don't just return an empty list to the CCU after the So to sum this up: the HMIPServer on the CCU fails to accept init-requests if the As far as I am aware of, the XML-RPC API documentation does not state, that the format of the response to the Edit:
Obviously the XML is bad since it ends abruptly. So the exception makes sense. The question is why the CCU only receives the first 8192 bytes. I also traced the other end, and the data that gets sent as a response is not truncated. This leads me to believe, that on the CCU there seems to be some buffer-limitation for incoming data. |
@jens-maus hi man - should I support you in writing a bug report to the upstream project? Do you have any contact details or do you want to do it by your own? Do you need maybe any further information? |
@n0l0cale Nope. here is the correct place for this kind of bug report on HmIPServer because eq3 ist more or less listening/reading here when I point them at this ticket (will do). So thanks for the infos here. As soon as I had time to reproduce it I will flag it as reproduced and then its' eq3 task to investigate+fix. |
@danielperna84 I finally tried to reproduce the issue using your
I was able to reproduce these error outputs in
Please note that the BidCos-RF service on Port 2001 is not provided by HmIPServer but the
This I could not reproduce here. In fact, even after the second init() I perfectly receive events, at least for the virtual devices I could still trigger in the WebUI.
Can you please provide example output of your script showing the exact payload of the error? Would really help if one can see that after the second init() no events are received anymore. As said, I can perfectly use the WebUI here and do a
I fully agree with you that it should be perfectly able to directly provide a device list in the listDevices() answer and the XMLRPC service of HmIPServer should then just diff the provided devices and just call newDevices() with the devices missing. However, please note that the XMLRPC Service in HmIPServer is unfortunately quite legacy and has some shortcomings/bugs. But I will try to get eQ3 informed and see that this issue will be resolved. As a workaround (until the issue is fixed), I would suggest that you change the initialization in home assistent that no device list is provided in the listDevices() execution for the HmIP service query and that you do the diffing (old vs new devices) on your own. AFAIK ioBroker and other third-party services are doing the same and do not rely on the XMLRPC service for doing the listDevices() based diffing as one would expect. See here, for example: https://github.com/ioBroker/ioBroker.hm-rpc/blob/master/hm-rpc.js#L1013 There, ioBroker.hm-rpc is doing the same for the HmIP service and I think for the exact same reason.
Nope, the format should be perfectly fine as you provided it, at least AFAICS.
Thanks for that one. This indeed looks like there is a buffer limiting factor here that could be one of the main reasons why using listDevices() with the HmIPServer XMLRPC service is not working correctly ATM. I will forward these observations to my eQ3 contacts and hope they will fix it in the next release. |
I have to correct myself. I have mixed up different scenarios in my head while doing all this. The initial problem how all this got started was, that when the CCU gets rebooted (and thus requires a new init before it starts sending events), we use an automation to reconnect (in the backgorund it's a re-init to be precise, but reconnect sounds more straightforward for users) once the CCU is back up again. I agree, that following your proposal of just returning an empty array would be a temporary fix. But it would come with some great drawbacks caused by the current architecture of the code. Significant changes would need to be made just to work around the bug. So if there is a chance of this being fixed by eq3, I would favor not to take the chance to introduce bugs or other problems in our code. Waiting a bit seems like the better solution in this case. After all, this bug has been present for so long, that a few more weeks / months won't really matter in my opinion. 😉 |
@danielperna84 I just received notification that the above mentiond issue in HmIPServer should be fixed in the next upcoming CCU/OCCU firmware release. The root cause of the issue have been, however, that the internal xmlrpc methods couldn't work well with empty xml tags and caused the above mentioned java exceptions. Thus, a xmlrpc method response like the following one already triggered the issue when sent to HmIPServer: <?xml version="1.0" ?><methodResponse><params><param><value><string></string></value></param></params></methodResponse> Please note the empty |
Ok, so this essentially is the same as #489. Thanks for your help. 👍 |
This issue should be fixed since a few versions successfully. Please retry and reopen if still problematic. |
Hi all, I've been testing this with every version - latest 3.55.10.20210213 included - and this issue seems not to be fixed. Can someone else confirm this? n0l0cale |
Looks like I just got hit by this. I had one way connection to homematic devices, but both ip and classic where I could set states but would not get any status back. As usual when strange things happen I tried to restart. First the raspberrymatic (3.57.5.20210525) Then HA. Now everything is back to bidirectional communication. In the homematic alarm messages I could see a warning about a lost internet connection. After all this I started looking and found this issue. So I guess it should be reopened?! |
Describe the bug
RaspberryMatic seems not accept new connections, as long as the old one have not been terminated.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A reconnect should be successful.
System information (please complete the following information):
Additional context
This issue has also been discussed in https://community.home-assistant.io/t/homematic-reconnect-does-not-work/161853/18
The text was updated successfully, but these errors were encountered: