Web Interface To X10 Commander

Forum to discuss X10 Commander iPhone/iPod/iPad/Android client for X10 Devices

Re: Web Interface To X10 Commander

Postby Melloware » Wed Dec 22, 2010 1:22 pm

Fantastic! I know it seems intimidating at first but I am glad you stuck with it!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11043
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: Web Interface To X10 Commander

Postby andrejs » Thu Jan 27, 2011 2:27 pm

Hi everyone! I managed to install X10 commander and Apache WEB Server on my Windows XP machine and copy webx10der.html file to httdocs directory of Apache. I also set up the port 8017 in httpd configuration file and port forwarding on the router (DD-WRT). From internet provider I got fixed IP.
I normally opened from other machine in local network the webx10der.html file and the screen with buttons was shown. I was able to switch on/off my devices and lights without any problems. I also tried the same thing with my iphone (of course with Safari) connected to local network through wifi and again everything works perfectly.
The problem come out when Iphone was connected on 3G network. The screen of webx10der.html file appeared normally and I was able to click on the buttons for on/off but the device/light did not switch on or off. I tried with excluded firewall on Windows XP machine but without luck. What should be wrong here?
andrejs
 
Posts: 5
Joined: Thu Jan 27, 2011 2:07 pm

Re: Web Interface To X10 Commander

Postby Melloware » Thu Jan 27, 2011 2:34 pm

If it is not working from your 3G it means Port 8086 is not exposed externally so while your Web page shows up. Inside that HTML it is sending commands to X10 Commander on Port 8086 which is the HTTP port that X10 Commander listens for singals. When you are on your 3G those commands are not getting through 8086.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11043
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: Web Interface To X10 Commander

Postby andrejs » Thu Jan 27, 2011 2:54 pm

Melloware wrote:If it is not working from your 3G it means Port 8086 is not exposed externally so while your Web page shows up. Inside that HTML it is sending commands to X10 Commander on Port 8086 which is the HTTP port that X10 Commander listens for singals. When you are on your 3G those commands are not getting through 8086.


Thank you very much for a very quick reply. So if I understand you correctly the port 8086 is blocked on my router? What should I do to enable the commands will go through port 8086 to X10 commander?
andrejs
 
Posts: 5
Joined: Thu Jan 27, 2011 2:07 pm

Re: Web Interface To X10 Commander

Postby Melloware » Thu Jan 27, 2011 3:02 pm

So just like you opened a port on your router so you could get to the web10.html page (proabbly port 80) you need to also open port 8086 in your router.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11043
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: Web Interface To X10 Commander

Postby andrejs » Thu Jan 27, 2011 5:24 pm

I added the port forwarding also for 8086 but I am still not able to control X10 devices over 3G network. :cry: Any other thoughts?
andrejs
 
Posts: 5
Joined: Thu Jan 27, 2011 2:07 pm

Re: Web Interface To X10 Commander

Postby Rocket J Squirrel » Thu Jan 27, 2011 8:06 pm

What is the variable server set to in your WebX10der.html file? It needs to be set to the external IP address or host name of your router, port forwarded to the machine running Apache.

EDIT:

This was wrong. See below. Sorry for my mistake.
Last edited by Rocket J Squirrel on Fri Jan 28, 2011 12:17 pm, edited 1 time in total.
User avatar
Rocket J Squirrel
 
Posts: 76
Joined: Wed Jan 06, 2010 3:39 pm
Location: California, USA

Re: Web Interface To X10 Commander

Postby andrejs » Fri Jan 28, 2011 5:51 am

Thank you for the useful tip. I changed server variable to external fixed IP with the port 8086 (XX.XXX.XX.XXX:8086) and not with the port set up in the apache server configuration file (port 8017) because this solution did not give postive results. With the mentioned change I was able to switch on/off the X10 devices outside my local network through web (using PC) only with Mozilla Firefox. I also tried with Internet Explorer 7 but after I clicked on the button I got the error messsage Error: Invalid argument. The same issue come out on the Iphone using Safari where error messsage displayed was the following:
http://XX.XXX.XX.XXX (my external fixed IP)
Error: Network_err
XMLHttpRequest Execption 101
Any ideas why the error messages appear?
andrejs
 
Posts: 5
Joined: Thu Jan 27, 2011 2:07 pm

Re: Web Interface To X10 Commander

Postby Rocket J Squirrel » Fri Jan 28, 2011 10:43 am

I may have given you bad info in my previous post. It's been a while since I looked at this code. I think your partial success has more to do with forwarding the correct port.

