
rbonari

Hello,
I have ventured into the HTTP Servers, both regular and custom and was really impressed. Pretty cool stuff !
First question I have is that I was able to successfully connect to the regular server page with my Android Phone and as my project is fairly large, I couldn't scroll through the whole screen of the project. Would I be correct in assuming that this is a limitation of the Samsung Galaxy S4 Screen Size?
I noticed in the web server control that there are two IP Addresses the show in the control. The first one is the regular IP Address and the other one is the remote port for accessing server outside of my network. Then I noticed when I was connected that I have clicked on the connection button that there was yet another IP Address. The IP Address in the control screen along with the remote address is an IP Address that is already used on my network. The IP Address I get when I connect on connection button shows an IP Address that is not used on my network and this makes sense. Not sure how these IP Addresses are all related. We have two different IP Addresses and a remote address.
Also, which IP Address is the one I should be forwarding? Is it the address in the drop down box when I click on connection or the one of two that shows up in the main control box? Also, would I be correct in assuming that I can change the port number to one that is currently not used on my router? Also, what are some common IP Addresses that I could use that aren't currently used and would be safe to use.
I can view the web server page on my Android phone on my local network but can't access yet outside of my network. Tried port forwarding both IP addresses, with a different port number than 80 and no luck. This is where I think I might be using port numbers that are already used?
With regards to the custom web server, I looked at the example in the scripts folder and got it to work somewhat. The reason not everything worked is because I am using the Adventure Bot for my project and I am sure the author of the example custom web server used a different robot, etc. I was wondering if anyone has the example HTML code for a basic HTTP Custom Server? Example code is always great for learning purposes. I did check out the question mark for the custom web server but there was no examples. Any help on creating a custom web server would be great to help me understand what is going on with it. TheTechGuru is gracious enough to volunteer to help me out when he gets back from vacation as he wants to do some similar things with his robots that I want to do. Thought I would learn as much as I can before he gets back so I know what he is talking about somewhat?
Thanks for all the help and what a great community !
Alan,
Thanks much ! I will check it out and let you know how it goes. Thanks again ! Rick
Hello Alan,
I was able to complete the port forwarding to view the custom web server outside of my network. Thanks again ! I have a couple of questions regarding the custom web server page while awaiting on your progress with modifying the web page:
I know that I don't want to modify and save the example custom web server page that is in the ARC projects folder but would like to try and modify it to change the existing button to execute one of my existing scripts. They are labeled script1, script2, etc. How would I change the html page button code to execute one of these scripts and what is the best method to do this. Can you provide example code?
The actual code for the custom html server page is in the http server root directory. When I right click on the page and do a view source I get the actual code for the page. I did a copy and past and saved it as ez_robot_html as a text file in my documents directory temporarily. Once modified I assume this file goes back in the http server root directory, but then does it need to be renamed "default" and the original "default" file moved to a temp directory. The whole idea being not to write over or trash the original http custom web server page code. Do hope this makes sense and again thanks for your continuing help ! Rick

Good that you got port forwarding to work.
Yes, you will be able to execute your scripts, and I will be providing examples when I get time to work on this (been a horrible week at work. I need another vacation).
It would be best if your scripts were in a script manager control and had meaningful names instead of just script1, script2, but I'll make examples of both.
Yes, your page will be called default.html, and it is a good idea to keep a backup of it any time you make a change. I believe it gets over-written whenever ARC is updated, so you don't want to lose work on a custom page unexpectedly.
Alan
Alan,
Not sure what is going on. I saved the original default.html file in a different directory then deleted the default.html file from the http custom server root directory. I then made a copy of the original default.html file and renamed it default1.html. I then opened the default1.html file in notepad and modified the button that says hello world to speak something different. I saved it and then copied the file into the server root directory and renamed it default.html and saved. I started the custom web server and could no longer access the page from my phone. It gave me the 404 error code. It seems that if you change the default.html file in any way it does not work on the phone. All I did was change what was spoken when you push the hello world button. Maybe somewhere the date of creation of the file is checked before the page is run. Very frustrating. I put the original default.html file back in root directory and it ran fine on the phone. Any suggestions on what might be going on here would be much appreciated.
Also, I noticed that the button uses the "say" command and the speech is played on the pc speaker. Is it possible to use the " SayEZB command in the custom server web page? Does it have to be all lower case or like above as it is used in ARC scripting? Thanks again for all your help ! Rick stress
You must not have copied it to the right place or misnamed it. There are no date dependencies and it will open any valid html file named default.html (or any other html file if you add the file name to the end of the url).
Yes, you can use sayers or any other EZB script command.
Alan
Alan,
In notepad I saved the file as an .htm file. When I look at the properties of the file it says it is an html file. Is this ok to do or do I have to use .html as the extention? What is the difference if any in saving it as .htm or .html?
I notice in looking at the code for the web page that the button command for playing speech thru the pc speaker is all lower case (say) and in ARC script it is (Say). Does this mean to play the speech thru the ezb speaker we could use (sayezb) or would it be (SayEZB) as in ARC scripting?
Thanks again for all your help ! Rick
For most web servers there is no practical difference between him and html extension, but if it isn't working for you when named him try renaming to html (also, name is more important with the default page that sub-par essay where the file name is part of the url).
EZ script is not case sensitive. The capitalization is just used for readability.
Alan
Alan,
Thanks much, I will give it a try and let you know what I find out. Also when I modified the file, before I could change the code I had to change this file and the folder it was in (http server root) from read only to read and write. Does this need to be changed back to read only? I wouldn't think so?
Also, I mentioned I have a single script I would like to execute with a button on the custom web server page. Would this be the way I would do this as far as the ez-scripting goes?
ControlCommand ("Script 4", ScriptStart)
Do you have to include scriptstart and if so do you have to include a scriptstop somewhere and where would it be included if it is needed?
Thanks again Alan !
:)