Page 1 of 1

Housebot Server startup

Posted: Fri Mar 24, 2006 4:48 pm
by mwc
Is it possible to have HB Server open up at startup in the background?

I'd like HB Software Remote to be only application that user sees (but I'm assuming that HB Server needs to run for remote to work?)

Posted: Fri Mar 24, 2006 5:06 pm
by TakeFlight
Maybe you could run HB from a batch file using the START command with the minimize switch. Assuming I understand what you are asking. Maybe somebody else will chime in.



But ultimately I'd like to see HB run as a service with a separate GUI interface. That way, if you have an error that crashes the GUI the service would still be running. I love HB, but I never liked the idea of doing configuration in the interface that is also the server itself. Granted, this isn't mission critical stuff, it's just home automation. But, it would be so much better to seperate the configuration GUI from the actual core server.

Posted: Fri Mar 24, 2006 7:03 pm
by Richard Naninck
Put the script below in a batch file called something.bat and put that or a shortcut to it in your startup folder. This will start the server at PC bootup and restart the server if it crashes. Also make sure to disable all windows error reportings. Do that from the "My Computer" properties and go to advanced. You will find it there.

You could also put a shortcut to your SWRemote in the startup folder. It will try to connect to the server and when the server is up, the SWRemote will start. That is how I set it up and it works fine!









Echo off

:Start

Echo Server has Started At: %Date% %Time%

"C:\Program Files\Meedio\Meedio HouseBot\HouseBotServer.exe"

Echo Server has Terminated At: %Date% %Time%

goto Start

Posted: Fri Mar 24, 2006 10:37 pm
by TakeFlight
I assume this was in response to my post (although, I didn't intend to hijack this message thread... sorry to the original poster). I'm actually using a batch file to launch HB (per a post from a while back by ScottBot). I also have the batch file making a backup of the HB config file. So, if HB crashes or if you manually close it, the config file gets backed up with the current date and time appended to the file name and then HB starts back up again. It's just a way to have several backup copies to fall back on in case I really screw something up. :)



It's actually a combination of two batch files that I'm using to accomplish this. The first batch file is the main batch file that reloads HB every time it closes (or crashes). This batch calls the other batch file which does the backup of the config file (I found this batch file by doing a google search and made some small modifications). Here's the main batch file (the c:\hbscript directory is a directory where I keep batch files, vbscripts, etc)...



starthb.bat

--------------------



@Echo off

:Start

c:

cd\hbscript

call datename.bat "C:\Program Files\Meedio\Meedio HouseBot\Config\HBData.mdb"

Echo Server has Started At: %Date% %Time%

start /ABOVENORMAL /WAIT C:\Progra~1\Meedio\Meedio~1\HouseBotServer.exe

Echo Server has Terminated At: %Date% %Time%

goto Start





Here's the batch file that copies the HB config file with the date and time appended...



dataname.bat

--------------------



@Echo OFF

TITLE DateName

REM DateName.CMD

REM takes a filename as %1 and copies it to %1_YYMMDDHHMM

REM

REM -------------------------------------------------------------

IF %1.==. GoTo USAGE

Set CURRDATE=%TEMP%\CURRDATE.TMP

Set CURRTIME=%TEMP%\CURRTIME.TMP



DATE /T > %CURRDATE%

TIME /T > %CURRTIME%



Set PARSEARG="eol=; tokens=1,2,3,4* delims=/, "

For /F %PARSEARG% %%i in (%CURRDATE%) Do SET YYYYMMDD=%%l%%k%%j



Set PARSEARG="eol=; tokens=1,2,3* delims=:, "

For /F %PARSEARG% %%i in (%CURRTIME%) Do Set HHMM=%%i%%j%%k



Echo COPY %1 %1_%YYYYMMDD%%HHMM%

COPY %1 %1_%YYYYMMDD%%HHMM%

GoTo END



:USAGE

Echo Usage: DateName filename

Echo Copies filename to filename_YYYYMMDDHHMM

GoTo END



:END

REM

TITLE Command Prompt

Posted: Mon Mar 27, 2006 6:29 am
by talisman
Or to make it really easy why dont you just drop the shorcut into the Start Up directory within Program files.



then it will boot up everytime you re boot your system. :lol:

Posted: Mon Mar 27, 2006 1:32 pm
by TakeFlight
Yes, the startup folder is the easiest way to make sure the program starts everytime your reboot the computer. But, to make sure that HB restarts if it crashes, you need to use a batch file like the examples given in this thread. I have a shortcut to my batch file in the Startup folder.