Housebot Server startup

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
mwc
Member
Posts: 1
Joined: Fri Mar 24, 2006 4:46 pm

Housebot Server startup

Post 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?)
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post 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.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post 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
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post 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
talisman
Senior Member
Posts: 119
Joined: Sat Jun 19, 2004 2:30 pm
Location: UK

Post 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:
Childe Roland to the Dark Tower Came
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post 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.
Post Reply