Code Monkey home page Code Monkey logo

fsbrowserng's Introduction

Notice: I (gmag11) do not have the free time to go on developing this project. If you would like to continue with it feel free to make your own fork or ask to be a collaborator. Please understand that I do need time for my job and my family :).

FSBrowserNG

Full autocontained (on SPIFFS) async web server on ESP8266. Written as a Library.

Same features as my FSBrowser sketch but built around AsyncWebServer library and implemented as a library itself. See *.ino file for usage example

  • Add Config capability reuse JSON capability to store generic config items in JSON files on SPIFFS
  • 2FA login, plan to include a google auithenticator libary so one time password can be used, this feature May be added back into orginal project
  • send email on config change or login
  • send SMS via textlocal or nexmo,
    • may try and support tokenised URL
    • may try and support SSL URLs

Introduction

I wanted to add a standard environment for all my ESP8266 based projects to be able to configure them via web browser to avoid code editing when I need to change some settings like SSID, password, etc.

I found John Lassen's WebConfig project to almost fit my needs. It uses a simple but powerful web interface with dynamic data using microAJAX. I've added some dynamic data using Links2004's WebSockets library.

So, I tried to fork it. Original WebConfig project stores web pages on PROGMEM, but I was recently using SPIFFS on ESP8266 and I think it is a good way to store web content. I found I was not the first to think this when I noticed about FSBrowser example in ESP8266WebServer library.

This example code has a great bonus: a text editor (based on ACE) with syntax highligth that can be used to edit html on board directly. I found a bug on it (already sent to esp8266/Arduino repository) and, when fixed, noticed how usefull this editor is.

My code is a fork of both projects, and has become a start framework for my future projects. Finally i've refactored code to use it as a library, so it is easier to integrate it in a project. See this example to check that only 3 lines are necessary to use it.

I only have to add more HTML data and some funtions to show dynamic data in order to adapt it to any other task.

It has integrated NTP syncronization based on my own NTPClient library, that can be configured via this Web interface too.

Configuration is stored on SPIFFS too, in a JSON file. So, it recovers config during boot.

Implemented OTA Update with Arduino IDE and Web interface.

Web access can be protected with Basic HTTP Authentication.

I use a library called ESPAsyncWebServer. It is much faster than standard ESP8266WebServer library due to its async design.

Notice that Basic HTTP Authentication alone is not suitable to protect data over Internet. It allows recovery of user and password via sniffing and does not encrypt data flow. It is valid to give a first protection and may be a good solution combining it with strong VPN. Take this in account when connecting it to public networks or Internet.

WiFi connection

I've implemented a way to turn ESP8266 into AP mode so I can set WiFi config when prior WiFi is not available. It is done by setting IO pin 4 to high status during boot. This pin is configurable by a #define. in FSWebServerlib.h. You must ensure it is connected to GND to allow it to connect to a router.

AP Mode is also started when loadConfig() finds no config file (config.json). This is so to help first use without needind to hardcode user and password. config.json is generated automatically if needed:

{
	"ssid":"YOUR_SSID",
	"pass":"YOUR_PASSWORD",
	"ip":[192,168,1,4],
	"netmask":[255,255,255,0],
	"gateway":[192,168,1,1],
	"dns":[192,168,1,1],
	"dhcp":1,
	"ntp":"es.pool.ntp.org",
	"NTPperiod":5,
	"timeZone":10,
	"daylight":1,
	"deviceName":"ESP8266fs"
}

WiFi connection to router is confirmed via LED on IO pin GPIO02 as soon an IP address is got. Same LED is used to confirm AP mode by flashing 3 times. LED ping can be configured in FSWebServerlib.h.

How to use it

After compile and flash into ESP8266 you need to upload SPIFFS data using download tool for Arduino IDE. Check SPIFFS doc for details.

  • http://ip_address/admin.html takes you to main configuration GUI.
  • http://ip_address/edit contains code editor. Any file stored in SPIFFS may be loaded here and saved using CTRL+S command.
  • http://ip_address/update allows remote update through WEB.
  • http://ip_address/ includes an example info page that shows how to get realtime data from ESP. You may change this to adapt to your project.

You may add your own files to SPIFFS to be served by ESP8266. You only need to add some code if you need dynamic data.

FSBrowserNG extends AsyncWebServer class. So, you may use all its methods as usual.

Dependencies

This library makes use of other libraries you have to include in your Arduino library folder.

All other libraries used are installed in Arduino ESP8266 framework.

Troubleshooting

If the compiler exits with an error similar to "WebHandlers.cpp:67:64: error: 'strftime' was not declared in this scope", follow these steps:

  • Locate folder /Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include
    For windows the path is:
    C:\Users\YOURUSER\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include respectively C:\Users\pzpx6d\Local Settings\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\
  • make a copy of time.h and name it _time.h
  • Locate and open ESPAsyncWebServer\src\WebHandlerImpl.h
  • Replace #include <time.h> to #include <_time.h>

see me-no-dev/ESPAsyncWebServer#60

If the ESP8266 Sketch Data Upload fails with an error similar to "Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: tried to access method", replace the ESP8266FS 0.3.0 plugin by the ESP8266FS 0.2.0 plugin.

Species5618

  • 3 specials folders , with callback to toplevel ino code support, to allow main code to send and recieve data from web without editing library

    • json , get and put JSON data back to main code
    • rest , get and put plain text data to main code
    • post , form post handlers

    Example Provided.

  • added user config features, save configuration data to userconfig.json on the SPIFFS,

    • bool save_user_config(String name, String value);
    • bool load_user_config(String name, String &value);
    • bool save_user_config(String name, int value);
    • bool load_user_config(String name, int &value);
    • bool save_user_config(String name, float value);
    • bool load_user_config(String name, float &value);
    • bool save_user_config(String name, long value);
    • bool load_user_config(String name, long &value);
  • added generic handlers for saving and post user config (1st Nov 2017)