The Apache server and the X10 Commander server are on the same machine, right? The internal LAN address of the machine should work, and might make the 101 exception go away. Try that.

The 101 exception is a catch-all network error, so there's not a lot of information there.

Did you mean you have the port number in the line

var server = "XX.XXX.XX.XXX:8086";

That won't work. Remove the :8086. The port number is supplied elsewhere in the code.
User avatar
Rocket J Squirrel
 
Posts: 76
Joined: Wed Jan 06, 2010 3:39 pm
Location: California, USA

Re: Web Interface To X10 Commander

Postby andrejs » Fri Jan 28, 2011 11:00 am

Thanks for the solution! Now works like a charm. :D
andrejs
 
Posts: 5
Joined: Thu Jan 27, 2011 2:07 pm

Re: Web Interface To X10 Commander

Postby zivodevo » Tue Feb 08, 2011 5:31 am

I've found by adding the following code to the header, the page initially fits to the screen on the iPhone allot better without having to pinch and zoom.

<html>
<head>
<title>Web X10der</title>
<meta name="viewport" content="minimum-scale=1.2" />
<!-- version 2.0a 9/6/2010 -->[/b]

There are many other ways to achieve this as outlined here http://is.gd/LuU2xf, I just found this the quickest to implement based on my very limited knowledge. Works for me! :wink:

Synology DS209
iPhone 4
Ubuntu Server 10.04 LTS running from 2GB CF Card in fanless micro PC
zivodevo
 
Posts: 9
Joined: Mon Feb 07, 2011 5:03 am
Location: Auckland, NZ

Re: Web Interface To X10 Commander

Postby Rocket J Squirrel » Tue Feb 08, 2011 2:46 pm

zivodevo wrote:I've found by adding the following code to the header, the page initially fits to the screen on the iPhone allot better without having to pinch and zoom.
<meta name="viewport" content="minimum-scale=1.2" />

Thanks for the tip! I was unaware of the viewport tag and wondered why Mobile Safari was rendering the page so small. Silly Safari, setting the viewport width to 980 by default.

After playing with this for a while, I think I may have an even better solution. The minimum-scale and initial-scale attributes don't work so well because the width of the page contents will vary depending on each user's devices array, making the optimum scaling content-dependent. In your case, 1.2 works, but for my own rather long device names, I had to use 0.8.

Working from your tip, I think the best way to get the scaling right is
  • use the viewport tag to set the width to the device-width
  • replace embedded spaces in the device names with non-breaking spaces
Then the table full of buttons scales perfectly to the iPhone display because it's constrained by the non-breaking spaces. The trade-off seems to be that setting any scale in the viewport prevents the user from zooming out with a pinch-in, but I think it's a worthwhile trade.

So I've written a new version of Web X10der which implements that scheme. I'd be grateful for some beta testers try it out before I publish it. Anybody who wants to try it, PM me with your email address and I'll send it.
User avatar
Rocket J Squirrel
 
Posts: 76
Joined: Wed Jan 06, 2010 3:39 pm
Location: California, USA

Re: Web Interface To X10 Commander

Postby zivodevo » Tue Feb 08, 2011 5:26 pm

Hi Rocket J Squirrel,

Glad I was of some help. I tried the page width thing and it wasn't quite right for me. Wanted to try the Java implementation they mention but don't know enough about that stuff. I'll send you a PM as I'm keen to test your new version.

Rgds,

zivodevo
Auckland, NZ
zivodevo
 
Posts: 9
Joined: Mon Feb 07, 2011 5:03 am
Location: Auckland, NZ

Re: Web Interface To X10 Commander

Postby rseery » Fri Jun 24, 2011 10:35 am

I changed the minimum scale to 0.9 and I think it looks good on an iPhone 4.
rseery
 
Posts: 3
Joined: Fri Jun 24, 2011 10:34 am

Re: Web Interface To X10 Commander

Postby Synewave » Tue Aug 02, 2011 10:43 am

Hi,

New member here.

Got the X10 commander working great on my iPhone. Whata great app. Had X10 modules for years but only using RF remote control. Now got a CM15pro and loving the mobile interface.

I've installed the webx10der on my webserver which also works a treat.

I'd like to add the status of each module i.e. on or off in the webpage, but struggling to find some code.

I'm basically familiar with HTML, Javascript and PHP.

Can anyone provide some code?

Thanks in advance.
Synewave
 
Posts: 2
Joined: Sat Jul 30, 2011 10:48 am

PreviousNext

Return to X10 Commander

Who is online

Users browsing this forum: No registered users and 1 guest

cron