HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 16th, 2012, 09:00 PM
guitardenver guitardenver is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2011
Posts: 8 guitardenver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 54 m 3 sec
Reputation Power: 0
Continuously Updating a webpage

I have a web page and a server that uses CGI scripts written in python. When I button is hit on the page the CGI scripts runs and sends commands through the serial port to one of my microcontrollers. This works ok to just send a button, string, or receive a response to that button press.

But I want to be able to continuously update the webpage with the status of my MCU (microcontroller). Like if a switch is pressed or the temperature goes up in my circuit. O a continuous update of a motors speed.

I tried the html code:
<meta http-equiv="refresh" content=".05">

But it is terrible for high speed (.05 sec). I cant even push a button it is refreshing so fast.

I have read about socket programming in python to keep the connection from the client and server going to seamlessly update content. I need to update the content that is generated by my servers COM port.

What can I use to do this? Is there good examples that you know of?

Thank you.

Reply With Quote
  #2  
Old August 16th, 2012, 10:16 PM
Catacaustic's Avatar
Catacaustic Catacaustic is offline
Code Monkey V. 0.9
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2005
Location: A Land Down Under
Posts: 1,885 Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 14 h 31 m 3 sec
Reputation Power: 1798
I'd suggest using AJAX to do this. Set up your page to display some details and use an AJAX function to get the data from your server on a set interval. For something like this, you can always set your function up to call itself on success so basically a never-ending loop of fetching new results. It will also save a lot of bandwidth as you'd only need to send back some basic JSON data, and not the entire pages HTML code.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Continuously Updating a webpage

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap