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 (141704 times)
  2. FAT32 Library (74779 times)
  3. Network Ethernet Library (59224 times)
  4. USB Device Library (49227 times)
  5. Network WiFi Library (44999 times)
  6. FT800 Library (44537 times)
  7. GSM click (31203 times)
  8. mikroSDK (30104 times)
  9. microSD click (27586 times)
  10. PID Library (27543 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: 1593 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]

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]

DS18X20 One Wire Library

5

Easily add DS18x20 sensor functions to your project.

[Learn More]