1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

1435 Commits

Author SHA1 Message Date
david gauchard
777323709b
webserver: add define WEBSERVER_HAS_HOOK when ::addHook() is present (#7515)
This allows conditional compilation for external libraries
2020-08-11 02:15:46 +02:00
Earle F. Philhower, III
9afb084159
Clean up minor warnings from LGTM.com (#7500)
* Clean up minor warnings from LGTM.com

LGTM (Semmie) is a tool, bought by GitHub last year, that conducts basic
linting tasks on code and HTML.

Clean up the warnings identified in the latest report:
https://lgtm.com/projects/g/esp8266/Arduino/?mode=list

No functionality should change, however this may fix some issues with
the perl utilities not exiting properly on a Ctrl-C from the command
line.

* Back out HTML changes and rerun boards.txt.py
2020-08-03 19:19:04 -07:00
Earle F. Philhower, III
a8e35a579c
Add valgrind mocked test to CI (#7501)
Run valgrind on host mock example runs to catch more bugs in CI.  These
tests would have caught the problem in #7464 before users did.

Add a list of some randomly picked examples to run, and add an option to
run the loop exactly once in the host mock routine, so the test will
actually exit under valgrind.
2020-08-03 19:00:51 -07:00
drhideg
d92e1edac8
Basic authentication with ESP8266httpUpdate (#7190)
Add ability to use basic access authentication with ESP8266httpUpdate
2020-07-30 08:55:29 -07:00
david gauchard
1041a9d752
webhook/http1.1: prevent from losing a new client while waiting (#7492) 2020-07-30 01:26:56 +02:00
david gauchard
33083861c8
webserver hook: allow to handle external http protocol (#7459)
* webhook api
* simplify webserver debug printouts, move text to flash
* Hook examples in HelloServer example
* print executable code address in example
* simplify example per @mcspr suggestion
2020-07-28 23:34:26 +02:00
Earle F. Philhower, III
63b41bcfab
Use root cert, not fingerprint for api.github.com (#7490)
In the HTTPS example we were using a fingerprint which changes almost
daily as the github.com certificates are regenerated.  Replace this with
a trust anchor based on the ultimate root CA that github.com uses to
sign their certificates.  Assuming they don't change CAs, this
certificate should be good until 2030+

Fixes #7489
2020-07-28 12:11:00 -07:00
Earle F. Philhower, III
355b291614
CVE-2020-12638 workaround for WPA downgrade attack (#7486)
* CVE-2020-12638 workaround for WPA downgrade attack

When connected to an encrypted (WEP/WPA) router, a rogue packet can
cause the ESP8266 WiFi stack to drop to an unecrypted rogue network of
the same SSID.

Handle this by dropping the WiFi connection immediately and reconnecting
to the stored WPA/WEP network requested by the application, whenever the
AUTHMODE changes to OPEN from a secured mode.

https://lbsfilm.at/blog/wpa2-authenticationmode-downgrade-in-espressif-microprocessors
for more details.
2020-07-26 10:11:14 -07:00
Earle F. Philhower, III
555c9ebdf8
Update FP for tls.mbed.org (#7479) 2020-07-22 22:26:00 -07:00
Earle F. Philhower, III
f42cf7a5a4
Fix uninitted class variables from #7464 (#7478)
PR #7464 removed the reset of client authentication settings when server
authentication settings were changed, however it never did initialize
the client authentication information to nullptr in the constructor.
This can result in crashes during connections when client certs are not
applied.

Fix by resetting the client authenticaion variables on object
construction.
2020-07-22 22:10:44 -07:00
Earle F. Philhower, III
91427a1695
Keep client certs when server authentication set (#7464)
WiFiClientSecure.setInsecure() was clearing the secret key (but not the
_chain public client cert) incorrectly.  The other server authentication
modes also had the same effect.

The only way for it to work would be if the app first set the server
authentication method and then the client keys.  There's no good reason
for this.

Adjust the connection to only clear the server id methods and leave the
client ID untouched.

Fixes #7455
2020-07-17 14:02:17 -07:00
Benoît Blanchon
c18f7cb1e6
Made ESP8266WebServer::client() return a reference (fixes #7075) (#7080) 2020-07-17 02:13:29 +02:00
Zakary Kamal Ismail
3c1bd65a76
WebServer: Allow client to send many requests on the same connection (#7414)
* WebServer: Allow client to send many requests on the same connection

* WebServer: Keep the connection alive with a client by default

* WebServer: Use the request's HTTP version and Connection header to set the default keep alive value

* Fix a typo in a comment
2020-07-16 13:53:48 -07:00
kinafu
709ba7981e
Change BSSL_CertStore test URL (#7370)
github.com forwards to www.github.com
So reaching out for "www.github.com" returns HTTP 304 instead of the nice HTTP 204
2020-07-16 12:07:40 -07:00
david gauchard
dfd5a4f12b
replace old Ethernet Arduino-library with v2, submoduled (#6812) 2020-07-16 19:34:55 +02:00
david gauchard
e58bb60f87
webserver: do not count "plain" in argument list (#6768)
* webserver: do not count "plain" in argument list (it is still available though)
2020-07-13 12:40:27 +02:00
david gauchard
2d4a601c18
webserver: string optimization (#7446)
* webserver: string optimization

* fix
2020-07-10 10:11:51 -07:00
Dirk Mueller
83158affa8
Pass String by const reference [3.0] (#6583)
Passing String by value means a full copy-constructor/temporary
string creation which is slightly inefficient. Avoid that
by using const references.
2020-07-10 13:27:51 +02:00
david gauchard
af1bc71a9e
remove lwip-v1.4 specific code (#7436)
* remove lwip-v1.4 specific code

* ditto

* ditto

* fix ip4_addr definition

* CI: change debug builds to use IPv6, remove regular IPv6 builds

* ditto

* split pio CI in four (because they last twice the time of the other builds)

* remove option from pio

* remove lwIP-1.4 from doc

* restore pio CI splitting

* fix CI debug6 script

* ditto
2020-07-09 09:59:49 -07:00
Earle F. Philhower, III
70e4457041
Remove axTLS from code and documentation (#7437) 2020-07-09 09:21:38 -07:00
Earle F. Philhower, III
c663c55926
Free space of overwritten files in LittleFS (#7434)
* Free space of overwritten files in LittleFS

Fixes #7426

LittleFS doesn't update the on-flash data structures when a file is
reopened as O_TRUNC until the file is closed.  This means the space of
the original, inaccessible file cannot be used, causing OOS errors in
cases when a large file is being overwritten.

Explicitly call the file sync operation to update the on-flash metadata
as soon as a file is opened.  For normal files it's a no-op, but for
O_TRUNC modes it will free the space, allowing full overwrite of large
files.

* Add host test case for change
2020-07-07 17:14:30 -07:00
Earle F. Philhower, III
d979b57d76
Upgrade to GCC 10.1 toolchain (#6294)
* Upgrade to GCC 9.1 toolchain

* Rebuilt using pure GNU binutils and GCC

Remove dependencies on earlier forked GNU utilities (gcc-xtensa,
binutils-gdb-xtensa) and just use GCC sources, unmodified (except for
patches in the esp-quick-toolchain directories).

* Rebuild bearssl using new toolchain

* Fix GDBstub linkage options

GDB works with pure GNU GCC and pure GNU binutils now.  Still warnings
galore, but tested with the example sketch in the docs.

* Fix digitalRead alias warning

* Remove gdb stub warnings w/a pragma

* Fix deprecated implicit copy ctors in IP code

Fix some warnings present in GCC8/9 in the IPAddress code

In AddressListIterator there was a copy constructor which simply copied
the structure bit-for-bit.  That's the default operation, so remove it
to avoid the warning there.

IPAddress, add a default copy constructor since the other copy
constructors are simply parsing from one format into a native ip_addr_t.

@d-a-v, can you give these a look over and see if they're good (since
IP stuff is really your domain).

* Fix AxTLS alias function defs to match real code

* Fix WiFiClientSecure implicit default copy ctor

These both use shared-ptrs to handle refcnts to allocated data, so using
the default copy constructor is fine (and has been in use for a long
time).

* Dummy size for heap to avoid GCC 8/9 warnings

Make GCC think _heap_start is large enough to avoid the basic (and
incorrect) bounds-checking warnings it produces.  The size chosen is
arbitrary and does not affect the actual size of the heap in any way.

* Make heap an undefined extend array

Instead of a bogus size, use an indefinite size for the heap to avoid
GCC warnings

* Trivial tab to space fix

* Update SDFat to remove FatFile warnings

* Fix ticker function cast warnings in GCC 9

The callback function is defined to take a (void*) as parameter, but our
templates let users use anything that fits inside sizeof(void*) to be
passed in.  Add pragmas to stop GCC warnings about this, since we
already check the size of the type will fit in the allocated space.

* Remove GCC support fcn that's in ROM

Manually delete the divdi3.so from the libgcc.a library by running the
updated EQT's 9.1-post script.

* Make exceptions work again, get std::regex up

Exceptions are broken on all builds (GCC4.8-9.1) due to the removal of
the PROGMEM non-32b read exception handler (added in the unstable
pre3.0.0).

Build the exception code with -mforce-l32 and patch
accordingly to avoid LoadStore errors.

Apply patches to select portions of the regex lib which use _stype_
(which is now in flash).

* Rebuild Bearssl using latest GCC push

* Automate building of BearSSL and LWIP w/new toolchain

* Workaround g++ template section problem for exception strings

G++ seems to throw out the section attributes for templates.  This means
that the __EXCSTR(a synonym for "PSTR()") is ignored and exception.what
strings are stored in RODATA, eating up RAM.

Workaround by using the linker to place the strings keying off their name
("*__exception_what__*").

* Rebuild moving exception.what to unique names

Exception.whats are now all in __exception_what__ and can be moved by
the linker to flash.  Works aroung G++ issue with segments being lost in
templates.

* Rebuild with new LWIP locking

* Update to latest libs, save iram

Move two GCC FP support routines out of iram since they are in ROM
already, saving some add'l IRAM.  Same list as gcc 4.8.

* Update BearSSL to latest release

* Fix umm_perf reference to ROM function

* Fix "reinterpret_case is not a constexpr" error

In GCC 9 (and 8 from what I read on SO), a cast of a const int to a
function pointer (via explicit or implicit reinterpret_cast) is not a
constexpr.
````
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/umm_malloc/umm_performance.cpp:45:36: error: a reinterpret_cast is not a constant expression
   45 | int constexpr (*_rom_putc1)(int) = (int (*)(int))(void*)0x40001dcc;
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
````

Remove the constexpr, potentially increasing heap usage by 4 bytes in
debug mode.

* Update libc.a to latest rev

* Full rebuild of toolchain and libs

* Upgrade to GCC 9.2, released in August 2019

Add builds for all 5 cross-compiles to pass CI

* Move to --std=gnu++14 (C++14 + GNU extensions)

* Fix Ticker merge conflict

* Fix json merge conflict

* One more merge diff fix

* Reapply Ticker.h casting warning fixes for gcc9

* Update with fixes from Sming repo for PSTR and ASM

* Upgrade to -gnu4 toolchain

* Move to gnu5 build with add'l softFP from ROM

* Move add'l softFP from IRAM to flash

Per @mikee47, we miss sone add'l soft-FP routined in the linker which
makes them end up in IRAM.  Move them explicitly into flash, like a
couple others we have already done this for.

* Move to std=c++17/c17 in platform, remove abs/round

Move to C++17 and C17 standards on the compiler options.

Remove "register" from core since it is deprecated.

Remove the #define abs() and #define round() which a) overwrote the
C stdlib definitions, poorly, and b) broke the GCC core code which used
"abs" as an internal function name.

Now abs() returns an integer, and not whatever was being absoluted.
fabs() etc. can be used if users need fload/double suport.

round() returns a double now, which is basically what it was returning
in the original case since adding/subtracting by a FP.

* Use std::abs/round to replace the macro definitions

Per discussion w/@devyte, preserve the abs() and round() functionality
via the using statement.

* Remove using std::abs which conflicted with C lib headers

* Add 2nd arg (exception handler) to ets_isr_t

Disassembly of the ROM shows there are 2 params to the ets_isr_t
callback.  The first is the arg passed in, the second is a pointer to an
exception frame where you can get info about when the IRQ happened.

* Move the gdbstub example to a subdir

The Arduino IDE and the build CI don't build it without a subdir, so
make one for gdbstub's example so it's visible and tested.

* Fix ets_irq_arratch redefinition and core IRQ handlers

Remove a duplicated, different declaration for ets_irq_attach from
ets_sys.h.  It never really even matched the other declaration in the
same header.

Update the core to IRQ handlers to fix the prototype and include the
2nd, unused frame parameter.

* Actually rebuild the libc.a using GCC 9.2

* Fix SPISlave interrupt attach's 2nd parameter

* Rebuild eboot.elf with GCC 9

* Update to latest SoftwareSerial for Delegate fix

* Upgrade to GCC 9.3

* Rebuild all arch toolchains

* Move to GCC 10.1

* Merge master and fix eboot build

GCC10 now uses `-fno-common` so the eboot global variables were being
placed in IRAM.  Adjust the makefile and rebuild to fix.

* Built complete toolchain for all archs

* Pull in latest PSTR changes and fix GCC10.1 build

Somehow the prior GCC build's -mforce32 patch wasn't applying correctly,
but I was still able to get a binary.  Fixed.  Also pulled in latest
PSTR changes in progmem.h

* Update platform.io to platform C/C++ standards

* Use PR's toolchain in platformio build

* Fix several asm warnings in PIO build

* Optional stack smash protection -fstack-protector

Add a menu to enable GCC's built-in stack smash protection.  When a
subroutine goes past its end of stack, generate a crashdump on function
exit like:

````
GCC detected stack overrun
Stack corrupted, stack smash detected.

>>>stack>>>

ctx: cont
sp: 3fffff20 end: 3fffffc0 offset: 0000
3fffff20:  40202955 00000001 0000001c 4020287e
3fffff30:  feefeffe 000000fd 00000000 00000000
...
<<<stack<<<
````

Disabled by default because there is a small per-function code overhead
(and CPU time if the function is called very frequently and is very
small).

BearSSL and LWIP are not built using stack smash detection, yet.

* Fix duplicated stc=gnu99/c17 in build

* Dump faulting function PC in stack overflow

Report a fake exception to have the exception decoder print the actual
faulting function.  This won't tell you where in the function the issue
happened, but it will tell you the function name first and foremost.

* Rebuild with Platform.io JSON tag in release tgzs
2020-07-07 11:12:43 -07:00
Mikael Bertze
f1651fba89
Ability to set connect timeout in WifiMulti->run (#7420)
* Adds timeout parameter to run

* Renaming varaible to connectTimeoutMs
2020-07-02 00:01:34 +02:00
Earle F. Philhower, III
d85ff6efc4
Add namespace to FS references in CertStore (#7413)
Fixes #7410
2020-06-29 10:30:06 -07:00
david gauchard
52f4cc8de0
httpclient: fix error meaning (#7401)
* httpclient: fix error meaning

* deprecate HTTPC_ERROR_CONNECTION_REFUSED
2020-06-25 09:00:24 +02:00
Dirk O. Kaar
00fc716ccc
EspSoftwareSerial 6.8.5: fixes parity for TX with odd word size modes (#7399)
* EspSoftwareSerial 6.8.4: fixes parity for TX with odd data-bit count modes (e.g. 7E1)
* EspSoftwareSerial 6.8.5: examples report rx errors from HW serial API, in lieu of specific parity errors, which are not made available.
2020-06-24 19:41:28 +02:00
Mjxkill
7298691252
Add ESP8266WebServerTemplate<ServerType>::enableCORS(bool _ec) (#7388)
Add ESP8266WebServerTemplate<ServerType>::enableCORS(bool _ec) like ESP32 Arduino platform.
2020-06-21 14:38:32 -07:00
Earle F. Philhower, III
786a65402f
Update GitHub cert fingerprint in example (#7397)
The certificate was regenerated yet again, so update the FP in the
SSL validation example.

Fixes #7394
2020-06-21 13:34:31 -07:00
david gauchard
64f1f7b727
doc fixes for LittleFS (#7385) 2020-06-16 17:31:19 +02:00
Max Prokhorov
599492ec43
libraries/SPI: abs -> std::abs and cast fixes (#7362)
* libraries/SPI: remove pointless abs(...) call

SPI library code erroneously assumed that:
- abs() is a C function, so include stdlib.h is required.
  what happens instead is Arduino.h shadows `abs()` with it's own macro
- uint32_t() - int32_t() promotes to int32_t, thus needing abs()

Fix both issues, leaving existing calculations as-is.

* additional changes for freq and constants

- restore abs call, cast freq to correctly display the intent
- update magic numbers comments
- move some spiclk_t magic numbers to func consts
2020-06-13 11:17:06 -07:00
Dirk O. Kaar
fe673cc16a
User requested fix: be less restrictive in the use of GPIOs. (#7367) 2020-06-11 09:48:31 -07:00
Develo
ab03add8d0
Fix oversight for ap gw (#7366) 2020-06-10 15:18:19 -04:00
Jonathan Dumaresq
5473656eac
Update ESP8266WiFiAP.cpp (#7363)
Fix the bad adress of the the AP if the settings are wrong
2020-06-08 16:41:25 -04:00
M Hightower
83523c0259
umm_malloc manual merge with upstream (#7337)
* umm_malloc manual merge with upstream

* Fix divide by zero, case when heap is 100% allocated.

* Removed extra line.

* Fixed block count for debug build. This resolves OOM events for debug build.
Correct overstepping array when freeing.

* Handle another corner case in example HeapMetric.ino.
Comment corrections.

* Revert - ESP.getMaxFreeBlockSize() is back to indicating the size of a
contiguous block of memory before the umm_malloc overhead is removed.

* Stale code cleanup and comment improvements
2020-06-07 20:00:15 -07:00
Dirk O. Kaar
0d04124b94
EspSoftwareSerial service release 6.8.2. (#7354) 2020-06-07 12:46:53 -07:00
vdeconinck
c3796a4de5
Graph example (#7299)
* New Graph Example

* Now using isFlashInterfacePin() no define default GPIO mask.

* Added info about zooming.

* Adressed requested changes (boolean > bool,
using esp8266::polledTimeout::periodicMs, reducing complexity)
2020-06-02 20:59:16 -04:00
Earle F. Philhower, III
8ee67ab2b5
Return FALSE on seek past EOF (#7324)
Fixes #7323

While I'm not a fan, the Arduino FileSeek API online shows that a seek()
past EOF should return FALSE.
https://www.arduino.cc/en/Reference/FileSeek

SPIFFS and SDFS obey this, but LittleFS followed the POSIX standard or
allowing seeks past EOF.

Update LittleFS::seek() to follow the Arduino API and add tests for it.
2020-05-30 21:47:53 -07:00
s-hadinger
7c008e31bb
Flash size reduction for mime-type (#7312)
* Flash size reduction for mime-type
* moving from fixed size strings to standard PROGMEM strings
* adding `#define MIMETYPE_MINIMAL` to reduce the footprint to
  mime-types that are strictly necessary

* Added MIMETYPE_MINIMAL conditionals
2020-05-18 20:16:11 -07:00
Ewald Comhaire
4519db85e9
Server Sent Events example - issue #7008 (#7012)
* Server Sent Events example - issue #7008

Illustrates the use of SSE using ESP8266WebServer

* Update ServerSentEvents.ino

* Create ServerSentEventsMultiClient.ino

* sync

* Update ServerSentEvents.ino

* Update ServerSentEvents.ino

Fix  missing variables in printf statments
Fix subscriptioncount not decreasing
Fix SSEBroadcastState (argument sequence wrong)

* Undo the library additions, move to current master

* Fix compiler warning

* Address review and fix multi-sensor updates

Address points of @devyte's code review:
* Use IPAddress vs. uint32_t
* Refactor the URL parsing logic to use strlen vs. sizeof, since there
  was some confusion in the original (correct) version
* Minimize copies of WiFiClients while in use
* Use byref access for sensor updates

Fix multi-sensor updates
* Create an update Ticker for each sensor, because the original code
  only had one whose callback was overridden by sensorB, meaning sensorA
  never changed

* Fix IPv6 build errors

* Remove WiFiClient extraneous copy

Avoid duplicating WiFiClient by using the WiFiClient object embedded in
the subscriber[] array instead.

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-05-16 12:22:04 -07:00
Earle F. Philhower, III
c5f60e31cd
Allocate BSSL stack for SigningVerifier (#7291)
The BearSSL SigningVerifier was moved to the 2nd stack because some uses
required much more stack than available on the normal stack.

Add a reference to the second stack on object creation (which will
allocate it, if there is no BSSL stack already allocated), and delete
that reference on exit.

Fixes #7288
2020-05-15 20:21:50 -07:00
Jeroen88
157ce57996
bugfix2/ESP8266HTTPClient (#6476)
* Because of git problems, start from a new fork and create a new PR. This was PR #6457

* Style update to pass Travis

* Update ReuseConnectionV2.ino

* fix + enforce testing http code

per @earlephilhower review

* Close connection before ::connecting on HTTP/1.0

HTTPClient never actually closes the TCP connection on its own. It will leave the TCP connection open unless you explicitly do a getString which makes a StreamString and stuffs it with the HTTP server response, at which point the HTTP server itself will close the connection.

If you check the HTTP error code and find failure, unless you do a getString and throw it away, it won't disconnect.  Even in HTTP/1.0 or in cases when you haven't enabled _reuse.

Change the logic in ::connect to only reuse the connection when it is specifically allowed.  Otherwise, fall back to re-connection.

* Adjust example per request

Do single URL get in each loop, avoid infinite for loop at end.

* Fix astyle

* Clean up final pass notice

* Fix example syntax error

Editing code in a web textbox without running it is a painful process.


Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-05-15 17:12:49 -04:00
Earle F. Philhower, III
83166f948b
Deprecate SPIFFS, move examples to LittleFS (#7263)
* Deprecate SPIFFS, move examples to LittleFS

SPIFFS has been a great filesystem, but it has significant problems in
many cases (and it's also pretty slow).  Development seems to have
slowed/stopped on the upstream version, and we're not able to provide
support or fix the known issues with it as-is.

Deprecate SPIFFS variable.

Update all examples to use LittleFS instead of SPIFFS.

Also, minor cleanup on very old examples which has obsolete delays
waiting for the Serial port to come up, or which were stuck at 9600 baud
because of their ancient AVR heritage.

Fixes #7095

* Remove leftover debug code

* Clean up comments in some examples

* Update documentation on SPIFFS deprecation

* Fix host tests to avoid deprecation warnings

* Fix cut-n-paste error

* Restore SpeedTest.ino, adjust to allow custom FSes

Co-authored-by: Develo <deveyes@gmail.com>
2020-05-04 14:22:50 -04:00
Takayuki 'January June' Suwa
bf718c39af
Revert "Changing listen to listen the current iface only instead of 0" (#7266)
workaround for #7262 (reverts #7217)

Co-authored-by: Takayuki 'January June' Suwa <jjsuwa.sys3175@gmail.com>
2020-05-03 14:52:35 -04:00
Earle F. Philhower, III
388d3020f2
Fix minor GCC10 static analyzer warnings (#7255)
Add minor NULL and double-free checks to source, identified using GCC10
pre-release static `-fanalyzer` on the coude.  These are harmless to
other versions.

Also add explicit include of stdint to Schedule.h, because libstdc++20
will not automatically include it.  Safe and no-op on earlier versions.
2020-04-30 18:25:31 -07:00
vdeconinck
a9cf12fcf0
Make getContentType available for 3rd party usage (#7254)
* Refactored to make getContentType public for 3rd party use.

* Added missing "jpeg" extension

* Use getContentType() from mime namespace.

* Also add .jpeg extension
2020-04-29 23:36:42 -04:00
vdeconinck
668b33ddf1
Revamp of the FSBrowser and SDWebServer examples (#7182)
* Minimal file with a few ESP8266-specific keywords - github issue #3701

* Renamed "SDWebServer" to the more universal "WebFileManager"

* SD was replaced by SDFS, and sketch now works on either SDFS, SPIFFS or
LittleFS based on a #define logic (required adding a second param to open() and
replacing 'FILE_WRITE' by "w") + Added size information to file list and a /status request handler to return filesystem status

* Tree panel width is now proportional to window. Changed icons (lighter and
more neutral), including one for files. Show size of files. Fill
"filename" box upon clicking on a file. Sort files alphabetically.

* Replaced by a lighter version

* Return the filesystem time in the status object
+ Massive cleanup/merge/align with some code from the FSBrowser example
and misc refactorings

* Fixed folder handling

* Replaced the FILESYSTEM #define by a filesystem variable, and introduced FSConfig to prevent FS formating.
Fixed recursive deletion.
Got rid of specific isDir() for SPIFFS.

* Made 8.3 lowercase filenames formating optional (disabled by default).
Refresh only part of the tree when possible.
Selecting a file for upload defaults to the same folder as the last
clicked file.
Removed the Mkdir button on SPIFFS.

* Added 'wait' cursor during asynchronous operations.
Slight refactoring of XMLHttpRequest completion handling

* Removed limitation "files must have an extension, folders may not".
Case insensivity of the extension for the editor and preview.

* Support Filenames without extension, Dirnames with extension.
Added Save/Discard/Help buttons to Editor, discard confirmation on leave, and refresh tree/status upon save.
Removed redundant Ctrl-Z + Ctrl-Shift-Z shortcut declarations.
Small bug fixes.
+ some refactoring

* Fixed tree refresh on delete in all cases by returning the remaining path as response to the delete request.
Refactoring

* Changed FS status in text by a percentage graph, with numbers as tooltip.
Unsupported files on SPIFFS (files at root not sarting with "/", files with double "/", files ending with "/") are now detected and reported in the page.

* Small fix + refactoring

* Restrict filename support check to SPIFFS.

* Implemented Move/Rename.
Added "loading" screen during async operations (dim with spinner and status).
Fixed "discard" feature that kept prompting even after an image was loaded.
Improved refresh of parts of the tree, with recursive listing.
Moved the "path" id attribute to the "li" elements for folders (was already the case for files).
Refactoring and cleanup.

* Fixed broken spinner

* Cosmetic improvements.
Removed non-functional Upload context menu.
Fixed error in response to move requests.
Added minified version.

* Added specific icons for text and image files.
Fixed incompatibilities with SPIFFS.
Fixed a race condition between deletion and reinsertion of nodes when multiple folders are refreshed.
Fixed missing URL decoding for files with special chars (e.g. space char).
Moved info from source code comment to a readme.md file.
Added source PNG to git.
Cleanup.

* Added favicon.ico.

* Renamed project

* Small changes

* Add a note about the ace.js dependency

* Minor changes

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Restyled version

* (dummy edit to retrigger broken CI)

* Using unsigned int for comparison with String.length()

* Return an error when upload fails (e.g. filesystem full)

* Trying to reorder functions to please CI

* Reordered functions to please CI.

* Moved file

* Renamed "SDWebServer" to the more universal "WebFileManager"

* SD was replaced by SDFS, and sketch now works on either SDFS, SPIFFS or
LittleFS based on a #define logic (required adding a second param to open() and
replacing 'FILE_WRITE' by "w") + Added size information to file list and a /status request handler to return filesystem status

* Tree panel width is now proportional to window. Changed icons (lighter and
more neutral), including one for files. Show size of files. Fill
"filename" box upon clicking on a file. Sort files alphabetically.

* Replaced by a lighter version

* Return the filesystem time in the status object
+ Massive cleanup/merge/align with some code from the FSBrowser example
and misc refactorings

* Fixed folder handling

* Replaced the FILESYSTEM #define by a filesystem variable, and introduced FSConfig to prevent FS formating.
Fixed recursive deletion.
Got rid of specific isDir() for SPIFFS.

* Made 8.3 lowercase filenames formating optional (disabled by default).
Refresh only part of the tree when possible.
Selecting a file for upload defaults to the same folder as the last
clicked file.
Removed the Mkdir button on SPIFFS.

* Added 'wait' cursor during asynchronous operations.
Slight refactoring of XMLHttpRequest completion handling

* Removed limitation "files must have an extension, folders may not".
Case insensivity of the extension for the editor and preview.

* Support Filenames without extension, Dirnames with extension.
Added Save/Discard/Help buttons to Editor, discard confirmation on leave, and refresh tree/status upon save.
Removed redundant Ctrl-Z + Ctrl-Shift-Z shortcut declarations.
Small bug fixes.
+ some refactoring

* Fixed tree refresh on delete in all cases by returning the remaining path as response to the delete request.
Refactoring

* Changed FS status in text by a percentage graph, with numbers as tooltip.
Unsupported files on SPIFFS (files at root not sarting with "/", files with double "/", files ending with "/") are now detected and reported in the page.

* Small fix + refactoring

* Restrict filename support check to SPIFFS.

* Implemented Move/Rename.
Added "loading" screen during async operations (dim with spinner and status).
Fixed "discard" feature that kept prompting even after an image was loaded.
Improved refresh of parts of the tree, with recursive listing.
Moved the "path" id attribute to the "li" elements for folders (was already the case for files).
Refactoring and cleanup.

* Fixed broken spinner

* Cosmetic improvements.
Removed non-functional Upload context menu.
Fixed error in response to move requests.
Added minified version.

* Added specific icons for text and image files.
Fixed incompatibilities with SPIFFS.
Fixed a race condition between deletion and reinsertion of nodes when multiple folders are refreshed.
Fixed missing URL decoding for files with special chars (e.g. space char).
Moved info from source code comment to a readme.md file.
Added source PNG to git.
Cleanup.

* Added favicon.ico.

* Renamed project

* Small changes

* Add a note about the ace.js dependency

* Minor changes

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Restyled version

* (dummy edit to retrigger broken CI)

* Using unsigned int for comparison with String.length()

* Return an error when upload fails (e.g. filesystem full)

* Trying to reorder functions to please CI

* Reordered functions to please CI.

* Update to use chunked response API

* Removed temp files commited by mistake

* Avoid using args() as requested

* Use html entity for non-breaking space to avoid losing char when minifying

* Script to preprocess index.htm

* (reformated code)

* (comments)

* Preprocessed files

* Fixed dump to create an actual include file

* Optionally embed index.htm in code.
(+ documentation and preprocessing script)

* (reformated)

* If editor cannot be loaded from the web, try a local version, or default
to a text viewer if not present

* (removed a TODO item :-))

* (forgot to reprocess files after last commit)

* (reprocess should be ok this time)

* Return error 500 when upload fails immediately (e.g. filesystem full)

* Use standard <meter> tag for filesystem use

* (updated following changes to index.htm)

* Do not include gzipped version in the data folder by default. Leave it in the extras folder and change readme accordingly (plus some reformatingi of the readme file)

* Gzipped index file not included in data/edit by default. It is now left in the extras folder.
Readme file was updated accordingly (+ some reformating)

* Reduce String clutter by reserving and concatenating elements one by one.

* Use clear() to reset String.

* Avoid comparisons against empty String.

* Use char instead of single-char String where possible.

* Prefer direct logic over inverted.

* Rename returnBlah to replyBlah.

* Renamed h2int to hexDigitToInt

* Renamed getFileError() to checkForUnsupportedPath(), to avoid confusion
with a getter.

* Misc improvements.

* Added comments about mandatory rebuilding gz and h files in case of update
to index.htm.

* Addressed a few comments.

* Improve replies: bad requests vs server error

* (reformated)

* Reduce clutter by reserving String size beforehand.

* Moved most Strings of more than 10 chars to flash.

* Use lib version of urlDecode() instead of a local one, and only call it when required.

* Added a comment about the dangers of recursion on embedded devices.

* Added a more explicit warning in the .h header comment.

* Added a typical set of required files to load ace editor from the ESP.

* (reformated)

* More explicit warning at the beginning of the .h version.

Co-authored-by: david gauchard <gauchard@laas.fr>
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
Co-authored-by: Develo <deveyes@gmail.com>
2020-04-29 12:03:24 -04:00
aerlon
ce200ed72e
- Move TypeConversion from namespace esp8266 to namespace experimental. (#7252)
- Add using namespace experimental::crypto; to HelloCrypto.ino.

- Add mention about new random function in libraries.rst.

- Update keywords.

Co-authored-by: Anders <andlo151@student.liu.se>
2020-04-29 10:30:26 -04:00
aerlon
3c9a75f831
Add CryptoInterface library (#6961)
* - Add CryptoInterface library.

- Add TypeConversion core files.

* Fix compiler errors.

- Make HelloCrypto.ino stylish.

- Include assert.h in CryptoInterface.cpp.

* - Move base36 arrays to PROGMEM in TypeConversionFunctions.cpp.

- Add deprecated attribute to SHA1 and MD5 hashes.

- Remove _warningsEnabled since this has been replaced by the deprecated attribute.

- Prefix all getters with "get".

- Move all CryptoInterface functionality to the experimental namespace.

- Change formatting of core files.

- Improve comments.

* - Update keywords.txt.

* - Remove WiFi.disconnect() from setup() in HelloCrypto example since it no longer seems to be required.

* - Classify everything.

- Remove delay in setup() from HelloCrypto example since it does not seem to be required to prevent missing initial Serial prints.

- Mark type conversion functions as big endian.

- Update keywords.txt.

* - Remove namespace experimental.

- Create ESP.random functions in the core based on the defaultNonceGenerator code, and use these in defaultNonceGenerator.

- Rename CryptoInterface to esp8266::Crypto and move all functionality to the core.

- Remove need to #include <bearssl/bearssl.h> in the Crypto header file by changing br_hkdf_context to ::br_hkdf_context.

- Restyle code files for core usage.

* - Re-add namespace experimental.

- Improve comments.

* - Remove namespace esp8266.

- Rename namespace Crypto to namespace crypto.

Co-authored-by: Anders <andlo151@student.liu.se>
Co-authored-by: Develo <deveyes@gmail.com>
2020-04-28 21:25:10 -04:00
Earle F. Philhower, III
368ca91869
Update to LittleFS v2.2.0 (#7240) 2020-04-22 19:34:45 -04:00
Dirk O. Kaar
ea1fdb210f
Fixup 7122, new startWaveformCycles more aptly named startWaveformClockCycles (like in rest of core API for this type of use). (#7218)
Fix/clarify comments.
Fix redundancies in Tone, end Tone waveform on exact period limit for proper sound.
Fix redundancies in wiring_pwmExtend Servo to map in-use pins, Tone already has this.
2020-04-19 14:57:46 +02:00