Feature request

Functionality and usage of the OpenNethome Server
Mastiff
Posts: 73
Joined: Tue Feb 24, 2015 7:30 am

Feature request

Post by Mastiff »

Well, I may scare you now, since the previous one turned out to be a lot of work! :mrgreen: Still I take the chance: Would it be possible to add a command to restart the server through the control port TCP interface? As you know I use this for my Tellstick Duo with EventGhost through Walter's plugin, and it would be nice if EventGhost could restart the ONH if something wrong happens. Would that be possible/easy?
Nasty76
Posts: 145
Joined: Tue Dec 09, 2014 1:20 am

Re: Feature request

Post by Nasty76 »

Well I was using scipt which ssh nethome pi and give command which restart nethome
krambriw
Posts: 86
Joined: Sun Jan 04, 2015 8:48 am

Re: Feature request

Post by krambriw »

I have seen that the exec command is available in the TCP Command port, but not tested, since it says it is not supported from remote...

If there are any syntax example on how to restart ONH from outside, I would appreciate...some sample code line
Nasty76
Posts: 145
Joined: Tue Dec 09, 2014 1:20 am

Re: Feature request

Post by Nasty76 »

stefangsbb
Site Admin
Posts: 313
Joined: Sun Nov 30, 2014 2:16 pm

Re: Feature request

Post by stefangsbb »

There is actually an undocumented feature called "upgradeServer" in the settings page (this is the EventBroker-Item). If you call that method, ONH will execute the "UpgradeCommandScript" and then shut down, so if the script waits a while and then starts a new ONH, then it works as a restart function.
It might however be more robust to do a harder restart via the service as suggested.
Mastiff
Posts: 73
Joined: Tue Feb 24, 2015 7:30 am

Re: Feature request

Post by Mastiff »

Nasty76, isn't that for Raspberrys and stuff like that? I don't do anything smaller/more primitive than an Windows Xeon server with virtual machines. :mrgreen:

Stefan, I guess using a restart on the service is the best way, then. Thanks! I'll probably use something that looks like my restart of the openVPN tunnel:

Code: Select all

net stop openvpnservice
PING 1.1.1.168 -n 1 -w 5000 >NUL
PING 1.1.1.168 -n 1 -w 5000 >NUL
net start openvpnservice
But I'm actually not sure how to stop ONH, it doesn't show in the services list. I use this (standard) batchfile to start it:

Code: Select all

cd lib
del swt.jar
del rxtxSerial.dll
copy ..\os\rxtxSerial_32.dll rxtxSerial.dll
start javaw -jar home.jar
What would the correct way to stop it be? So far I've only stopped it by right clicking and choosing stop.
krambriw
Posts: 86
Joined: Sun Jan 04, 2015 8:48 am

Re: Feature request

Post by krambriw »

To use under Windows, you need to run ONH as a service. I did configure this a couple of years ago with a java service wrapper
http://wrapper.tanukisoftware.com/doc/e ... ml#service
but I do not exactly remember how the syntax looked like...


Or maybe this one is a better option:

http://sourceforge.net/projects/yajsw/
Mastiff
Posts: 73
Joined: Tue Feb 24, 2015 7:30 am

Re: Feature request

Post by Mastiff »

Thanks! I'll have to look at that when I get there. It's a bit more advanced, so I want a full backup of the system first. :mrgreen:
Nasty76
Posts: 145
Joined: Tue Dec 09, 2014 1:20 am

Re: Feature request

Post by Nasty76 »

Hhmmm you can use ssh any machine. That only need ssh server.
Btw what you try do
krambriw
Posts: 86
Joined: Sun Jan 04, 2015 8:48 am

Re: Feature request

Post by krambriw »

Or in Windows, use pskill to kill the javaw.exe process and then run the .bat file again

https://technet.microsoft.com/en-us/sys ... 96683.aspx
Post Reply