read data example (see user2.html in callback example) /rconfig/user1/user2/user3

will return values user1 , user2 and user3 user1|1|input user2|2|input user3|3|input

for div and chk valuea add 'd_' add 'c_ 'to the url part so /rconfig/user1/d_user2/c_user3 for example might return

user1|1|input user2|222222222222|div user3|1|chk

and /pconfig will save ANY posted form value in the user config file

NOTE this may expose you config, be carefull

TODO

  • HTTP Authentication HTTP Basic authentication implemented. Will try to improve to a more secure mechanism.
  • OTA update via web interface MD5 cheching added.
  • MD5 check of uploaded firmware
  • Configuration protection
  • HTTPS (in evaluation). Not possible with ESP8266
  • Integration of editor in admin.html
  • Convert code to classes and try to design a library to add all this functionality easily.
  • 2-Step authentication

Simple user config

Simple way to add user config using the file userconfigui.json. No need to create or edit html files. See example UserConfigExample2.

Please Let Us know of any good projects based on this library, I wil linclude them in the examples/Otherexmaples.txt file

fsbrowserng's People

Contributors

bauerph avatar darkain avatar flurl avatar gmag11 avatar ivankravets avatar llamontjr avatar species5618 avatar thijse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fsbrowserng's Issues

NTP doesn't work?

I just flashStart Here example on NodeMCU. The date is 1/1/1970 no matter if I set what timezone or interval.

When I add NTP.begin() in void setup() the date is correct and if I change timezone (IP ADDRESS/admin.html -> NTP settings) then it go back to 1970.

Trouble with REST callback

I'm trying to build on the UserConfigExample using the REST callback. I have been able to create userConfig.json and userConfig.html files. When invoked the userConfig.html file displays the correct data from the json file. When I try to modify the data the url updates with the arguments showing the new data values. However the REST callback does not see these arguments. The callback always prints zero arguments.

I am a complete newB when it comes to web programming and not much better with C++. Given an example I can usually figure out how to tailor it to my needs. This example assumes greater web knowledge than I possess!

I have attempted to attach my userConfig.html file (as a text file) for reference.

Here's my callback code:

void  callbackREST(AsyncWebServerRequest *request)
{
  //its possible to test the url and do different things, 
  //test you rest URL
  if (request->url() == "/rest/userConfig")
  {
   printf("# args = %d\n", request->args());  // always returns zero arguments
   if (request->args() > 0)  // Save Settings
    {
        String data;
        Serial.println("Updating user configuration parameters");
        for (uint8_t i = 0; i < request->args(); i++) {
            if (request->argName(i) == "mqttUser") {
                data = ESPHTTPServer.urldecode(request->arg(i));
                printf("mqttUser = %s\n", data.c_str());
                ESPHTTPServer.save_user_config("mqttUser", data);
                continue;
            }
            if (request->argName(i) == "mqttPass") {
                data = ESPHTTPServer.urldecode(request->arg(i));
                printf("mqttPass = %s\n", data.c_str());
                ESPHTTPServer.save_user_config("mqttUser", data);
                continue;
            }
            /*if (request->argName(i) == "tz") {
                _config.timezone = request->arg(i).toInt();
                NTP.setTimeZone(_config.timezone / 10);
                continue;
            }
            if (request->argName(i) == "dst") {
                _config.daylight = true;
                DEBUGLOG("Daylight Saving: %d\r\n", _config.daylight);
                continue;
            }*/
        }
    }

    //contruct and send and desired repsonse
    // get sample data from json file
    String values = "mqttUser|"+ mqttUser +"|input\n";
    values += "mqttPass|"+ mqttPass +"|input\n";
    request->send(200, "text/plain", values);
    Serial.println(values);
    values = "";

  } else if (request->url() == "/rest/user") 
  {
    String data = "data1";
    //ESPHTTPServer.load_user_config("user1", data);
    String values = "user1|"+ data +"|input\n";

    //ESPHTTPServer.load_user_config("user2", data);
    data = "data2";
    values += "user2|" + data + "|input\n";

    //ESPHTTPServer.load_user_config("user3", data);
    data = "data3";
    values += "user3|" + data + "|input\n";
    request->send(200, "text/plain", values);
    Serial.println(values);
    values = "";
  }
  else 
  { 
    //its possible to test the url and do different things, 
    String values = "message:Hello world! \nurl:" + request->url() + "\n";
    request->send(200, "text/plain", values);
    values = "";
  }
}

userConfig.txt

Conflict with new version of ESPAsyncWebServer

Hello,

after installing Arduino IDE with all the libraries to a new PC I could not compile the demo application any more. I have discovered that the problem is in the latest version of ESPAsyncWebServer. I have dowloaded the bab5457 version of it as of Jan 22, 2017 and after the hack with time.h the project compiles without errors.

Regards

Jiri

Compile prob: WiFiEventHandler' does not name a type

i installed all the libraries and try to compile the example but i get the error below.
Am i missing something ??

thanks in advance

ghislain

D:\Electronica\FsBrowserNG\src/FSWebServerLib.h:85:5: error: 'WiFiEventHandler' does not name a type
WiFiEventHandler onStationModeConnectedHandler, onStationModeDisconnectedHandler;
^
D:\Electronica\FsBrowserNG\src/FSWebServerLib.h:105:26: error: 'WiFiEventStationModeConnected' has not been declared
void onWiFiConnected(WiFiEventStationModeConnected data);
^
D:\Electronica\FsBrowserNG\src/FSWebServerLib.h:106:29: error: 'WiFiEventStationModeDisconnected' has not been declared
void onWiFiDisconnected(WiFiEventStationModeDisconnected data);

callback_example upload is fine but it gets a reset after GotIp address

