MSnet working with the GUI, but not with a form action

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
venrico
Newbie
Posts: 6
Joined: Mon Dec 15, 2014 11:31 pm

MSnet working with the GUI, but not with a form action

Post by venrico » Mon Dec 15, 2014 11:39 pm

Hello,

I've been playing around with MSnet and have been able to get it to work with the MSnet GUI whether between two computers on a local network, or from one computer to a server/virtual machine. However I can't seem to get the html form submit to launch a Macro Scheduler macro whether it be local or to a virtual machine.

My code is pretty much a copy/paste from the help page from MSnet.
ipaddress is an actual ipaddress, just didn't want to show it here.

<form action="http://ipaddress:6666/Name_Pro.scp" method="GET">
id: <input type="text" name="id">
<input type="submit">
</form>

The appropriate port 6666 is open and again works with MSnet GUI, just can't get it to work with my submit button. Any help would be appreciated!

-Enrico

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: MSnet working with the GUI, but not with a form action

Post by Marcus Tettmar » Tue Dec 16, 2014 9:15 am

Does msNet require a password?

What happens if you try the URL manually in a web browser:

http://ipaddress:6666/Name_Pro.scp?id=hello

The msnet gui client is just an http client. So constructing the URL in a browser does the same thing which of course is what a form GET does. So if one works but another doesn't the issue must be forming the URL/parms wrong.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

venrico
Newbie
Posts: 6
Joined: Mon Dec 15, 2014 11:31 pm

Re: MSnet working with the GUI, but not with a form action

Post by venrico » Tue Dec 16, 2014 10:25 pm

Well when I try to enter into it the browser I just receive a "This webpage is not available" page. I think I am doing everything correctly except maybe the ip. Lets say I were to use an ipaddress: 192.168.1.2, a port 6666, and wanted to use the macro Name_Pro.scp and send the parameter id = 121.

I should be able to enter it like this, correct?
http://192.168.1.2:6666/Name_Pro.scp?id=121

Entering this just shows a "This webpage is not available" page.

Thanks Marcus.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: MSnet working with the GUI, but not with a form action

Post by Marcus Tettmar » Thu Dec 18, 2014 9:23 am

What are you entering into the gui? If you show me a screenshot I can show you the equivalent to enter into a browser, which would be the same as for a form post.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

venrico
Newbie
Posts: 6
Joined: Mon Dec 15, 2014 11:31 pm

Re: MSnet working with the GUI, but not with a form action

Post by venrico » Thu Dec 18, 2014 6:06 pm

Here is the screenshot of the gui. Thanks Marcus!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: MSnet working with the GUI, but not with a form action

Post by Marcus Tettmar » Mon Dec 22, 2014 10:35 am

In your GUI you are specifying a macro name but in your form you have a filename. You can do either but a filename would need a path. Given that you are specifying just a macro name (as known to Macro Scheduler) then I think you want:

http://105.131.125.171:6666/Name_Pro?id=121

Or if the form and macro on the same machine use localhost, or try 127.0.0.1:

http://127.0.0.1:6666/Name_Pro?id=121
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

venrico
Newbie
Posts: 6
Joined: Mon Dec 15, 2014 11:31 pm

Re: MSnet working with the GUI, but not with a form action

Post by venrico » Mon Dec 22, 2014 5:50 pm

Okay I found out what the issue was (sort of). Apparently both the form action and entering the request through the browser doesn't work with Chrome, but with Internet Explorer and Firefox. I'm not sure if there is a setting I need to fix in Chrome to get this to work (do you know what could be causing this?), but by default it doesn't work.

Anyway, Thanks for your help Marcus! If you can provide any more insight on the chrome issue that would be great.

venrico
Newbie
Posts: 6
Joined: Mon Dec 15, 2014 11:31 pm

Re: MSnet working with the GUI, but not with a form action

Post by venrico » Tue Dec 30, 2014 8:14 pm

Pursuing this further and reading in the Chrome console, I get the error message: net::ERR_UNSAFE_PORT. Looking this up online I have read the Chrome happens to consider port 6666 (the default recommended port from you guys) as unsafe. Just a heads up for ya Marcus for further documentation and what not.

Edit:
I'm actually having trouble getting any other port to work other than 6666 (when using IE or Firefox). It's important that we have msNet work for Chrome, do you have any other recommendations for ports that msNet uses?

Thanks

- Enrico Valbuena

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: MSnet working with the GUI, but not with a form action

Post by Marcus Tettmar » Wed Dec 31, 2014 1:41 pm

It all depends on your firewall. Use any port number you like but a) make sure your firewall has it open and b) don't use one that something else might be using (therefore worth avoiding the commonly used ones).

http://stackoverflow.com/questions/3363 ... afe-to-use
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

venrico
Newbie
Posts: 6
Joined: Mon Dec 15, 2014 11:31 pm

Re: MSnet working with the GUI, but not with a form action

Post by venrico » Thu Jan 08, 2015 7:43 pm

Hey Marcus,

Thanks so much for all your help. We are very pleased so far with what we have going on with msNet. I do have another question for you. So right now as the macro finishes we'r able to take advantage of MACRO_RESULT to let us know that it's done. Is there a way for the Macro to communicate back to the server/website mid Macro instead of just at the end with MACRO_RESULT?

For example, I'd like for our macro to report back how far along the way it is / how close it is to finishing. Is there a function that's already there that we can use for this? Thanks Marcus!

- Enrico

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: MSnet working with the GUI, but not with a form action

Post by Marcus Tettmar » Tue Jan 13, 2015 1:41 pm

No, sorry. That isn't how web CGI works anyway. Same with PHP etc. You get one output buffer, there's no asynchronous communication method here.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts