Go Back   IceInSpace > Equipment > Software and Computers
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread
  #1  
Old 18-04-2013, 09:49 PM
Tandum's Avatar
Tandum (Robin)
Registered User

Tandum is offline
 
Join Date: Apr 2008
Location: Wynnum West, Brisbane.
Posts: 4,166
HTML Guru's

I'm running a little project here using an ardunio board to email me when the garage door has been open too long. It all works fine and once the iPhone email toots, I can go to safari, point at the ardunio and click a button on the web page it returns to close the door.

My problem is once I click the button, the address in safari changes from 10.0.5.25 to 10.0.5.25/?T=T which is the close door command. If I don't do a back in safari before closing the phone, it stays on the command address next time I look at it and I don't want that.

Here is the page source from the ardunio :

<!DOCTYPE HTML>
<form method="get">
<div style="width:100%; height:100%">
<button type="submit" style="height: 200px; width: 800px; font-size:500%; margin: -10px -25px; position:relative; top:25%; left:10%; " name="T" value="T">Door Clicker.</button>
</div>
<br />
</form>

Lots of size commands to get a big button in the middle of the screen.

What do I need to send it back to the initial address after pressing the button? Any clues?
Reply With Quote
  #2  
Old 18-04-2013, 10:09 PM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
Can you change the form method to "post" instead of "get". That way the arguments don't get passed via the URL. Bit hard to answer without knowing more about the rest of the app. You don't have an action in there.
Reply With Quote
  #3  
Old 18-04-2013, 10:18 PM
Tandum's Avatar
Tandum (Robin)
Registered User

Tandum is offline
 
Join Date: Apr 2008
Location: Wynnum West, Brisbane.
Posts: 4,166
I tried post but the code triggers on ?T and I don't see that coming from a post. I dump everything coming from the client to serial so I can see it all on the side and using post I don't see any T's at all?

I'm just using html cos it's there and I can't write an iphone app without a mac. But it's basic coms, The client sends a html get and the button code I posted is returned. If the button is pressed the client sends ?T=T in the get request.

action tells it which web site to send the request to and doesn't do anything in this case.

I'll try spitting it some jscript to push it back.

Last edited by Tandum; 18-04-2013 at 10:31 PM.
Reply With Quote
  #4  
Old 18-04-2013, 10:32 PM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
Can you use a refresh something like this to refresh the page every 3 secs. So you can click, get the ?T you need, then it cleans up the URL.

<!DOCTYPE HTML>
<meta http-equiv="refresh" content="3; url=http://10.0.5.25">
<form method="get">
<div style="width:100%; height:100%">
<button type="submit" style="height: 200px; width: 800px; font-size:500%; margin: -10px -25px; position:relative; top:25%; left:10%; " name="T" value="T">Door Clicker.</button>
</div>
<br />
</form>
Reply With Quote
  #5  
Old 18-04-2013, 10:38 PM
Tandum's Avatar
Tandum (Robin)
Registered User

Tandum is offline
 
Join Date: Apr 2008
Location: Wynnum West, Brisbane.
Posts: 4,166
I did try that and got multiple ?T 's coming in once the button was pressed but I'll have another look tomorrow. I don;t think I had the url= in it. Cheers

I also ordered snow leopard off apple to try a hackintosh
Reply With Quote
  #6  
Old 18-04-2013, 10:41 PM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
Hope that does it for you. It worked here. The ?T=T appears initially after clicking the button, then after 3 secs (or whatever delay you want) goes back to the "url=...". Keep in mind it'll keep refreshing every 3 secs, not just once after 3 secs and stop. So maybe make the delay long as you think needed?
Reply With Quote
  #7  
Old 18-04-2013, 10:46 PM
Tandum's Avatar
Tandum (Robin)
Registered User

Tandum is offline
 
Join Date: Apr 2008
Location: Wynnum West, Brisbane.
Posts: 4,166
I initially used a 5 sec refresh while writing it up. It really needs a refresh so it can tell you the door is closing, the light is on etc. All a waste of time once the boy child moves out of course
Reply With Quote
  #8  
Old 19-04-2013, 02:25 PM
Tandum's Avatar
Tandum (Robin)
Registered User

Tandum is offline
 
Join Date: Apr 2008
Location: Wynnum West, Brisbane.
Posts: 4,166
Troy,
<meta http-equiv="refresh" content="3; url=http://10.0.5.25">
This line did work, after some sleep I saw I left out the ; after the time value.
It was then triggering twice for some reason but I hacked around that.
All working now Cheers.
Reply With Quote
  #9  
Old 19-04-2013, 04:21 PM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
Awesome
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 07:56 AM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Advertisement
Bintel
Advertisement
Astrophotography Prize
Advertisement