Before I jump into learning the webviewer, I would like to ask if I can use the viewer to do this task.
I am running a simple Arduino web server that works.
Can I send a request such as “http://mysite.netgear.com:8085/status” ?
This request uses dynamic DNS to get to my local server and I have selected port 8085 that will be forwarded to my Arduino server, with the command status.
My site will respond with a string such as “light 1 is on”.
Is there a function in the Webviewer that will display the received string so that I can parse it and then do other things based on the result?
I have attempted to start an app and inserted a button and webviewer.
When I pushed the button I execute the procedure “webviewer1.gotoURL” where I have a URL inserted as a text box. When I push the button, I get a response that the web page cannot be accessed. I know this is not true as I can access the page from my PC. I know this is very simple but I have to start simple.
An aside question, how or what is the best way to be able to insert some blocks into my reply’s?
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.
I am making some progress. In the blocks I am trying to send to “http://hambo.mynetgear.com:8085/file1”
It seems that I cannot add the port number 8085. Is thee a way to do this?
Without the port number, I cannot get through my router to my specific server.
Suggestion??
I have the property page you reference in front of me but it is not very clear unless you have worked with web pages before.
When I try to use a URL with a port number, I get an error that it is an invalid URL. I do not see in the doc you suggest as to how to specify a port.
I want to get the response whatever it is so I can look for the string “file1”
If you use your computer and send to the URL http://hambo.mynetgear.com:8085/file1 you will get a response of “file 1 selected” This is what I want to achieve using MIT Inventor.
I noticed that my server has responded to a request a few times so I guess the request is going out.
What my server does is to merely look at the received string and look for “file1” or “file2” then it responds with either “file1 selected” or file2 selected.
At least you are getting the app to send to a URL with a port number;
Taifun, I tried the code (blocks) you posted and get no results. Not sure what is happening here. I am connecting to the ai companion on my cell phone.
Correction, your code blocks do work. My server crashed for some reason and I had to reboot it. Now your code works but still no response.
Are you testing with a cell phone or the emulator on the computer. I just tried the computer emulator and it worked although I have had to update it a few times.