TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (392 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 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 (140535 times)
  2. FAT32 Library (73023 times)
  3. Network Ethernet Library (58026 times)
  4. USB Device Library (48212 times)
  5. Network WiFi Library (43821 times)
  6. FT800 Library (43293 times)
  7. GSM click (30354 times)
  8. mikroSDK (28984 times)
  9. PID Library (27115 times)
  10. microSD click (26717 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: 1548 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

DS18X20 One Wire Library

5

Easily add DS18x20 sensor functions to your project.

[Learn More]

Printf Support AVR / ARM

0

Adds printf and sprintf functionality to MikroC. Uses about 1.5k.

[Learn More]

ST EEPROM Emulation

5

Adaptation of STs' EEPROM Emulator to MikroC.

[Learn More]