Hi, I like to test the callback example and it compiles well and the upload to a esp8266-12F works fine. I start the esp to config, that works also. But then I see on the serial monitor the connection to the router and it shows the GotIp Address 192.168.1.5 like I have set it in the config. Then it dumps and reset esp. That goes on and on. Do you have a advice what I did wrong?
Thanks
Peter

Not connecting to WIFI correctly

raising this mainly as a discussion point , and collect information

i recently rebuilt my laptop, and fully updated all the libraries
esp8266 2.4.0 and all the latest Async ESPWebserver libraries

now almost every time the device connects to wifi, gets an IP address, and pings,
but the code is convinced the connection is not working , so sits in the

while (!WiFi.isConnected()) {
    delay(1000);
    DBG_OUTPUT_PORT.print(".");
}

loops at line 580 in FSWebServerLib.cpp

i have compiled the sample asyncwebserver sample which runs with out issue
so i think that is a subtle change i the wifi event handling

more to follow

How to pick up additional setup data from HTML

To the config.html form in the UserConfig example I added to config.html a form line:

This is to pick up a Wunderground API key. How to I pick this value up in the sketch? I am confused on how your code works, I guess.

warning: 'const char* ArduinoJson::JsonVariantBase<TImpl>::asString() const [with TImpl = ArduinoJson::JsonObjectSubscript<const char*>]' is deprecated

Got below warnings during compilation:

sketch\FSWebServerLib.cpp: In member function 'bool AsyncFSWebServer::loadHTTPAuth()':

sketch\FSWebServerLib.cpp:363:51: warning: 'const char* ArduinoJson::JsonVariantBase<TImpl>::asString() const [with TImpl = ArduinoJson::JsonObjectSubscript<const char*>]' is deprecated (declared at D:\minida28\Dropbox\Arduino\Sketch\libraries\ArduinoJson/include/ArduinoJson/Deserialization/../JsonVariantBase.hpp:36): use as<char*>() instead [-Wdeprecated-declarations]

     _httpAuth.wwwUsername = json["user"].asString();

                                                   ^

sketch\FSWebServerLib.cpp:364:51: warning: 'const char* ArduinoJson::JsonVariantBase<TImpl>::asString() const [with TImpl = ArduinoJson::JsonObjectSubscript<const char*>]' is deprecated (declared at D:\minida28\Dropbox\Arduino\Sketch\libraries\ArduinoJson/include/ArduinoJson/Deserialization/../JsonVariantBase.hpp:36): use as<char*>() instead [-Wdeprecated-declarations]

     _httpAuth.wwwPassword = json["pass"].asString();

As advised by the warning above, I simply change on these lines on FSWebServerLib.cpp file:

    _httpAuth.wwwUsername = json["user"].asString();
    _httpAuth.wwwPassword = json["pass"].asString();

to this

    _httpAuth.wwwUsername = json["user"].as<char*>();
    _httpAuth.wwwPassword = json["pass"].as<char*>();

No more warnings.

I was on:

  • Arduino IDE 1.8.1
  • FSBrowserNG master
  • ArduinoJSON 5.8.3

Maybe not really an issue but I just don't know if there will be side effects to this library by doing the changes above.

Thanks for the great library though!

ESP8266 not entering into AP mode

Hello
I understand AP mode would be to generate his own SSID and password, the default parameters are inside the code. Unfortunately, my ESP runs into infinite loop (UART output sending constantly strange signs) when I bridge the digital input that should put the module into AP mode.

I would understand I can configure my module with my own router parameters once I am in AP mode with the module which is what I will do during the next step.

Could you please help me to understand what maybe wrong ?
To be mentioned that without putting the module in AP mode with the bridge, I get . (dots) on the UART port.
Kind regards Rolfz

How to enable DEBUG throughout

Thank you for some wonderful programming!
I am actively playing with this code, trying to learn how it works..
I can't seem to figure out how to turn on DEBUG so I can see all the DBG_OUTPUT_PORT statements..
I have remarked out #define RELEASE, as per the comment..

I have also enabled debug with ALL in the arduino environment during compile time .. I'm getting debug from the ESP framework.. but not from FSBrowserNG..

Any help would be greatly appreciated as this would drastically speed up my learning..

Thanks again!

Force Download from ESP8266

Hi... I have a working FTP client on the ESP8266 that I can call a FTP server and request a file... Similar to this.. http://www.rudiswiki.de/wiki9/WiFiFTPServer.... It works but I am working on improving the speed for downloads...
With the FSBrowser how can I force to download a file from the ESP8266 side... vs using the /edit browser on a local computer..?

Can't enter AP mode

Hi

This project looks very interesting and I would love to get started playing with it.
I struggle a little bit with your simplest example "StartHere"

All files compilte in the PlatformIO just fine, the "data" folder is added to the project and I see that it's uploaded to the ESP when compiling.
I never get to the AP-point mode.
The serial output just keeps "Attemping WiFi***********" forever.

I have tried to put the GPIO-4 pin high/low and re-power the module with the same result.
IS this the GPIO? or a different pin? I use a NodeMCU v1 ESP12e.
#define AP_ENABLE_BUTTON 4 // Button pin to enable AP during startup for configuration. -1 to disable

platformio.ini
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps =
https://github.com/gmag11/FSBrowserNG
https://github.com/PaulStoffregen/Time
https://github.com/gmag11/NtpClient
https://github.com/me-no-dev/ESPAsyncTCP
https://github.com/me-no-dev/ESPAsyncWebServer
https://github.com/bblanchon/ArduinoJson
monitor_baud = 115200
targets = buildfs, uploadfs

Br
Michael Stjerna

Basic example "StartHere" won't compile

Hello,

I'm trying to run this awesome library but i get huge error message in Arduino IDE as well in VSCode PlatformIO. I don't know if this is right place for such question but i did not find any other place to post this.

Here is error message from Arduino IDE: https://pastebin.com/byiDe5Ue
It is quite long and i don't completely understand it. My only guess is that it have something to do with libraries.
I downloaded every library mentioned in dependencies section as ZIP file, unpacked, and pasted into Arduino IDE installation folder (arduino-1.8.1/libraries).

