TOP Contributors

  1. MIKROE (2657 codes)
  2. Alcides Ramos (354 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 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 (136900 times)
  2. FAT32 Library (70034 times)
  3. Network Ethernet Library (56005 times)
  4. USB Device Library (46308 times)
  5. Network WiFi Library (41934 times)
  6. FT800 Library (41232 times)
  7. GSM click (29022 times)
  8. PID Library (26434 times)
  9. mikroSDK (26401 times)
  10. microSD click (25387 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
Library

AVR Webserver

Rating:

0

Author: Richard Lowe

Last Updated: 2014-01-30

Package Version: 0.0.2.1

Category: Communication

Downloaded: 1481 times

Not followed.

License: MIT license  

AVR Webserver:

Dependencies - FAT32 library, Ethernet library

Will allow you to load any size website, including images, css, and js files from SD media.

This is my first version, but the example project included will give you a starting point.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "AVR Webserver" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "AVR Webserver" changes.

Do you want to report abuse regarding "AVR Webserver".

  • Information
  • Comments (2)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Library Blog

Example Page

Example Page

Example homepage.

View full image

Currently, it compiles to ~40k, so no 32k chips allowed.


Issue is that over time, the sockets on the system become closed and unable to re-open. 

Seems there is some errors with the MikroE ethernet library but I'm trying to track down the source of the issue.

It is written more or less like a HTTP 1.0 server more than a HTTP 1.1 server.  Only difference is that pipe-lining isn't implemented.  Meaning, once the file has been transferred it closes the TCP connection opposed to keeping the connection "alive" to serve other file types.  This is done because I wanted an easier way to track what file was being served, on what socket, and where, if any, problem child files.

You'll notice I use function pointers to emulate an OOP type of look.  Yes, it costs a few bytes to do it, but it makes me feel more at home. (Coming from a Java background)

Declared like:

/*!
* \brief Websocket struct that holds all function pointers
*
*/

struct webServer_desc {
     const void(*Init)(void);
     const void(*FSInit)(void);
     const void(*DoPacket)(void);
     const void(*LogEvent)(int log, char* text);
     const void(*SetIP)(ipAddress_t *address); 
     const void(*SetSubIP)(ipAddress_t *address);
     const void(*SetGW)(ipAddress_t *address);
     const void(*SetDNS)(ipAddress_t *address);
     const void(*SetDHCP)(int mode);
     const void(*SetPort)(unsigned short portNum);
     const void(*GetTime)(unsigned char *ntpSvr);
     const char*(*GetData)(unsigned char *request);
     const int(*GetFreeSockets)(void);
};

Initialized like:

// Function pointer struct

struct webServer_desc Webserver = {
     &webserverInit,
     &SDCardInit,
     &doPacket,
     &logEvent,
     &setIP,
     &setSubIP,
     &setGW,
     &setDNS,
     &setDHCP,
     &setPort,
     &getSvrTime,
     &getSvrData,
     &getNumFreeSockets
};


That way, my calls look like this:

Webserver.FSInit(); 
Webserver.Init(); 
Webserver.DoPacket();

  


ALSO FROM THIS AUTHOR

Dynamic List Library

5

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

[Learn More]

BarGraph Library

5

BarGraphs are wonderful for visual feedback. This library makes it easy to add one. Based on BarGraph click board.

[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]