Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

OpenNetHomeServer

Questions and comments specific to a particular plugin should go here.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Same here...cannot understand why ONH goes banana like that
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

I now see the message above. Does that mean that ONH has had a "doomsday timer"? :mrgreen: "On the 25. of July, break the world!"
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

I think ONH has some kind of problem related to open/closing port connections (I have reported this earlier to Stefan but he could not find any reason, see here http://forum.opennethome.org/viewtopic. ... &t=66#p465 )

I have made some small adjustments to handling port connections with ONH and running it here to see if it helps. As soon I think it runs stable you will get it
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Cool, thanks! Wonder if Stefan's playing a joke on me, I might have said that I'm moving this summer... :mrgreen: :lol: Sort of hazing of the new guy...
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

I dont know, I dont think so,

Just one thing: you say
I send every event (oven on/off, amp on/off) both through the RFXtrx and the Tellstick
This means you are also sending with the plugin actions? So far I have only looked at the receiving end of the plugin, I don't know if we have a similar problem here. We I am suspicious is because we are making a separate connection for each send command and this is what I understand *consuming* one port in ONH

There is something with this in ONH that is strange
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Well, I have been sending dual commands for a month or so for the ovens and two weeks for the amps. The code looks like this for turning off a heater (I translated the comments right now, on the fly):

Code: Select all

            #Turn off heater with Tellstick
            eval("eg.plugins.NetHomeServer.SendCommand(u'Ovn "+str(Rom)+"', u'', u'off', 8020)")

            eg.plugins.EventGhost.Wait(0.5)
            
            #Find out from the zone number if it's upstairs or downstairs and turn off with the RFXtrx.
            if 1 <= int(Rom)<=11:
                eval(("eg.plugins.RFXtrx.send_AC(u'4', u'AC', u'008d303a', u'")+str(Rom)+("', u'off', u'0', None)"))
            if 12 <= int(Rom)<=18:
                eval(("eg.plugins.RFXtrx.send_AC(u'4', u'AC', u'008d303b', u'")+str(int(Rom)-11)+("', u'off', u'0', None)"))
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Thats fine, I was just thinking about it too

You can try the attached version, it has been working for me now for a while. We need to nail this shit

BR
Attachments
__init__.py
(83.12 KiB) Downloaded 75 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Will do, sir! Thanks! The one I'm running now (your previous version) has been behaving for almost three hours now, which is a good step forward. :mrgreen: Oh, btw, I do believe that if you nail shit, the result will be less than satisfactory... :lol: In Norway they say that trying to debate with a certain politician is like trying to nail jello to the wall! :mrgreen:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

:D
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

To quote sir Elton John: The bitch is back. :cry: Everything was running smoothly until around 1.30, when the first reset of the plugin and restart of NHS came (self healing). About once an hour until a bit after 6, and then 11 of them until around 7.30. And the ONH log is full of the "tcp stream is blocked" entries. I wonder if setting a lower port would help, maybe it's using ports from 8005 and up, not just 8005 and then hit an internal ceiling? I believe the actual ceiling is 65535, though.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

I wonder what's happening here. Check out the log:

Code: Select all

07:52:52   Tellstick.FineOffset|1037 'Temp|21.6'
07:52:57   RFXtrx.Type: Viking 02811 id: 60672 ' temperature: +21.7 deg C signal: 5 battery: 9'
07:52:57            WC.: Temperatur: 21.7, termostattemperatur: Av, tidspunkt: Kl. 07:52, den 29.07.
07:52:57            
07:52:59   RFXtrx.Type: Viking 02811 id: 6144 ' temperature: +7.5 deg C signal: 5 battery: 9'
07:53:00            Kj├©lerom.: Temperatur: 7.5, termostattemperatur: Av, tidspunkt: Kl. 07:52, den 29.07.
07:53:00            
07:53:00   OpenNetHome.Connection with NetHomeServer lost
07:53:06            Thread is terminating:  loggerThread
07:53:06            Exception in thread Thread-8619:
07:53:06            Traceback (most recent call last):
07:53:06              File "threading.pyc", line 532, in __bootstrap_inner
07:53:06              File "threading.pyc", line 484, in run
07:53:06              File "C:\Program Files (x86)\EventGhost\plugins\NetHomeServer\__init__.py", line 1393, in main
07:53:06                self.skt.sendall("quit\r\n")
07:53:06              File "<string>", line 1, in sendall
07:53:06            error: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
07:53:06            
07:53:06            Keep Alive thread ended
07:53:10            Cleaning up monitoring tasks...
07:53:10            Plugin successfully stopped
07:53:14            Plugin started
07:53:14            connecting to host
07:53:14            Keep Alive thread started
It says the connection is lost 8 seconds after the previous signal was received. Weird, since I have a 120 second timeout. I have stopped the self-healing system again, and I'll let it run for a while and see if it stops receiving or sending, or if that OpenNetHome.Connection with NetHomeServer lost is a false alarm.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

And that didn't take long! There are false warning messages coming in here. Fine Offset (Viking) sensor at 08.03.45, and then "08:04:04 OpenNetHome.Connection with NetHomeServer lost "

Code: Select all

08:03:45   Tellstick.FineOffset|1253 'Temp|22.0'
08:03:46   RFXtrx.Type: Viking 02811 id: 62976 ' temperature: -17.5 deg C signal: 4 battery: 9'
08:03:46            Fryser.: Temperatur: -17.5, termostattemperatur: Av, tidspunkt: Kl. 08:03, den 29.07.
08:03:46            
08:03:47   RFXtrx.Type: Viking 02811 id: 43776 ' temperature: +21.1 deg C signal: 5 battery: 9'
08:03:47            Midtsoverom.: Temperatur: 21.1, termostattemperatur: Av, tidspunkt: Kl. 08:03, den 29.07.
08:03:47            
08:03:52   RFXtrx.Type: Viking 02811 id: 6400 ' temperature: +20.8 deg C signal: 5 battery: 9'
08:03:52            Hj├©rnesoverom.: Temperatur: 20.8, termostattemperatur: Av, tidspunkt: Kl. 08:03, den 29.07.
08:03:52            
08:03:52   Tellstick.NexaL.Address|9252922|NexaL.Button|6|NexaL.Command|0|
08:03:52   RFXtrx.Type: AC address: 008d303a unit: 06 command: off ' level: 0 signal: 6'
08:03:53   RFXtrx.Type: Viking 02811 id: 2048 ' temperature: +21.1 deg C signal: 5 battery: 9'
08:03:53            Innerstue.: Temperatur: 21.1, termostattemperatur: Av, tidspunkt: Kl. 08:03, den 29.07.
08:03:53            
08:03:59   OpenNetHome.'Lost contact with sensor: FineOffset|1185'
08:03:59   RFXtrx.Type: Viking 02811 id: 60160 ' temperature: +15.2 deg C signal: 4 battery: 9'
08:03:59            Ute.: Temperatur: 15.2, termostattemperatur: Av, tidspunkt: Kl. 08:03, den 29.07.
08:03:59            
08:04:04   OpenNetHome.Connection with NetHomeServer lost
08:04:04   RFXtrx.Type: Viking 02811 id: 3328 ' temperature: +21.6 deg C signal: 5 battery: 9'
08:04:04            Soveromsgang.: Temperatur: 21.6, termostattemperatur: Av, tidspunkt: Kl. 08:04, den 29.07.
08:04:04            
08:04:04   Tellstick.FineOffset|1037 'Temp|21.6'
08:04:09   RFXtrx.Type: Viking 02811 id: 60672 ' temperature: +21.6 deg C signal: 5 battery: 9'
08:04:09            WC.: Temperatur: 21.6, termostattemperatur: Av, tidspunkt: Kl. 08:04, den 29.07.
08:04:09            
08:04:11   RFXtrx.Type: Viking 02811 id: 6144 ' temperature: +7.2 deg C signal: 5 battery: 9'
08:04:12            Kj├©lerom.: Temperatur: 7.2, termostattemperatur: Av, tidspunkt: Kl. 08:04, den 29.07.
08:04:12            
08:04:12   RFXtrx.Type: Viking 02811 id: 28416 ' temperature: +20.2 deg C signal: 5 battery: 9'
08:04:12            Kjellerkontor.: Temperatur: 20.2, termostattemperatur: Av, tidspunkt: Kl. 08:04, den 29.07.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

I wonder if setting a lower port would help
That is not a solution, it shows that there is a problem inside of ONH that needs to be solved. ONH should release and reuse ports itself. I have a feeling that it is possible to cause this problem by disconnecting/connecting a network cable to the ONH (if it runs in a separate machine). I will try to crash it this way and if successful -> report to Stefan (I guess he needs a method to reproduce the error). Another idea is to write a Python script that just does connects/disconnects and then see how long ONH survives. From my perspective, a solid written software should survive forever...
"tcp stream is blocked"
When ONH has reached this stage, there will be more frequent reconnect attempts because they will all fail. It feels like the ONH at this stage gets saturated on available ports and there is no chance to get any connection without restarting ONH it seems
There are false warning messages coming in here
This could be because I think in your version there is a hard-coded 60 sec time out for this. I have now changed that so it is using the socket time out value as well

Anyway, I have been running the same version as you the whole night without problems, no restarts. I have this morning made some more improvements in the attached version you can try instead (keep a copy of the one you use now)
Attachments
__init__.py
(83.45 KiB) Downloaded 70 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

OK, I'll try that, thanks! Since I dropped self healing, it has kept on ticking. But that's to be expected, it seems like it takes a few hours before something happens after a full restart of ONH and EG. And do you really think those hardcoded 60 seconds is the answer here? Because as you can see there are only seconds between the last logging in EG and the loss of connection message. So isn't it then weird that it complains the connection was lost one minute ago? For my part at least an error message that doesn't look at the sockets, but at how long it's been since the last logging would be much to prefer. Is that a big problem to implement?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

For my part at least an error message that doesn't look at the sockets, but at how long it's been since the last logging would be much to prefer. Is that a big problem to implement?
Actually, this is what I have added in this version. But I kept the socket error monitoring as well. Maybe I shall remove that part?
Post Reply