1. 08 Nov, 2016 2 commits
    • Arnim Läuger's avatar
    • Jason Follas's avatar
      Eus channelfix (#1583) · 058777ea
      Jason Follas authored
      Squashed commits included:
      
      Bug fixes and final implementation
      - Added Content-Length: 0 to all headers
      - Endpoint name checks not using trailing space so cache-busting techniques can be used (i.e., append a nonce to the URL)
      - Track when connecting so APList scan doesn't take place during (which changes the channel)
      - More debugging output added to assist in tracking down some issues
      
      Added /status.json endpoint for phone apps/XHR to get JSON response
      
      Station Status caching for wifi channel workaround + AJAX/CORS
      - During checkstation poll, cache the last station status
      - Shut down the station if status = 2,3,4 and channel is different than SoftAP
      - Add Access-Control-Allow-Origin: * to endpoint responses used by a service
      - Add a /setwifi GET endpoint for phone apps/XHR to use (same parameters as /update endpoint). Returns a JSON response containing chip id and status code.
      - Add handler for OPTIONS verb (needed for CORS support)
      
      Wi-Fi Channel Issue Workaround
      - Do a site survey upon startup, set SoftAP channel to the strongest rssi's channel
      - Compare successful station connect channel to SoftAP's. If different, then defer the Lua success callback to the end. Shut down Station and start the SoftAP back up with original channel.
      - After the 10 second shutdown timer fires, check to see if success callback was already called. If not, then call it while starting the Station back up.
      
      HTTP Response and DNS enhancements
      - If DNS's UDP buffer fills up, keep going as non-fatal. It's UDP and not guaranteed anyways. I've seen this occur when connecting a PC to the SoftAP and every open program tries to phone home at the same time, overwhelming the EUS DNS server.
      - Support for detecting/handling pre-gzipped `enduser_setup.html` (and `http_html_backup`) payload. Nice for keeping the size of the `state->http_payload_data` as small as possible (also makes minimization not as critical)
      - Corrected misuse of HTTP 401 response status (changed one occurrence to 400/Bad Request, and changed another to 405/Method Not Allowed)
      
      * Normalized formatting (tabs-to-spaces)
      * Added documentation
      * Corrected misuse of strlen for binary (gzip) data.
      * Added NULL check after malloc
      058777ea
  2. 05 Sep, 2016 1 commit
    • Arnim Läuger's avatar
      Add FatFs and SD card support (#1397) · ecf8bd98
      Arnim Läuger authored
      * Add FatFs
      * enable BUILD_FATFS for all-module build
      * push vfs into rest of firmware
      * align maximum filename length
      * increase timeout for acmd41 during card initialization
      * switch from DOS to Unix path semantics chdrive() is substituted by chdir()
      * update to fatfs R.012a incl. patches 1-6
      * add callback for rtc provisioning in file
      * update docs
      ecf8bd98
  3. 28 Jun, 2016 1 commit
  4. 03 Jun, 2016 1 commit
  5. 01 Apr, 2016 1 commit
  6. 31 Mar, 2016 1 commit
  7. 30 Mar, 2016 2 commits
  8. 29 Mar, 2016 1 commit
    • Johny Mattsson's avatar
      enduser_setup: Fixed missing status update. · 0e404770
      Johny Mattsson authored
      Due to the hard-close, the status message did not get sent out reliably.
      Connection closing logic now reworked to be nicer, while still avoiding
      the problem of lots of connections lingering in fin_wait.
      0e404770
  9. 28 Mar, 2016 2 commits
    • Johny Mattsson's avatar
      Switch enduser_setup_module to LWIP raw API. · e1fffe6a
      Johny Mattsson authored
      Shutting down an espconn server safely is impossible, and currently would
      include at least one use-after-free. Even with that patched, at best this
      would change things from impossible to "very tricky".
      
      The native LWIP API does not have those issues, and is still quite easy
      to work with.
      e1fffe6a
    • Robert Foss's avatar
      Improved overall enduser_setup user experience. · 2d4f8f8e
      Robert Foss authored
      A single bug is fixed, a few features are added and overall the codebase has been worked through.
      
       - Added support for calls to /generate_204 that let's android know that the internet is accessible.
       - Added 10 second delay to the shutdown call to allow a final status update to be fetched by the client.
       - Added iframe to html to avoid having a form submission change the page.
       - Added support for dynamic /status responses.
       - Improved HTML appearance by removing AP-list button.
       - Improved CSS to center form, even when list of access points have loaded.
       - Improved debug prints to contain line numbers and not require lua_State*.
       - Fixed broken failure check when calling wifi_station_connect().
       - Fixed unguarded malloc().
      2d4f8f8e
  10. 01 Mar, 2016 3 commits
  11. 01 Feb, 2016 1 commit
    • Johny Mattsson's avatar
      Fixes and enchancements for enduser_setup module. · 86839d6e
      Johny Mattsson authored
      Fixes:
      
      * Removed spurious \0 bytes being sent to the client in many cases.
      
      * Properly terminated 404 header.
      
      * Now including Content-length: header for index.html (including built-in).
      
        Clients otherwise had to wait for their own timeout before considering
        the page load complete, which resulting in an unpleasant sluggish
        experience.
      
      * Switched form submission to GET, as iOS sometimes does not include the
        body in the same packet as the POST header, which led to the module
        not finding the form values.
      
      * Added redirect after form submission to avoid blank-page-in-browser.
      
      * Moved common "enduser_setup" prefix to a lua_pushfstring() to reduce
        string literal overhead.
      
      * Replaced cached lua_State* with calls to lua_getstate(), as in other
        modules.
      
      * Fixed broken appending of MAC to the SSID.
      
      * Fixed up macro definitions to not break `if` clauses unintentionally.
      
      Enhancements:
      
      * Support for scanning for available WiFi networks, and picking from the list.
      
      * Support for retrieving the current WiFi station status.
      
      * Added "manual" mode, where the module does not (re)configure the AP setup,
        nor shut down automatically. Default is still automatic, as before.
      
      * Updated docs for new `enduser_setup.manual()` function.
      86839d6e
  12. 27 Jan, 2016 1 commit
  13. 20 Jan, 2016 1 commit
  14. 21 Dec, 2015 1 commit
  15. 16 Dec, 2015 2 commits
    • Johny Mattsson's avatar
      Reworked module registration, removed modules.h · 4e8ef87d
      Johny Mattsson authored
      Module creation & registration now made a lot simpler. In essence,
      each module file is now self-contained and only needs a
      
        NODEMCU_MODULE(MYNAME, "myname", myname_map, luaopen_myname);
      
      line to both be automatically recognised by the Lua initialization
      as well as honor the LUA_USE_MODULES_MYNAME #define.
      4e8ef87d
    • TerryE's avatar
      Major cleanup of module registration pass 2. · b773290b
      TerryE authored
      carrying on Johny's edits as per my comments on #810
      b773290b
  16. 12 Dec, 2015 1 commit
    • Johny Mattsson's avatar
      Major cleanup of module registration. · 6b6456be
      Johny Mattsson authored
      As per #810 & #796, only LUA_OPTIMIZE_MEMORY=2 & MIN_OPT_LEVEL=2 are
      supported when building. This commit effects that limitation.
      
      With this change modules/auxmods.h no longer needs to be updated for
      every new module, nor do module writers need to cater for a hypothetical
      LUA_OPTIMIZE_MEMORY < 2 scenario.
      6b6456be
  17. 12 Nov, 2015 1 commit
  18. 01 Oct, 2015 1 commit
  19. 30 Sep, 2015 2 commits
  20. 27 Sep, 2015 1 commit
  21. 19 Sep, 2015 1 commit
  22. 17 Sep, 2015 1 commit
  23. 14 Sep, 2015 1 commit
  24. 12 Sep, 2015 1 commit
  25. 10 Sep, 2015 1 commit
    • Robert Foss's avatar
      Added ENDUSER_SETUP module. · e2ada487
      Robert Foss authored
      The module will start a SoftAP, DNS, HTTP server acting as a captive portal.
      The portal will have the SSID SetupGadget and will serve a website where
      credentials for the end users WLAN can be submitted.
      
      Once valid credentials have been submitted and used to connect to the
      local WLAN this module will stop.
      
      This module requires USE_DNS to enabled in dhcpserver.h
      e2ada487