Anyone ever run a webserver off a microcontoller?

  • Thread starter Thread starter thankz
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the feasibility and functionality of running a web server on a microcontroller, specifically focusing on technical aspects of implementation, limitations, and potential use cases. Participants explore various questions related to networking, HTTP protocols, and the capabilities of microcontrollers in serving web content.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant inquires about specific behaviors of the PIC TCP implementation, such as sending data to port 0.0.0.0 and the usability of 255.255.255.255 as a broadcast address.
  • Questions are raised regarding the ability to change the IP address in software, the use of loopback addresses, and whether HTTP must run exclusively on port 80.
  • There is curiosity about how a microcontroller handles PUT requests, whether it can host an index.html page, and the nature of data transmission during GET requests.
  • Another participant expresses skepticism about fitting a full server software into 4K of memory, suggesting that only minimal transaction software might be feasible.
  • One participant argues that it is possible to create a 1K web page, noting that a single character corresponds to one byte.
  • Concerns are raised about the practicality of serving dynamic content from a microcontroller, with some suggesting that it may only be capable of serving a static page.
  • Another participant emphasizes that microcontrollers can change page values, questioning the utility of such a setup for meaningful web server functionality.
  • Some participants note that while microcontrollers can serve web pages, it may be more practical to use a basic Linux micro-PC for more complex tasks.
  • One participant suggests that using a microcontroller to provide a web interface for a device could be a valid use case, especially when a full PC would be excessive.

Areas of Agreement / Disagreement

Participants express differing views on the practicality and capability of microcontrollers as web servers. While some acknowledge the potential for basic functionality, others question the effectiveness and efficiency compared to more powerful alternatives. The discussion remains unresolved regarding the extent to which microcontrollers can serve as useful web servers.

Contextual Notes

Limitations include the constraints of memory size in microcontrollers, the complexity of serving dynamic content, and the varying definitions of what constitutes a "web server." The discussion does not resolve these limitations.

thankz
Messages
265
Reaction score
40
I have a few questions:

particularly for the pic tcp implementation.
what happens when you send data to to port 0.0.0.0?
is 255.255.255.255 usable as a broadcast address?
I'm guessing you can change the ip address in software?
does it use a loopback address for anything?
do you have to run http only on port 80?
how does it handle a put request?
do you actually host an index.html page?
is it binary values that just change from 1 to 0 in a change of state event during the get request?
if so, does that mean you need a smart client side program to interpret the data?
how often can the client poll the data?
is http part of the tcp stack or do you have write that?
http1.0 or 1.1?
if going through a switch do you need a gateway address?
does it have standard http error messages?
can you run with udp also?
how much html can you actually fit on the pic18F67J60? <--:edit I guess I could figure that out buy translating ascii into bytes.

tia
 
Engineering news on Phys.org
I can't imaging that you could get even the most primitive server software into 4K of memory. You might get some really minimal transaction software but nothing like a real set of server software.
 
but it is possible to make a 1k web page, I just put some letters into notepad to see the size and one character equals one byte, I ignored ntfs 4k block size.
 
Sure, but that's not what you asked about. Could you serve that page up to a browser from a microcontroller? Even if you could, that would be just a single fixed page. Not much of a server.
 
but isn't the microcontroller able to change some of the page values, after all that's the point.
 
thankz said:
but isn't the microcontroller able to change some of the page values, after all that's the point.
Yes. Maybe I'm interpreting your question differently than you meant it. Let me tell you the question that I have been attempting to answer and if it not the question you are asking, then my answers are not as pertinent as I thought.

The question I have been attempting to answer is "Can a microcontroller be used to host a web server that would be in any way helpful, meaningful, or useful?". You might be asking "is it possible for a microcontroller to perform some trivial basic functionality that has some of the aspects of a web server?"
 
It seems some people have done so, more as a hobby than a practical solution as it is probably easier, faster, less expensive and more efficient to use a basic linux micro-pc.

But the issue shouldn't be the size of what you serve, the server just needs to address it and stream it.

Saw this : http://www.drdobbs.com/embedded-systems/building-your-own-web-server/211300170

I can see a reason for using a microcontroller though, to provide a web interface to a device, forvwhich only a basic server would be needed and a pc would be overkill. I.suspect this might be how some simple network devices that have a web interface do it.
 
Last edited:

Similar threads

  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
7
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
13
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K