TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (405 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (133 codes)
  5. Bugz Bensce (97 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 (141629 times)
  2. FAT32 Library (74654 times)
  3. Network Ethernet Library (59128 times)
  4. USB Device Library (49167 times)
  5. Network WiFi Library (44926 times)
  6. FT800 Library (44459 times)
  7. GSM click (31122 times)
  8. mikroSDK (30037 times)
  9. microSD click (27531 times)
  10. PID Library (27512 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: 1587 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

BarGraph Library

5

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

[Learn More]

RTC 1307 Library

10

Makes easy addition of ds1307 RTC.

[Learn More]

Static Data Structures

5

Add static data structures to your project.

[Learn More]