TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139263 times)
  2. FAT32 Library (71752 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47431 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42407 times)
  7. GSM click (29835 times)
  8. mikroSDK (28080 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
Library

AVR Webserver

Rating:

0

Author: Richard Lowe

Last Updated: 2014-01-30

Package Version: 0.0.2.1

Category: Communication

Downloaded: 1516 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

RTC 1307 Library

10

Makes easy addition of ds1307 RTC.

[Learn More]

Dynamic List Library

5

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

[Learn More]

Add Standard bool / true / false to MikroC

0

This is not my library, but a opensource header file that adds boolean datatype to MikroC. Copy this file to the ../Mikroeleckronika/"your ide"/include/ directory. In your project that will use boolean types include this line: #include <stdbool.h>

[Learn More]