openLuup Hangs
-
I came to the same potential solution but was wondering if these timeouts could be set somewhere in the openLuup code. Not knowing which function is actually sending the user_data in response to the Homewave call, I did not know where to attempt inserting these timeouts... in the server.lua file maybe?
-
Sorry for reviving this @akbooer but I wanted to give a quick update on lua socket.
I realized that the library used by luarocks is very old (3.0 RC1 from 2013) and that the apt debian/ubuntu version is a little newer (March 2015). The library has since gone through 5 years of development and I just installed the latest github version using this command:luarocks install luasocket --server https://luarocks.org/dev
It compiles the library from the current GitHub master. I am not sure it will help but so far it has not hurt. Will test further...
-
Well first problem after updating the lua socket:
.
I had some lua code sending an url with spaces which I did not have to url encode. Now I have to. luckily it is pretty straightforward to do with "url.escape(content)":
On the other hand... somehow I feel that the response is a lot faster... I may be dreaming and will need to test this more but homewave seems to have no lag on polling. I don't remember seeing this before.
-
Update: I can't seem to reproduce the problem anymore in spite of trying hard even in manners which would frequently create this problem before so I think the luasocket update is potentially a fix for these openluup lockups (really lua socket lockup to be accurate).
Edit: Nope... I really can't reproduce the lock up anymore. I tried at least 20x the same scenario which would cause a lockup every 3rd time: Opening Homewave on my iPhone and have it poll openLuup while the phone is in the middle of switching between VPN through LTE and wifi. Granted I don't know whether it is because the poll completes much faster or if it is that lua no longer locks up. This may really be fixed. Can anybody else who has run into this problem confirm?
-
@akbooer, I am now fairly positive that the updated luasocket fixes the lockups. Been running for two days with full intent to lock it up trying all kinds to interruptions and I haven't been able to get it to hang. Maybe it could be part of the installation recommendations?
-
Excellent!
Have you checked that async HTTP is, in particular, OK?
I ask, because it delves deep into the LuaSocket library, so it’s not unlikely that something changed.
Does the update instruction you gave above work on a RPi? I need to give this a go!
I’ll be pleased to confirm that it’s not due to any openLuup-specific code!
-
Yes it works very well with the async http calls as well as I have a lot of my code making use of it.
The update method works, it asks luarocks to pull from the dev repo and should build and install version "scm2". It should be platform agnostic. (the command actually rebuilds the library).
The only thing I had to do is the url encode for spaces which makes use of the http_async module for which I had to change the url input by encoding the space in the url(%20).
-
Hi AK, please let me know if you have a version that works with the new lua socket. I have an other websocket problem and would be nice to see if this helps.
Cheers Rene
-
Did the update openLuup still works. Did not help for my websocket issue though. If openLuup starts it connects just fine, but if connection is lost and I close and reconnect no data is received. Need to dig some more.
-
I'm using the websocket module rigpapa created (with some fixes) https://github.com/reneboer/LuWS/blob/master/luws.lua to talk to the new Ezlo ws API. This is part of the EzloBridge i am making based on your VeraBridge as we spoke about. Just put that on GitHub https://github.com/reneboer/EzloBridge.
It is working except when the websocket gets interrupted. Also needs some better error handling etc.
-
Maybe a problem with the web socket itself? What is the source of the interruption?
As I said above, I have been desperately trying to reproduce my old problem with interrupting either the io connection or an http request response which used to make openluup or rather luasocket hang and I have no longer able to do so with the updated luasocket version. -