And here error for VSCode: https://pastebin.com/nCXXF86e
In VSCode i did it twice, first time from PlatformIO manager and then manually (pasted libraries folders as above but into lib folder of PlatformIO). Both attempts failed.

What i'm doing wrong? Or this is just problem with newer versions of some libraries? If so, maybe someone could provide me with full package of needed libraries that you are using and they are working just fine?

Cheers!

Error: strftime not declared in this scope

When I try to compile your example, it says that strftime, gmtime, and time are not declared in this scope. I saw where a few weeks ago you recommended manually installing the esp8266 boards, but this made no difference. Do you have any other ideas? Thanks.
UPDATE: Reinstalled and got it working.

Libraries versions

Hi there,

First off, great job you've done here. Congrats.

I couldn't get this this project to work. I strongly believe that is because of libraries versions. I've had lots of problems with this sort of things in past projects of mine. Would it be possible for you to make available the libraries that you used in this project? I know that all the libs are available on GitHub, but to get all of them in the same version you build this project is gonna be a pain.

If you could do so, I'd really much appreciate it.

Thanks.

Example graphs don't work on Safari (macos)

It appears that Safari doesn't decompress the gz even though the response headers say the content is gzip encoded. Works fine on firefox and chrome.

Here's what Safari thinks the contents of graph.js are:

captura de pantalla 2017-07-16 a las 23 35 47

Full view of the web developer panel, right columns shows headers:

captura de pantalla 2017-07-16 a las 23 37 35

Async Webserver becomes unresponsive

edit - I revised this post substantially. I initially thought this was a Safari problem..

I have encountered several situations where the browser stops responding. LOOP() continues to run fine but the browser is not reachable..

I just about have my Wunderground sketch running properly. It plots actual temp from a sensor along with forecasts. Here's a version that does not use FSBrowser: http://orangecaweather.duckdns.org:8021

In the FSB version I am exposed so I am not giving the link to it!

