TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139264 times)
  2. FAT32 Library (71752 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47432 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42408 times)
  7. GSM click (29835 times)
  8. mikroSDK (28100 times)
  9. PID Library (26886 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Project

Webserver - Full Featured

Rating:

5

Author: Richard Lowe

Last Updated: 2013-08-19

Package Version: 1.0.1.6

Category: Communication

Downloaded: 2594 times

Followed by: 3 users

License: MIT license  

Example of what can be done with the Ethernet library. Server serves both dynamic / static content, retrieves time from NTP servers, downloads files from remote servers.

Requires: Ethernet Library, FAT32 Library, Standard Bool Library

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Webserver - Full Featured" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Webserver - Full Featured" changes.

Do you want to report abuse regarding "Webserver - Full Featured".

  • Information
  • Comments (7)

Project Blog


This project is still in alpha testing but performs the basic functions of time sync, serving a variety of pages and types, as well as file downloading.  Downloading and serving pages can be done consecutively.


A word of caution.  Download speeds are slow.  Windows size is set at the default 30 bytes.  I made the mistake of downloading a 100mb file.  Let me just say.... don't.  Can you say hours!  It can, however, support client download and server requests at the same time.  Limited to default 7 sockets but can be increased by changing default.


I would appreciate any comments on how this can be improved.  The general overall goal is to introduce this as a library that can be added to any project.  Behavior has tried to be kept at a generic level, so there are some missing features. example: still need to extract filenames from request.



  • Added GMT Timestamp string to server header used in caching on the client side.
  • Added webUpdateTime() function that increments GMT timestamp as well as Ethernet functions
  • Added comments to main.c demo
  • Added multiple tries to filedownload and timestamp requests due to bugs in resolving DNS addresses on the first attempt.


  • File download improvements by use of swapfile. 
  • Added structure for key value pair returned from form.


Added separate timestamp for filesystem, so FAT files are written with local time while header on webserver is the correct GMT time.

Added irq mode which is still a little flaky.


Added form field parsing.

Added download file functions



Added AVR support as well as changing demo to demonstrate file download flag polling.

This shows how easy it is to change the server to another platform.  Shows the great cross-platform capability of MIkroC.

*Note: File download in the test string is 75k (.mp3 file).  On slower MCUs the download times are quite long.  ~3 minutes.  If you desire greater download speed, increase the MSS size to something greater than the default 30 bytes.  Increasing it to 128 brings download times to < 10 seconds.

I was able to squeeze another 10-18% improvement in speed of servicing frames by avoiding the standard library string functions.  


Interrupt mode on AVR is stable and reliable
Interrupt mode on ARM is not as stable but in the works.


Huge performance improvements!.  This new release supports the following:


Client connections:

HTTP1.0 Closed
HTTP1.1 Persistent
Pipelined connections

File Downloads:
HTTP 1.0 Closed
HTTP 1.1 Persistent
Chunked Encoded
With the addition of persistent connections a 40% or better speed increase was realized.  For a single thread application, the performance is good even on 8Mhz 8bit MCUs.

Webserver Admin:

Add webpages with easy add_page functions.

Callbacks for dynamic page update on request.

ALSO FROM THIS AUTHOR

Task Scheduler

10

This is a light Round Robin style task scheduler. You can define the maximum number of tasks and add those tasks to be ran at scheduled intervals. You will need to provide a clock source.

[Learn More]

STM DMA Library

15

This is the first of DMA functions that will be available for the ST line of ARM microcontrollers. The idea was born from a forum post. The idea worked so well I made it into a convenient MikroC library. So far.... memory to memory transfers is what is functional

[Learn More]

Dynamic List Library

5

Dynamic double linked list library that is not only fast but efficient.

[Learn More]