ovidiucp / TinyWebServer

Small web server for Arduino, fits in 10KB ROM, less than 512 bytes RAM
http://www.webweavertech.com/ovidiu/weblog/archives/000484.html
GNU Lesser General Public License v2.1
244 stars 65 forks source link

Update to support newer Arduino IDE and Intel Edison #26

Open pjalm opened 9 years ago

pjalm commented 9 years ago

Would it be possible to get an update to use this library? I can't get it to work with latest Arduino IDE.

Also would it be difficult to use it for the Intel Edison via WiFi?

ovidiucp commented 9 years ago

Is the issue you're seeing related to the Flash v5 library? If so, add the following lines in Flash.h, just after the #include <avr/pgmspace.h>:

#if ARDUINO >= 150
typedef char prog_char __attribute__((__progmem__));
#endif

The beginning of that file should look something like this:

#include <avr/pgmspace.h>

#if ARDUINO >= 150
typedef char prog_char __attribute__((__progmem__));
#endif

#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

#define FLASH_LIBRARY_VERSION 5
...
ovidiucp commented 9 years ago

About the Intel Edison support. TinyWebServer is designed to run in a memory constraint environment like the Arduino. Edison is a full blown Linux-based system, you can run any web server you want. On BeagleBone, a similarly powerful board made by TI, I've had great success with the Python-based Tornado.

pjalm commented 9 years ago

well i would not even add either library for me, i had to make a src folder, a library.properties file, remove a few other files then it added

pjalm commented 9 years ago

Reason i wanted to try your web server library if to make a web gui thats easy to modify using files on a sd card using arduino code, not node.js or apache etc. All the samples i find are bad, hav files hardcoded and crash a lot.

pjalm commented 9 years ago

btw i did add that to the flash header and still get compile errors

ovidiucp commented 9 years ago

This is not a very helpful bug report. Please list libraries you're trying to use, what code you're trying to compile and what compile errors are you seeing.

pjalm commented 9 years ago

I am simply trying to add Flash and TinyWebServer and can't do even that. When I try to add tem i get a lot of errors.

ovidiucp commented 9 years ago

Can you list the directory structure you have?

What is the Sketchbook location in Arduino IDE's preferences? Do you have a libraries directory inside that directory? Inside the libraries directory do you have the Flash and TinyWebServer directories? Do you see the Flash and TinyWebServer libraries in the Arduino -> Sketch -> Import Library... menu?

Where is your code located?

What compile errors do you see?

pjalm commented 9 years ago

I am on a Mac does that make any difference?

It shows /Users/pjalm/Documents/Arduino, and no they do not apear unless i manually make the properties file and make a src folder.

I think I got Flash one to party work now, just one error now.

In file included from sketch_mar07b.ino:1:0: /Users/pjalm/Documents/Arduino/libraries/Flash/Flash.h: In member function 'char* _FLASH_STRING::copy(char*, size_t, size_t) const': /Users/pjalm/Documents/Arduino/libraries/Flash/Flash.h:83:70: error: 'strncpy_P' was not declared in this scope strcpy_P(to, _arr + offset) : strncpy_P(to, _arr + offset, size); ^