Right now I am running my sketch after recompiling with ESP8266 RC2 to see if that maters. It looks to my uneducated eyes like there have been a lot of changes that could affect web service. edit - no change :(

If I still have Webserver problems with RC2 my next attempt to fix the problem will be to have the device ping its own IP within LOOP() and restart if it fails.

if ((millis() - currentLoop) > pingTest) {
currentLoop = millis();
if (Ping.ping(WiFi.localIP()), 1) {
//if (Ping.ping(remote_host)) {
Serial.print("ping Success!! Ping Time (mS) = "); Serial.println(Ping.averageTime());
} else {
Serial.println("ping Error :(");
ESP.restart();

}

}

Thoughts?

Bill

Retrieve DST and time Zone into sketch

Is there a simple way to retrieve the Time Zone and DST flag into my sketch? I could use a user data field but then the user would be entering the same information twice,

SSL support

Hi there, I've noticed that in readme You wrote that HTTPS isn't supported.
In similar project (Espurna) I found some interesting methods https://github.com/xoseperez/espurna/blob/master/code/espurna/web.ino#L330

#if ASYNC_TCP_SSL_ENABLED & WEB_SSL_ENABLED
    _server->onSslFileRequest(_onCertificate, NULL);
    _server->beginSecure("server.cer", "server.key", NULL);
#else
    _server->begin();
#endif

It look like ESPAsyncWebServer supports SSL.
Maybe this can be added to Your project?

Did You solve 2 Factor Authentication? It would be awesome to have this supported via Google Authenticator App.

example of dynamic web page with input and output

Hello

i keep fighting with this.
Is it possible to include an example of a dynamic webpage with the coding to put the data on that page.
I want to enter 2 values (calibration) and to show the temperature of 2 sensors in 1 page.
It should be simple but i am not getting there.

Any help would be aprreciated;

WiFiEventHandler not a type???

hi,
I was trying to compile the sketch and received this error

\libraries\FSBrowserNG-master/FSWebServerLib.h:84:5: error: 'WiFiEventHandler' does not name a type

 WiFiEventHandler onStationModeConnectedHandler, onStationModeDisconnectedHandler;

How can I resolve this issue?

Thanks.

Can't get STA to work with "StartHere" example

I'm able to switch to AP by putting pin 4 to ground. In AP mode, I can see the webpages and set WIFI config. However, when I try to boot in STA mode, I can't get it to work at all. The ESP (nodemcu) gets an IP from my router but I can't connect to it or ping it. When I debug to serial, it looks like it gets the IP but then goes into an endless ...................

I also get a WDT reboot after hitting save for the wifi config in AP mode but it does save the configuration.

serial:

[hostByName] request IP for: us.pool.ntp.org
[hostByName] Host: us.pool.ntp.org lookup error: -6!
wifi evt: 0
wifi evt: 3
[hostByName] request IP for: us.pool.ntp.org
[hostByName] Host: us.pool.ntp.org IP: 66.85.74.226
wifi evt: 1
STA disconnect: 8
...wifi evt: 0
.............

NTP doesn't fire events when you leave the index page.

I'm trying to do some time sensitive calculations. My calculations are to calibrate an RTC using NTP.
I'm finding the NTP events are only firing while I have the graphs page open. Once I change pages, it disables the events. How to I keep the NTP events firing?

Here is a snippet of code taken from my modified AsyncFSWebserver::begin

if (_config.updateNTPTimeEvery > 0) { // Enable NTP sync
NTP.begin(_config.ntpServerName, _config.timezone / 10, _config.daylight);
NTP.setInterval(15, _config.updateNTPTimeEvery * 60);
NTP.onNTPSyncEvent ([&](NTPSyncEvent_t event) {
ntpEvent = event;
syncEventTriggered = true;
});
}

This works as long as I'm looking at the web page. (ie /events)

Once I leave that page (or close it) the events stop completely, including the NTP event..

DST button in NTP Settings

For users in the USA does the Daylight Savings Time button do anything? I am in PST and I have the DST button clicked. The offset from UTC is set to -8 (correct). I would have expected the button to increase it to -7.

how to disable Authentication? (Logout)

I can see where it uses MD5 hash to check authentication for HTTP Auth, Wifi AP mode, and OTA..

My question is, once a password has been entered correctly, how do I clear the credentials?
ie: Logout support?

warning: no matching function for call to 'HardwareSerial::printf(const String&)' in DEBUG mode

Got this warning during compilation if I comment out the #define RELEASE (aka DEBUG mode) in the header file:
no matching function for call to 'HardwareSerial::printf(const String&)'

In file included from sketch\FSWebServerLib.cpp:6:0:

sketch\FSWebServerLib.cpp: In member function 'void AsyncFSWebServer::send_network_configuration_html(AsyncWebServerRequest*)':

FSWebServerLib.h:29: error: no matching function for call to 'HardwareSerial::printf(const String&)'

 #define DEBUGLOG(...) DBG_OUTPUT_PORT.printf(__VA_ARGS__)

                                                         ^

sketch\FSWebServerLib.cpp:836:9: note: in expansion of macro 'DEBUGLOG'

         DEBUGLOG(request->url());

         ^

sketch\FSWebServerLib.h:29:57: note: candidate is:

 #define DEBUGLOG(...) DBG_OUTPUT_PORT.printf(__VA_ARGS__)

                                                         ^

sketch\FSWebServerLib.cpp:836:9: note: in expansion of macro 'DEBUGLOG'

         DEBUGLOG(request->url());

         ^

In file included from C:\Users\minida28\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Stream.h:26:0,

                 from C:\Users\minida28\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/HardwareSerial.h:31,

                 from C:\Users\minida28\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:245,

                 from sketch\FSWebServerLib.h:7,

                 from sketch\FSWebServerLib.cpp:6:

C:\Users\minida28\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:66:16: note: size_t Print::printf(const char*, ...)

         size_t printf(const char * format, ...)  __attribute__ ((format (printf, 2, 3)));

                ^

C:\Users\minida28\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:66:16: note:   no known conversion for argument 1 from 'const String' to 'const char*'

I temporarily workaround it by commenting out line 836 in .cpp file:

// DEBUGLOG(request->url());

Thanks!

UserConfigExample will not compile using v2.4.0

Using the Wemos D1 board and the new ESP8266 update from v2.3.0 to v2.4.0 the example above will no longer compile. See below.


Build options changed, rebuilding all
C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:113:36: error: macro "ip_route" requires 2 arguments, but only 1 given

netif* interface = ip_route(&addr);

                                ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp: In constructor 'AsyncClient::AsyncClient(tcp_pcb*)':
C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:77:28: error: invalid conversion from 'int8_t ()(void, tcp_pcb*, pbuf*, int8_t) {aka signed char ()(void, tcp_pcb*, pbuf*, signed char)}' to 'tcp_recv_fn {aka long int ()(void, tcp_pcb*, pbuf*, long int)}' [-fpermissive]

 tcp_recv(_pcb, &_s_recv);

                        ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:357:18: error: initializing argument 2 of 'void tcp_recv(tcp_pcb*, tcp_recv_fn)' [-fpermissive]

void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:78:28: error: invalid conversion from 'int8_t ()(void, tcp_pcb*, uint16_t) {aka signed char ()(void, tcp_pcb*, short unsigned int)}' to 'tcp_sent_fn {aka long int ()(void, tcp_pcb*, short unsigned int)}' [-fpermissive]

 tcp_sent(_pcb, &_s_sent);

                        ^

n file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:358:18: error: initializing argument 2 of 'void tcp_sent(tcp_pcb*, tcp_sent_fn)' [-fpermissive]

void tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:79:28: error: invalid conversion from 'void ()(void, int8_t) {aka void ()(void, signed char)}' to 'tcp_err_fn {aka void ()(void, long int)}' [-fpermissive]

 tcp_err(_pcb, &_s_error);

                        ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:359:18: error: initializing argument 2 of 'void tcp_err(tcp_pcb*, tcp_err_fn)' [-fpermissive]

void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:80:31: error: invalid conversion from 'int8_t ()(void, tcp_pcb*) {aka signed char ()(void, tcp_pcb*)}' to 'tcp_poll_fn {aka long int ()(void, tcp_pcb*)}' [-fpermissive]

 tcp_poll(_pcb, &_s_poll, 1);

                           ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:362:18: error: initializing argument 2 of 'void tcp_poll(tcp_pcb*, tcp_poll_fn, u8_t)' [-fpermissive]

void tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp: In member function 'bool AsyncClient::connect(IPAddress, uint16_t)':

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:113:22: error: 'ip_route' was not declared in this scope

netif* interface = ip_route(&addr);

                  ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:128:25: error: invalid conversion from 'void ()(void, int8_t) {aka void ()(void, signed char)}' to 'tcp_err_fn {aka void ()(void, long int)}' [-fpermissive]

tcp_err(pcb, &_s_error);

                     ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:359:18: error: initializing argument 2 of 'void tcp_err(tcp_pcb*, tcp_err_fn)' [-fpermissive]

void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp: In member function 'AsyncClient& AsyncClient::operator=(const AsyncClient&)':

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:166:28: error: invalid conversion from 'int8_t ()(void, tcp_pcb*, pbuf*, int8_t) {aka signed char ()(void, tcp_pcb*, pbuf*, signed char)}' to 'tcp_recv_fn {aka long int ()(void, tcp_pcb*, pbuf*, long int)}' [-fpermissive]

 tcp_recv(_pcb, &_s_recv);

                        ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:357:18: error: initializing argument 2 of 'void tcp_recv(tcp_pcb*, tcp_recv_fn)' [-fpermissive]

void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:167:28: error: invalid conversion from 'int8_t ()(void, tcp_pcb*, uint16_t) {aka signed char ()(void, tcp_pcb*, short unsigned int)}' to 'tcp_sent_fn {aka long int ()(void, tcp_pcb*, short unsigned int)}' [-fpermissive]

 tcp_sent(_pcb, &_s_sent);

                        ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:358:18: error: initializing argument 2 of 'void tcp_sent(tcp_pcb*, tcp_sent_fn)' [-fpermissive]

void tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:168:28: error: invalid conversion from 'void ()(void, int8_t) {aka void ()(void, signed char)}' to 'tcp_err_fn {aka void ()(void, long int)}' [-fpermissive]

 tcp_err(_pcb, &_s_error);

                        ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:359:18: error: initializing argument 2 of 'void tcp_err(tcp_pcb*, tcp_err_fn)' [-fpermissive]

void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:169:31: error: invalid conversion from 'int8_t ()(void, tcp_pcb*) {aka signed char ()(void, tcp_pcb*)}' to 'tcp_poll_fn {aka long int ()(void, tcp_pcb*)}' [-fpermissive]

 tcp_poll(_pcb, &_s_poll, 1);

                           ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:362:18: error: initializing argument 2 of 'void tcp_poll(tcp_pcb*, tcp_poll_fn, u8_t)' [-fpermissive]

void tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp: In member function 'int8_t AsyncClient::_connected(void*, int8_t)':

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:290:28: error: invalid conversion from 'int8_t ()(void, tcp_pcb*, pbuf*, int8_t) {aka signed char ()(void, tcp_pcb*, pbuf*, signed char)}' to 'tcp_recv_fn {aka long int ()(void, tcp_pcb*, pbuf*, long int)}' [-fpermissive]

 tcp_recv(_pcb, &_s_recv);

                        ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:357:18: error: initializing argument 2 of 'void tcp_recv(tcp_pcb*, tcp_recv_fn)' [-fpermissive]

void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:291:28: error: invalid conversion from 'int8_t ()(void, tcp_pcb*, uint16_t) {aka signed char ()(void, tcp_pcb*, short unsigned int)}' to 'tcp_sent_fn {aka long int ()(void, tcp_pcb*, short unsigned int)}' [-fpermissive]

 tcp_sent(_pcb, &_s_sent);

                        ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:358:18: error: initializing argument 2 of 'void tcp_sent(tcp_pcb*, tcp_sent_fn)' [-fpermissive]

void tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:292:31: error: invalid conversion from 'int8_t ()(void, tcp_pcb*) {aka signed char ()(void, tcp_pcb*)}' to 'tcp_poll_fn {aka long int ()(void, tcp_pcb*)}' [-fpermissive]

 tcp_poll(_pcb, &_s_poll, 1);

                           ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:362:18: error: initializing argument 2 of 'void tcp_poll(tcp_pcb*, tcp_poll_fn, u8_t)' [-fpermissive]

void tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval);

              ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp: At global scope:

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:451:6: error: prototype for 'void AsyncClient::_dns_found(ip_addr_t*)' does not match any in class 'AsyncClient'

