Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7655587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:32:58+00:00 2026-05-31T12:32:58+00:00

I have an embedded device running a slimmed down version of a HTTP server.

  • 0

I have an embedded device running a slimmed down version of a HTTP server. Currently, it can display static HTML pages. Here is an example of how it displays a static HTML page:

   char *text="HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"
          "<html><body>Hello World!</body></html>";
   IPWrite(socket, (uint8*)text, (int)strlen(text));
   IPClose(socket);

What I’d like to do is display dynamic content, e.g. a reading from a sensor. What I thought of so far is to have the page refresh every once in awhile with

<meta http-equiv="refresh" content="600">

and use sprintf() to attach the sensor reading to the text variable for the response.

Is there a way I can do this without having to refresh the page constantly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:33:00+00:00Added an answer on May 31, 2026 at 12:33 pm

    You can try the following (from my experience) approach:
    – Divide static and dynamic content, minimize dynamic content.

    • Create a pseudo CGI interface, i.e. URL your_embedded_site/sensor.cgi should be bound to generation of the following HTTP response:


    sprintf(cgi_str, "HTTP/1.0 200 OK\r\nContent-Type: text\r\nContent-Length: %d\r\n\r\nvalue=%02d", 8, sensor_value);

    or just (that’s all about your design considerations):


    sprintf(cgi_str, "HTTP/1.0 200 OK\r\nContent-Type: text\r\nContent-Length: %d\r\n\r\n%02d", 2, sensor_value);

    • Use simple javascript or small java applet to request periodically your_embedded_site/sensor.cgi. Note that javascript is generally browser dependent and may be switched off, java applet will also require additional static content – some *sensor_reader.class” but it has extraordinary freedom in presenting data and extending simple reading and showing with more features.

    This allows to organize communication in very efficient way, instead of reloading of the full page: part of code – user front end – will be executed in browser, other part – back end – on the embedded device.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement to integrate a web server into an embedded device running
I have an embedded device running busybox . The device has crond installed and
I have ASP.NET server. I have an embedded device with cellular communication (socket based)
I have an embedded hardware device that currently broadcasts data via bluetooth. I don't
I have an embedded application running httpd for a web server. On the main
I have an embedded device which runs Java applications which can among other things
I have an embedded device,its includes windows CE 6.0 Build 3112.I want to run
I have an embedded device communicatiing with a host (with Tera Term) through USART.
I have a ARMv5-powered non-XScale device (the SHARP Brain™ electronic dictionary) with Windows Embedded
I have an embedded system (ARM 9263) running an RTOS, IAR tools. The system

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.