[mh] MisterHouse web setup question

I have installed MH per the install instructions (Windows machine). I have created a perl script for my pioneer receiver. This runs properly when I run the .pl script.
The web interface runs and I have modified My MH page (my_web) pages to include a test button to play/pause the a/v receiver.
When I use <a href="/bin/pioneer_play.pl"> it executes the .pl script and my web page goes to a blank page with a "1" on it.
I know the "1" means it was successful. I know I'm not supposed to use <a href= which directs me away from the page, but I did for testing purposes.
Based on the MisterHouse WIKI -> How to -> Web Pages page, the bottom section is about passing RUN and SET through the http://../RUN;web_item commands. This is where I am getting stuck.
How do I create a web_item that can be run from here?
(I want the web_item to run the pioneer_play.pl script.)
Thanks,
Brian

Thread view

I have installed MH per the install instructions (Windows machine). I have created a perl script for my pioneer receiver. This runs properly when I run the .pl script.
The web interface runs and I have modified My MH page (my_web) pages to include a test button to play/pause the a/v receiver.
When I use <a href="/bin/pioneer_play.pl"> it executes the .pl script and my web page goes to a blank page with a "1" on it.
I know the "1" means it was successful. I know I'm not supposed to use <a href= which directs me away from the page, but I did for testing purposes.
Based on the MisterHouse WIKI -> How to -> Web Pages page, the bottom section is about passing RUN and SET through the http://../RUN;web_item commands. This is where I am getting stuck.
How do I create a web_item that can be run from here?
(I want the web_item to run the pioneer_play.pl script.)
Thanks,
Brian

Welcome to MisterHouse.
It sounds like you want to be able to run a subroutine from a url. To do
this you would need to do the following:
1. Create a user code file with the subroutine such as:
sub test {
::print_log("Hello World");
}
2. Enable that user code in MH
3. Then to run the subroutine call it from the url as follows:
http://localhost/sub?test
In this example it would have printed to the log. You can also pass
arguments to the sub through the url as well.
On Wed, May 29, 2013 at 10:23 AM, Brian Chase <chasebri@...> wrote:
> I have installed MH per the install instructions (Windows machine). I have
> created a perl script for my pioneer receiver. This runs properly when I
> run the .pl script.
>
> The web interface runs and I have modified My MH page (my_web) pages to
> include a test button to play/pause the a/v receiver.
> When I use <a href="/bin/pioneer_play.pl"> it executes the .pl script and
> my web page goes to a blank page with a "1" on it.
> I know the "1" means it was successful. I know I'm not supposed to use <a
> href= which directs me away from the page, but I did for testing purposes.
>
> Based on the MisterHouse WIKI -> How to -> Web Pages page, the bottom
> section is about passing RUN and SET through the http://../RUN;web_itemcommands. This is where I am getting stuck.
>
> How do I create a web_item that can be run from here?
> (I want the web_item to run the pioneer_play.pl script.)
>
> Thanks,
> Brian
>
>
> ------------------------------------------------------------------------------
> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
> Get 100% visibility into your production application - at no cost.
> Code-level diagnostics for performance bottlenecks with <2% overhead
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap1
> ________________________________________________________
> To unsubscribe from this list, go to:
> http://sourceforge.net/mail/?group_id=1365
>
>
>

No problem.
On Wed, May 29, 2013 at 11:21 AM, Brian Chase <chasebri@...> wrote:
> That was it. Thank you Kevin! I wrote my scripts w/ the action that only
> needed to be performed when clicked from the web interface. I'll move
> these to subs, move it to the custom code section and link
> the audio navigation buttons to the subs. (Wow...I coulda' had a V8!)
>
> Thanks again.
>
> ------------------------------
> Date: Wed, 29 May 2013 10:39:14 -0700
> Subject: Re: [mh] MisterHouse web setup question
> From: kevin@...
> To: chasebri@...
> CC: misterhouse-users@...
>
>
> Welcome to MisterHouse.
>
> It sounds like you want to be able to run a subroutine from a url. To do
> this you would need to do the following:
> 1. Create a user code file with the subroutine such as:
> sub test {
> ::print_log("Hello World");
> }
> 2. Enable that user code in MH
> 3. Then to run the subroutine call it from the url as follows:
> http://localhost/sub?test
>
> In this example it would have printed to the log. You can also pass
> arguments to the sub through the url as well.
>
>
> On Wed, May 29, 2013 at 10:23 AM, Brian Chase <chasebri@...>wrote:
>
> I have installed MH per the install instructions (Windows machine). I have
> created a perl script for my pioneer receiver. This runs properly when I
> run the .pl script.
>
> The web interface runs and I have modified My MH page (my_web) pages to
> include a test button to play/pause the a/v receiver.
> When I use <a href="/bin/pioneer_play.pl"> it executes the .pl script and
> my web page goes to a blank page with a "1" on it.
> I know the "1" means it was successful. I know I'm not supposed to use <a
> href= which directs me away from the page, but I did for testing purposes.
>
> Based on the MisterHouse WIKI -> How to -> Web Pages page, the bottom
> section is about passing RUN and SET through the http://../RUN;web_itemcommands. This is where I am getting stuck.
>
> How do I create a web_item that can be run from here?
> (I want the web_item to run the pioneer_play.pl script.)
>
> Thanks,
> Brian
>
>
> ------------------------------------------------------------------------------
> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
> Get 100% visibility into your production application - at no cost.
> Code-level diagnostics for performance bottlenecks with <2% overhead
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap1
> ________________________________________________________
> To unsubscribe from this list, go to:
> http://sourceforge.net/mail/?group_id=1365
>
>
>
>

Kevin,
I attempted to post this yesterday and again today. It did not show up on the Sourceforge Mailing list, but it did show up on Google Groups???? Go figure. I'm hoping that a reply to you/misterhouse-users will get it to post.
My question to be posted:
I have installed MH 2.2 installed on a Windows based PC (Win7). I have run the canned webpage using localhost:8080 . I have created my own web page to control the stereo and added html_file = xx/index.shtml to mh.private.ini. Success. I have run the webpage based on the current PC's IP address:8080 (httpx.x.x.x.:8080 Server's IP address). Success. I can control my stereo. I tried opening the webpage from another computer INSIDE my network. This is where I am having problems. I open the IP address:8080 from a remote computer. It pauses for 11-13 seconds. The background without pictures finally comes up. Misterhome restarts about 5 times. If I right click on the X'd out images and selected 'show image', it does come up. The error from MH says: "Bad address family for Socket::unpack_sockaddr_in, got 0, should be 2 at c:\mh\mh\bin/../lib/http_server.pl line 134. accidental exit on mh, restarting ...
I looked at lines 119-138 on http_server.pl and I'm not sure how I'm supposed to fix this. The variable $peer is 0, but should be 2?
I tried searching for solutions to this (unpack_sockaddr_in, bad socket address, etc), but couldn't find a solution.
Any suggestions or answers?
Thanks for your help.
-Brian
Date: Wed, 29 May 2013 11:36:13 -0700
Subject: Re: [mh] MisterHouse web setup question
From: kevin@...
To: chasebri@...; misterhouse-users@...
No problem.
On Wed, May 29, 2013 at 11:21 AM, Brian Chase <chasebri@...> wrote:
That was it. Thank you Kevin! I wrote my scripts w/ the action that only needed to be performed when clicked from the web interface. I'll move these to subs, move it to the custom code section and link the audio navigation buttons to the subs. (Wow...I coulda' had a V8!)
Thanks again.
Date: Wed, 29 May 2013 10:39:14 -0700
Subject: Re: [mh] MisterHouse web setup question
From: kevin@...
To: chasebri@...
CC: misterhouse-users@...
Welcome to MisterHouse.
It sounds like you want to be able to run a subroutine from a url. To do this you would need to do the following:1. Create a user code file with the subroutine such as:
sub test { ::print_log("Hello World");}2. Enable that user code in MH3. Then to run the subroutine call it from the url as follows:
http://localhost/sub?test
In this example it would have printed to the log. You can also pass arguments to the sub through the url as well.
On Wed, May 29, 2013 at 10:23 AM, Brian Chase <chasebri@...> wrote:
I have installed MH per the install instructions (Windows machine). I have created a perl script for my pioneer receiver. This runs properly when I run the .pl script.
The web interface runs and I have modified My MH page (my_web) pages to include a test button to play/pause the a/v receiver.
When I use <a href="/bin/pioneer_play.pl"> it executes the .pl script and my web page goes to a blank page with a "1" on it.
I know the "1" means it was successful. I know I'm not supposed to use <a href= which directs me away from the page, but I did for testing purposes.
Based on the MisterHouse WIKI -> How to -> Web Pages page, the bottom section is about passing RUN and SET through the http://../RUN;web_item commands. This is where I am getting stuck.
How do I create a web_item that can be run from here?
(I want the web_item to run the pioneer_play.pl script.)
Thanks,
Brian
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365