void AsyncClient::_dns_found(ip_addr_t *ipaddr){

  ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:24:0:

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.h:94:10: error: candidate is: void AsyncClient::_dns_found(ip_addr*)

 void _dns_found(struct ip_addr *ipaddr);

      ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:468:6: error: prototype for 'void AsyncClient::_s_dns_found(const char*, ip_addr_t*, void*)' does not match any in class 'AsyncClient'

void AsyncClient::_s_dns_found(const char *name, ip_addr_t *ipaddr, void *arg){

  ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:24:0:

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.h:100:17: error: candidate is: static void AsyncClient::_s_dns_found(const char*, ip_addr*, void*)

 static void _s_dns_found(const char *name, struct ip_addr *ipaddr, void *arg);

             ^

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp: In member function 'void AsyncServer::begin()':

C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:839:30: error: invalid conversion from 'int8_t ()(void, tcp_pcb*, int8_t) {aka signed char ()(void, tcp_pcb*, signed char)}' to 'tcp_accept_fn {aka long int ()(void, tcp_pcb*, long int)}' [-fpermissive]

tcp_accept(_pcb, &_s_accept);

                          ^

In file included from C:\Users\William\Documents\Arduino\libraries\ESPAsyncTCP-master\src\ESPAsyncTCP.cpp:27:0:

C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include/lwip/tcp.h:360:18: error: initializing argument 2 of 'void tcp_accept(tcp_pcb*, tcp_accept_fn)' [-fpermissive]

void tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept);

              ^

Multiple libraries were found for "Ticker.h"
Used: C:\Users\William\Documents\Arduino\libraries\Ticker
Not used: C:\Users\William\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.0\libraries\Ticker
exit status 1
Error compiling for board WeMos D1 R2 & mini.

AP fallback if SSID timeout?

Hi,
This looks VERY interesting, BUT I find it odd that you don't have implemented a feature that sets the wifi in AP mode if it fails to connect to the stored SSID.
Wouldn't it be 'easy' and very useful to add this functionality?

Thanks,
Mikkel

Handling mis-typed WiFi credentials

When booting into AP mode and no config.json is found, and a user typo's the WiFi credentials, how would a user recover? Thinking of a case where the 8266 was configured and sent to the end-user with the expectation of bootstrapping upon first power-up.

Currently, from testing, the unit writes config.json with incorrect data and proceeds into an endless STA_DISCONNECTED state (at least for 743seconds so far). Does this ever time out and revert back to AP mode? How long does it take?

Second, same scenario when no config.json is found, if a user changes the unit name in general.html a reset is performed. The issue is config.json is written out and contains garbage WiFi connection data, so the unit has a name but never comes online to WiFi. What is the design to recover from this case?

Request : Source of graphs.js

Hi,

Thanks for this magnificent development. I am using this as a starting point for all of my projects relating to esp8266. However, I would like to enhance the graphs.js since I am not able to find a minimalistic graphing javascript library with such a small size relevant for these project. Can you point me where can you get the source for this graphs.js code?

debug output problem.

When I comment the RELEASE define to enable debug output ,I find an error
no matching function for call to 'HardwareSerial::printf(const String&)'
how can I make this work ? thx.

using analogRead(A0); in loop causes failure

Hi Germán,
FSBrowserNG is working for me on a nodemcu v1.0 using the libraries you have specified and the most recent arduino IDE. However when I added some code in the loop it failed. The error seems related to using analogRead(A0) in my code, as it vanishes if I don't use it and generate random data. I can recreate the problem simply with just this code at the start of the main loop:
int n = analogRead(A0);

I found that if I slow down the analogRead to once every 2ms, the problem goes away. However I would
like to sample faster than 500 Hz.

WifiLEDerror.txt
Thanks

Regards, Bill

How to add own sensor

Hello Germán.

First of all - great library. Thank you for it.

I am a newbie to both C++ and Arduino so it gave me quite some time to understand how it works. Now I think I have a rough idea. I wanted to add my own sensors to the code. As I understood the JSON on URL /all returns the value of the analog input + all GPIOs. I wanted to add something slightly more complex like digital thermometer.

I tried to add following code into the setup():

ESPHTTPServer.on("/temperature", HTTP_GET, [ESPHTTPServer](AsyncWebServerRequest *request) { sensors.requestTemperatures(); String json = "{\"temp\":"+String(sensors.getTempCByIndex(0))+"}"; request->send(200, "text/json", json); json = String(); });

Unfortunately on compile I get following error:

FSBrowserNG:35: error: 'AsyncWebServer' is not an accessible base of 'AsyncFSWebServer'

After some googling I have found a solution by modifing FSWebServerLib.h line

class AsyncFSWebServer : AsyncWebServer {

to

class AsyncFSWebServer : public AsyncWebServer {

That modification helped, the project compiles successfully and gives expected results.

My question is whether I can achieve the same without modifying the library.

Regards

Jiri

FSWebServerLib.cpp:363:51: warning: 'const char* ArduinoJson::JsonVariantBase<TImpl>::asString()

Hej I am trying to use you FSBrowserNG.ino i am using Arduino IDE 1.8.1 with ESP8266 version 2.3.0
and selected NodeMCU 1.0 board but yhise errors when compiling
/home/sekt/Arduino/libraries/FSBrowserNG-master/FSWebServerLib.cpp:363:51: warning: 'const char* ArduinoJson::JsonVariantBase::asString() const [with TImpl = ArduinoJson::JsonObjectSubscript<const char*>]' is deprecated (declared at /home/sekt/Arduino/libraries/ArduinoJson-master/include/ArduinoJson/Deserialization/../JsonVariantBase.hpp:36): use as<char*>() instead [-Wdeprecated-declarations]
_httpAuth.wwwUsername = json["user"].asString();
^
/home/sekt/Arduino/libraries/FSBrowserNG-master/FSWebServerLib.cpp:364:51: warning: 'const char* ArduinoJson::JsonVariantBase::asString() const [with TImpl = ArduinoJson::JsonObjectSubscript<const char*>]' is deprecated (declared at /home/sekt/Arduino/libraries/ArduinoJson-master/include/ArduinoJson/Deserialization/../JsonVariantBase.hpp:36): use as<char*>() instead [-Wdeprecated-declarations]
_httpAuth.wwwPassword = json["pass"].asString();
^
/home/sekt/Arduino/libraries/FSBrowserNG-master/FSWebServerLib.cpp: In member function 'void AsyncFSWebServer::handleFileCreate(AsyncWebServerRequest*)':
/home/sekt/Arduino/libraries/FSBrowserNG-master/FSWebServerLib.cpp:571:33: error: call of overloaded 'arg(int)' is ambiguous
String path = request->arg(0);
^
/home/sekt/Arduino/libraries/FSBrowserNG-master/FSWebServerLib.cpp:571:33: note: candidates are:
In file included from /home/sekt/Arduino/libraries/FSBrowserNG-master/FSWebServerLib.h:17:0,
from /home/sekt/Arduino/libraries/FSBrowserNG-master/FSWebServerLib.cpp:6:
/home/sekt/Arduino/libraries/ESPAsyncWebServer-master/src/ESPAsyncWebServer.h:246:19: note: const String& AsyncWebServerRequest::arg(const String&) const
const String& arg(const String& name) const; // get request argument value by name
and more of the same.

do you have an idea what to change

SEK. Thomsen

Crashes on saving config

Hello!

First thanks for that wonderful lib. It's exactly what I needed. :-)

But I stumbled upon a few crashes, which were related to sending Page_WaitAndReload and Page_Restart to the browser. As both are stored in PROGMEM replacing request->send with request->send_P solved the first crashes and made saving the config possible.

The second kind of crash was due to the use of delay() in AsyncFSWebServer::send_network_configuration_html() and AsyncFSWebServer::restart_esp().

I'm new to ESP8266 programming but if I understand correctly, delay() shouldn't be used within a handler. At least removing those two delay() calls fixed it for me.

"DBG_OUTPUT_PORT Serial" Not working

I have the following settings:

Arduino IDE: 1.8.5
esp8266 v2.4.0
Board: NodeMCU 1.0 (ESP-12E Module)
Debug Port: Serial
Debug Level: CORE+WIFI+HTTP_UPDATE+UPDATER+OTA

void setup() {
    Serial.begin(115200);  // added this line.
    SPIFFS.begin(); 
    ESPHTTPServer.begin(&SPIFFS);
}

Changed FSWebServerLib.h as follows:

// #define RELEASE  // Comment to enable debug output
#define DBG_OUTPUT_PORT Serial

#ifndef RELEASE
#define DEBUGLOG(...) DBG_OUTPUT_PORT.printf(__VA_ARGS__)
#else
#define DEBUGLOG(...)
#endif

I am compiling StartHere.ino example and getting the following error:

In file included from C:\Users\Umar\Documents\Arduino\libraries\FSBrowserNG-master\src\FSWebServerLib.cpp:8:0:

C:\Users\Umar\Documents\Arduino\libraries\FSBrowserNG-master\src\FSWebServerLib.cpp:
In member function void AsyncFSWebServer::post_rest_config(AsyncWebServerRequest*):

C:\Users\Umar\Documents\Arduino\libraries\FSBrowserNG-master\src\FSWebServerLib.h:29:57:
error: no matching function for call to HardwareSerial::printf(const String&)

#define DEBUGLOG(...) DBG_OUTPUT_PORT.printf(__VA_ARGS__)
^

I have also tried with following settings:

Debug Port: Disabled
Debug Level: None
Not initializing Serial.begin() in the setup().

I still get the same error. Please help!!

Debug Output Error

Hi, thanks in advance for this project.
I have some questions.
First one: When I comment RELEASE line, and compile pop up error with printf not being a member of StreamString.h I dont know how to fix it.
Second one: what files or folders should be loaded to ESP8266 FS?
Third one : Once it boots up in AP mode. Which is the default IP address assigned to connect and configure ?

Thanks again.

Not all data filled in on info page

Before I start playing Sorcerer's Apprentice, I think I will ask :)

Here's what I get on the bottom of the info page. All else is fine. I am at a loss to figure what could be wrong. In my sketch NTP time works just fine with function calls to NTP.gettime() . As you can see Uptime is okay and so is Last Sync.

NTP Date: 01/01/1970
NTP Time: 00:25:43
Last sync: 14:18:10 22/11/2017
Uptime: 0 days 00:25:43
Last boot: 00:00:00 01/01/1970

Any ideas on where to start troubleshooting this?

Bill

Compile fails....

I don't quite understand what this issue is.. I get this error:

C:\Users\SB 55\Documents\Arduino\libraries\ESPAsyncWebServer-master\src\WebHandlers.cpp:78:25: error: 'time' was not declared in this scope

if(time(&last_modified) == 0) //time is not yet set

any ideas?

Not an issue, just a request

Hello gmag11,

First off, this is a fantastic project, it works beautifully when it comes to serving HTML files and it is very fast. Secondly, I'm relatively new to this and I don't know where else to ask this question so I'll put it here:

Can you maybe add some functionality to the main page along with some explanations? It's nice to read the status of the analog input and the GPIO pins, but do you think that you can have a write example in there somewhere as well?

This is a really complex project for a beginner like me, and it would really help a lot if you could add some more examples and support. Right now I can't even find the code you are using to read the status of the GPIO pins, and if you could add a simple button to turn on and off one of the pins, along with an explanation of how you did so, that would help a lot of people I'm sure!

Thanks! (Feel free to move this to wherever it needs to go)

IP address is 0.0.0.0 on serial output on Starthere

I can compile starthere and use it but there is no output of the IP address for the connection to the site onboard. I have to use the network watcher to see what ip address is added and use then that one.
Is there a way to see the address on serial output or somewere else?
Many thanks

call of overloaded 'arg(int)' is ambiguous

i get this error:
:|

_Arduino: 1.8.1 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, QIO, 115200, 4M (3M SPIFFS), nodemcu, Disabled, None"

sketch\FSWebServerLib.cpp: In member function 'void AsyncFSWebServer::handleFileCreate(AsyncWebServerRequest*)':

FSWebServerLib.cpp:571: error: call of overloaded 'arg(int)' is ambiguous

 String path = request->arg(0);

                             ^

sketch\FSWebServerLib.cpp:571:33: note: candidates are:

In file included from sketch\FSWebServerLib.h:17:0,

             from sketch\FSWebServerLib.cpp:6:

..\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:246:19: note: const String& AsyncWebServerRequest::arg(const String&) const

 const String& arg(const String& name) const; // get request argument value by name

               ^

..\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:247:19: note: const String& AsyncWebServerRequest::arg(const __FlashStringHelper*) const

 const String& arg(const __FlashStringHelper * data) const; // get request argument value by F(name)    

               ^

..\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:248:19: note: const String& AsyncWebServerRequest::arg(size_t) const

 const String& arg(size_t i) const;           // get request argument value by number

               ^

sketch\FSWebServerLib.cpp: In member function 'void AsyncFSWebServer::handleFileDelete(AsyncWebServerRequest*)':

FSWebServerLib.cpp:590: error: call of overloaded 'arg(int)' is ambiguous

 String path = request->arg(0);

                             ^

sketch\FSWebServerLib.cpp:590:33: note: candidates are:

In file included from sketch\FSWebServerLib.h:17:0,

             from sketch\FSWebServerLib.cpp:6:

..\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:246:19: note: const String& AsyncWebServerRequest::arg(const String&) const

 const String& arg(const String& name) const; // get request argument value by name

               ^

..\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:247:19: note: const String& AsyncWebServerRequest::arg(const __FlashStringHelper*) const

 const String& arg(const __FlashStringHelper * data) const; // get request argument value by F(name)    

               ^

..\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:248:19: note: const String& AsyncWebServerRequest::arg(size_t) const

 const String& arg(size_t i) const;           // get request argument value by number

               ^

exit status 1
call of overloaded 'arg(int)' is ambiguous

intermittent wiFi connection issues

I was having a less then 1 in 4 WiFi connection success , from either cold boot, warm reset or upload

in my fork (not yet commited) i have changed to (which seem to fix the issue)

void AsyncFSWebServer::configureWifi() {
WiFi.disconnect();
WiFi.mode(WIFI_STA);
//currentWifiStatus = WIFI_STA_DISCONNECTED;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.