HouseBot Web Server

HouseBot Plugin Development Discussions.
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Re: HouseBot Web Server

Post by PT »

Jacco
In response to your comment below are you parsing web pages to it as well?




Well, I have the webserver now running for a few days and it is still running fine, I don't have any problems with dll's or password.
Housebot is running on WindowsHomeServer

To let you kow
.
Regards

PT

If it isn't broke,fix it till it is!
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: HouseBot Web Server

Post by jacco van der Ven »

Yes, I have build an html page called index.htm and that is working.
I will try to make an port forwarding so you can see it.

Jacco
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Re: HouseBot Web Server

Post by Timoh »

The three tries and then blank is just the max number of tries before the web server decides it's not letting you in. It will just return a blank page instead of an access denied message. The behaviour varies from browser to browser. In IE it's 3 tries and then nothing, in Firefox, it seems to be a many tries as you want. It does mean though that you are entering a bed username/pwd combination. The authentication on the webserver I'm using is not the best, so it's not throwing an error telling you so.

Here's some details on how passwords username work.
The web server must be running.
Entering a username while the password property is blank, will delete the user! It will *NOT* set the password to blank.
Entering a password while the username is blank, will *NOT* create a blank user with the specified password.
Changing or entering a username while the password is set, will create a new user with that password.
If you change the authentication domain, you will need to create a new user/password for the new authentication domain.

You can see what users & authentication domains are valid by looking in the global_passwords.txt file. Likewise, you can edit user names or delete users by editting this file. You can reset all users by emptying the file, not deleting it.

I'll eventually be cleaning up the user & password functionality to be more intuitive.

Tim
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Re: HouseBot Web Server

Post by Timoh »

As for the dll issue, I believe I have solved it by including the required libraries in the hbWebServer dll.

The dll is now almost 300k though, as opposed to ~80k. I should have the next "tester" out by the end of the weekend.

Tim
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Re: HouseBot Web Server

Post by PT »

Thanks for the reply Tim

The reason I am keen to have this bit working is really driven by what you are up to next. Because that seems very promising

Update

Ok all seems to be working fine now. The password global file was not producing the domain. So I cleared all the settings and started again with your post above in mind and bingo the index for the file folder was listed. :D
It would seem the sequence is quite touchy..just like the wife I guess :D
The previous asp pages are no longer any good so anyone feel like giving me some idea of the java script for html page for logging onto the external com object and getting a status of something.
Regards

PT

If it isn't broke,fix it till it is!
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Re: HouseBot Web Server

Post by Timoh »

You don't strictly need javascript pages to connect to the external hb control. If you follow the instructions for installing the external control + installing it as CGI interpreter for the hbWebServer, it will work. There is an html sample page when you install the hb external control you can use as an exmaple. You could derive your pages from that.

To make your pages more dynamic, you could use js to submit the request to the webserver running the HB CGI and process what it returns for display on your page. But, to give you an idea of what's to come, the HB js client will use an xml protocol for moving data to and from HB. Thus eliminating the need for the CGI interpreter or external control. It will also allow for getting/setting multiple properties at once.

I'll provide details of the protocol when all done with the project. But unless you plan on doing "mash-ups" of HB data and internet data in your browser, you'd be better just defining a theme specifically for your browser, and not having to write any of your own pages. Think of the theme designer in HB as a html editor just for HB.

tim
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Re: HouseBot Web Server

Post by Timoh »

Hi folks,
An update ready for testing.
This dll should include/embed all the other "missing" libraries for Visual Studio 2010. In other words, you should be able to drag and drop the dll to the devices folder without having to move any other files. As a result the dll is bit bigger, but still reasonable at ~200k.

Also, this version will download the xml for your theme to the browser. If you can test the functionality it would be great. To do so, just add "?theme=" + your theme name to the url. So for example, to test it on my local machine with a theme called Tim, the url would be "http://127.0.0.1:5025/?theme=tim". It should show a bunch of xml in your browser. Scroll down to the end and make sure you see "</ROOT>".

(Edit: Deleted file becuase it is not current)
Tim
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: HouseBot Web Server

Post by jacco van der Ven »

Well, I think I am the first again?
I replaced the dll, and start my browser on an remote pc, it showed the xml, on the end there was </ROOT>

Regards, Jacco
kilowatt
Senior Member
Posts: 152
Joined: Thu Jan 08, 2004 5:45 pm
Location: Westford, MA

Re: HouseBot Web Server

Post by kilowatt »

Installs fine now on my XP machine. No changes were made to accommodate the previous version.

I get the proper XML using firefox. Internet Explorer 8 receives something but what it displays is unreadable.

Mark

Edit: I selected "view source" on explorer and the XML received is correct there also.
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Re: HouseBot Web Server

Post by Timoh »

That shows how often I use Internet Explorer. :s

As long as the source is correct, we should be good. I suspect IE tries to treat the xml at html, and recognizes some of the tags such as button... So will try to draw a button.

Tim
kilowatt
Senior Member
Posts: 152
Joined: Thu Jan 08, 2004 5:45 pm
Location: Westford, MA

Re: HouseBot Web Server

Post by kilowatt »

Yes, it was drawing a string of little boxes so those might have been buttons. Anyway it is receiving the theme xml fine from your plugin.
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Re: HouseBot Web Server

Post by PT »

Tim

All ok with me . Viewed on ipad (safari) ok and vista machine
Regards

PT

If it isn't broke,fix it till it is!
chrisrey
Member
Posts: 10
Joined: Wed Mar 17, 2010 10:57 am

Re: HouseBot Web Server

Post by chrisrey »

Hi,
first time it crashs my HB sever.
I launch again HB, no error!
I tried with IE8: it displays only a button.
I tried with Chrome and Firefox and for both navigators it displays the XML code.

Hope it helps.

Regards,

chris
edgar
Member
Posts: 95
Joined: Tue Mar 24, 2009 11:14 pm
Location: Springfield, VA

Re: HouseBot Web Server

Post by edgar »

Hi Timoh,

Great job with all you have done so far!

I installed on HB running on Windows 7 x64....no issues.

Server started and works with the following results:
Firefox on local machine: no issues, xml looks fine..

Firefox on remote machine: no issues, xml looks fine

Droid:
Samsung Galaxy Tab with Droid OS and default browser:
Going to IP:5025 directory structure appears.
When I tried to go to IP:5025/?theme=Sample Theme (as i did in above tests) I get the following error:
Data Connectivity Problem
The server failed to communicate. Try again later (from the OS)...i click OK then
The browser shows:
The Web page at http://IP:5025/?theme=Sample%20Theme might be temporarily down or it may have moved permanently to a new web address.

I also tried a theme name that had no spaces..thinking that may be an issue...same results

I am convinced this is a Droid issue.

The above results were identical to on my Droid X phone (connected over wi-fi).

Hope this helps, let me know if you would like me to try anything to help debug.

v/r

Kevin
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Re: HouseBot Web Server

Post by Timoh »

Hi Kevin,
I suspect it's most likely due to very badly formed http response from the webserver. The webserver is not returning any headers at the http response. I only noticed this today. In fact, I'm kind of suprised it works at all on any browser... Technically speaking it's not even communicated back to the browser in an http protocol, it just a bunch of chars spewed out by the server.

The werbserver behaves differently when serving regular pages, dir listings, etc. But when you invoke a HB specific call such as theme=sample theme, I need to handle & code the entire http response/protocol myself.

Next test release will have proper headers which should solve this problem.

Tim
Post Reply