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.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

More info: It seems after the reset of the plugin and restart of ONH it asks to unsubscribe and terminate.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Nope. But it may be the self healing. First I disable the plug-in. Then I kill the ONH process, wait five seconds, restarts the service, wait five seconds and enables the plug-in again. is it possible that there is something funky happening there? I do not disable and enable Tellstick instance, I think that's kept in memory anyway, right?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Do you think this is enough time between?

When you are disabling the plugin, you have to wait for the threads to terminate before you enable it again and this can take some time. Try manually and check. The message you say is typical when the main thread has terminated:
20:43:34 ('Request to Unsubscribe: Main-Thread is terminating: ', <threading._Event object at 0x0514E3F0>)
When everything is properly terminated you get this printed:
20:45:17 Plugin successfully stopped
Maybe you need this as event? I would not begin to stop/start ONH and then enabling the plugin again before I know it was correctly stopped
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

This version creates an event when the plugin is fully stopped
Attachments
__init__.py
(84.05 KiB) Downloaded 165 times
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

I hope you could also do some other work, not only trying to fix this issue?

Anyway, I have tested a bit with the connection stability to ONH and I think I am able to reproduce the error when ONH goes into the TCP blocked state.

1) EG and ONH is connected and communicating fine, events are coming in
2) I remove the network cable to ONH (I have this possibility since it is running in a separate RPi)
3) EG is alerting connection error and starts looping re-connection attempts
4) Connecting the cable again. Connection is succesful and now waiting for events
5) Sometimes it works, sometimes not. If not, I check the ONH log and I find that TCP is blocked

This attached version is having some further improvements, it works fine here so please use this one (and keep a copy of your current one)
Attachments
__init__.py
(82.34 KiB) Downloaded 156 times
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Since you have your own monitoring on top, I think with the latest EG plugin version in previous post it should be enough just to restart ONH if events are still not coming in if you have a connection established.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

it should be enough just to restart ONH if events are still not coming in if you have a connection established
An example of a self-healing could look like this:
Skärmklipp.JPG
The action that is restarting ONH depends and can be made in different ways. I understood you already have a solution for this running ONH in the same machine under Windows.
I did it with a message sent via MQTT to do it from remote, the actual command that is restarting ONH (under Linux) is

Code: Select all

sudo /etc/init.d/nethome restart
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Thanks a lot, Walter! Sorry I didn't answer yesterday, I drove around 500 kilometers and filled and emptied a large trailer and the car twice! :cry: But now I'm only 25 hours and 18 minutes from being done with that house! Oh, and I'm now pretty sure that it's the signal that's sendt to the heaters (so one the each zone every five minutes, in other words around 15 every five minutes) that chokes up ONH. I commented out those sends mid day yesterday and haven't had one loss of contact since that. I will implement the latest version now, with the self healing, and then I'll hope that it works when I give the keys to the buyer tomorrow. But it would be nice to have the sends of the heaters working as they should before the heater season comes around in a few months. :mrgreen:

I see that the "done" are still coming in. Is that something that could be commented out, since it creates a lot of lines in the log?

Edit: Btw, do you know the command to restart ONH nicely in Windows? I could probably find it if I looked hard, but right now my brain is potato mash...

Oh, sorry, didn't see that question: Yeah, I do get to do other stuff. But they are a lot more physically demanding... :lol:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Hi,
No problems, here is a version that doesn't print 'done' any longer (it has been working here without a glitch,)

Regarding restarting, I do not know exactly but didn't you have a solution already for killing & starting ONH?

Otherwise it was discussed here

http://forum.opennethome.org/viewtopic. ... start#p297
Attachments
__init__.py
(82.39 KiB) Downloaded 103 times
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Roger, Oveur, Roger, Dunne. :lol: Thanks, the done are gone. As for the solution I have is rather dirty. It kills the process and then starts ONH again. I don't know if that can create problems, like if ONH is in the middle of saving the XML-file, or something. I remeber that discussion, but it didn't help much for Windows. On the other hand I have not seen any problems from killing the process yet, so it may be a perfectly good way of doing it. :mrgreen:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Great work! And good luck with the final session of the move. As you mentioned, if you keep the possibility to do remote admin for a while, glitches can be fixed if they should appear

My opinion is that there is some stability issue with ONH that can block the TCP. Something for Stefan to work on. I don't know if also commands (EG -> ONH) are blocked when this happens or if it is only affecting events (EG <- ONH). Anyway it is strange that it is possible to get a connection and subscribe but nothing happens. Clearly an issue.

Killing a process is always not the best but if you had no bad experience, let's hope it stays that way. Hopefully a command via REST interface or other would be a good thing to have.


Have a nice Sunday evening
Walter
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

Well, I can tell you that it works with the EggTimer! :mrgreen: I had my first instance of the problem just now (probably because I have been restarting the server quite a lot to remove my personal stuff, and then it didn't run long enough to develop), and the restart worked flawlessly. But I can tell you (actually I think I already did) that sending from EG to ONH works, since I can see the commands that ONH sends as events in RFXtrx. And thanks, I am getting a certain control over it now, if I can keep me and my wife together just 15 more hours...

Oh, sorry. Need to amend the post: :twisted: :twisted: :twisted: :twisted: (This was my post number 666!)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

Hi Mastiff, I was just curious how things have worked, if you have seen any problems yet or if everything is ok?

Regarding the healing solution with the egg timer, I think a small modification could be made if you want the healing to repeat itself if it fails to "repair" ONH. See picture below. I just copied the 'Start egg timer' action and pasted it in after the actual ONH restart action. In this way the healing will go on "forever" or until ONH is functioning again.

Also, if you are interested, I have re-written the plugin into a simpler solution. You could try it out in your own system if you like as it should produce the fully compatible events as the other one (maybe some events may differs but then only to the naming. It is possible to run it in parallel to the existing one so you can verify that it gives the same result. From functionality point of view there is really nothing new but it is a bit optimized inside and is simpler to configure. And you can have multiple of those in the same EG if you should have several ONH installations.

So far no responses from Stefan so I think he might be on vacation.

Best regards, Walter
Skärmklipp.JPG
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OpenNetHomeServer

Post by Mastiff »

And I hoped I would be standing with 666 post for a while... :lol: Well, I had to turn off the 10+ NHS actions every five minutes, I did not get that to work as it should. It made NHS overflow after a while. But without that it runs as it should. I wish my new home was running as it should... But we're to busy stumdling over boxes and stuff everywhere to get it fully functional! :mrgreen:

And thanks, but I think I'll pass on any changes at all in the old house for a few weeks. The buyer is satisfied because everything's running smoothy (without the NHS actions), but when I get the new server up and running here (which should be some time early next week, I hope...) I will start using them here and see if I can get them working. And then we'll see what Stefan says when he's back.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: OpenNetHomeServer

Post by krambriw »

But we're to busy stumdling over boxes and stuff everywhere to get it fully functional! :mrgreen:
Of course, it is a lot,
The buyer is satisfied because everything's running smoothy
Good to hear!
I will start using them here and see if I can get them working. And then we'll see what Stefan says when he's back.
No stress, in the mean time I have a test here running 24/7, so far it just works collecting events and with a command that is sent out once every 15 minute
Post Reply