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

3578 Commits

Author SHA1 Message Date
david gauchard
2d58be744b
TCP: fixes backlog limit handling, and allows ephemeral TCP connections (#7096)
* fix backlog limit handling, and allow ephemeral TCP connections
* do not retain empty connections
2020-02-24 07:16:55 +01:00
Develo
2b640c0189
Add flash helper constructor to Uri (#7105)
* Update Uri.h

* Add a simple test for the new constructor

Convert a c-str to a FPSTR in the example to have a section
of code in our CI that will catch any future breaks of this specific
kind.

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-02-23 11:29:47 -08:00
JasperHorn
d990ff9547
Improve LittleFS support (#7071)
Previously, when the path was a directory, but didn't have a slash at
the end, a 0 byte response would be sent when using LittleFS. Now, it
will return a 404, like was always the case when using SPIFFS.
2020-02-23 09:38:40 +01:00
Tim Stableford
16319da63d
Resolved issue #3359 (#6969)
* Resolved issue #3359

Made severing connections optional as per the patch
in the issue.
Also fixed a minor spacing issue.

* Renamed sever to close and added information to readme

Also my editor automatically removed some odd whitespace at the
end of a few lines.
2020-02-22 16:30:17 -08:00
Earle F. Philhower, III
bea64dfa69
Add fileCreation/getCreation create-time accessors (#7000)
* Add fileCreation/getCreation create-time accessors

For SDFS and LittleFS, enable a creation time accessor for files and Dir
iterators, similar to the existing fileTime/getLastWrite calls.

Remove spurious Dir::getLastWrite method (the proper and only documented
way is really Dir::fileTime).

Update json to point to new mklittlefs which copies the creation date of
files to the image.

Fixes #6992

* Remove malloc(), use stack vars for temp names

LFS filenames are limited in size and generally very small.  Use a stack
variable instead of a dynamic allocation when performing full-path
computations.

* Replace "Creation" w/"CreationTime" in FS accessor

Per review, `getCreation` -> `getCreationTime`, `fileCreation` ->
`fileCreationTime`.

The names `fileTime()` and `getLastWrite()` are inherited from ESP32
implementation and unchanged.

* Add creation time to listfiles SD example

* Enable SdFat's sateTime callback for timestamping

SdFat requries the dateTimeCallback call (global for everything) to
update dates and times on created files.

Because the callback signature doesn't have space for us to provide
any parameters, we cannot get the the File, Dir, or FS object's
dateTimeCB member.  Instead, just go with `time(null)` as the callback
function which is right in all but the most esoteric cases.

* Correct DOS year/month offset in dateTime callback

* Fix docs to match new xxxCreationTime() API names

Co-authored-by: Develo <deveyes@gmail.com>
2020-02-22 12:49:08 -08:00
Bob
4eca62cb53
Add Uri with support for regexUri and globUri (#6696)
* Add path args

* Add example

* Update code format

* Add missing include

* Fix codestyle and unsigned int

* fix unsigned int

* Remove tabs

* use vector<>.resize

* rename j to requestUriIndex

* using assert checking the path argument index

* Add missing include "assert.h"

* The order no longer matters.
Path arguments may not contain the value '/'
Updated the example

* make pathArg return a const

* Update PathArgServer.ino

fix trailing space

* const String&

* Add regex support

* Fix to match templating

* Add Uri with support for staticUri, regexUri and globUri

* Update example

* Add deconstructor to remove _uri pointer

* Add newline to end of files

* Suppress gcc warnings (unused params)

* Replace regex with regex.h

* Use the standard STASSID/PSK settings for example

Make the example match the existing examples which allow setting
the SSID/PSK in the local platform.txt file.

* Use 115.2Kbaud for example, match others

Co-authored-by: david gauchard <gauchard@laas.fr>
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-02-22 16:51:47 -03:00
Earle F. Philhower, III
a40663b65f
Update to latest BearSSL (#7098)
Minor changes which should not affect us, but keeping in sync with
upstream nevertheless.
2020-02-22 12:42:46 +01:00
david gauchard
f69e404c87
SNTP: backport espressif sntp api for lwip2 (#7097) 2020-02-22 11:55:01 +01:00
Szabolcs Székelyi
e6decacd0a
Fix/enable UDP packet reassembly (#7036)
* Fix/enable UDP packet reassembly

UdpContext didn't care about pbuf chaining when receiving datagrams, leading
to fragments delivered to the application as individual packets.

* Provide pbuf_get_contiguous for backwards compatibility with LwIP 1.4

Implementation copied verbatim from LwIP 2.1.2

* Cosmetic changes to meet coding style

Co-authored-by: david gauchard <gauchard@laas.fr>
Co-authored-by: Develo <deveyes@gmail.com>
2020-02-22 07:38:14 +01:00
david gauchard
cd56dc0901
restore dtostrf when floats are disabled in printf/scanf + round fix (#7093)
* restore dtostrf+fix when float printing is disabled at link time

* fix include file

* fix with proposal per review

* always use dtostrf
2020-02-21 22:34:09 -03:00
Earle F. Philhower, III
0a58172c6a
Merge pull request #6804 from dok-net/optimistic_yield_recurrency
Fix optimistic_yield to not yield on each call after x µs
2020-02-20 14:11:45 -08:00
Earle F. Philhower, III
5100beec2c
Merge branch 'master' into optimistic_yield_recurrency 2020-02-20 12:30:05 -08:00
Dirk O. Kaar
afe40211ef Corrections after review remarks; thanks @earlephilhower 2020-02-20 19:41:08 +01:00
david gauchard
f066ed2495
configTime(tzsec,dstsec,): fix UTC/local management (#6993)
* configTime(tzsec,dstsec,): fix UTC/local management
This PR also remove dead code since probably newlib updates
The NTP-TZ-DST example is also updated
* restore sntp_set_timezone_in_seconds()
fixes #6678
* +configTzTime()
2020-02-18 16:39:38 +01:00
david gauchard
e752e96e9f
lwip2 updates: no more git sub-sub-module deps, faster checksum, backlog limitation and other fixes (#6887)
* upstream lwIP is now downloaded by a makefile, not subsubmoduled

* lwip2: upstream lwIP not sub-sub-modules anymore
lwip2: Allow IPv4 and IPv6 DNS and SNTP server configured via DHCP to co-exist (patch against upstream)

* lwip2: enable tcp-listen-with-backlog feature

* lwip2 submodule update:
- enable more efficient chksum algorithm thanks to Richard Allen
- enable tcp listener with backlog

* more comments, fix backlog management, fix API
* move default value definition in .cpp
because one must not believe it can be redefined before including WiFiServer.h

* improved backlog handling, it is no more a breaking change
2020-02-18 06:54:50 +01:00
david gauchard
bc4f000c48
package builder: updates for alpha releases (#7088)
allow versions 0.0.* to be special
2020-02-17 17:40:50 +01:00
Earle F. Philhower, III
321d256c8b
Merge pull request #7085 from mhightower83/pr-bear-stack-dump
Corrected stack start and end in stack_thunk_dump_stack().
2020-02-16 09:17:39 -08:00
M Hightower
c07a1fd1b7 Corrected stack start and end in stack_thunk_dump_stack(). 2020-02-14 11:05:04 -08:00
Valerii Koval
5efdc7762a
Allow using custom linker scripts (#7078) 2020-02-13 00:30:26 +02:00
Earle F. Philhower, III
11ae243ecf Merge pull request #7068 from earlephilhower/dtostrf_to_printf
Use sprintf to output floats in Print/dtostrf
2020-02-09 16:24:58 -08:00
Develo
0c1b6f9f96
Merge branch 'master' into dtostrf_to_printf 2020-02-09 15:59:28 -03:00
Earle F. Philhower, III
dbd7b8218d
Fix serach order for index.htm(l)(.gz) files (#7069)
Fixes #6984

When a directory index is requested with an explicit index.html, follow
the original webserver order and check for: index.htm, index.htm.gz,
index.html, index.html.gz, in order.

Fixes the regressions introduced in 9f2cfb8 and 6768116
2020-02-09 15:58:06 -03:00
Earle F. Philhower, III
f762721603 Use sprintf to output floats in Print/dtostrf
Fixes #7043

Two slightly different custom routines were implemented by hand in
dtostrf (an AVR-lib non-ISO function) and Print.  This resulted in
inconsistent output of float/double vars when rounding was needed.

Replace them all with a call to sprintf(), removing the duplicated, not
quite correct code.

Print(String(float)) and Print(float) now generate the same output.
2020-02-09 09:11:41 -08:00
Earle F. Philhower, III
56b90a2abb
Merge pull request #7027 from dok-net/wmath_map
Fix WMath's map() implementation for inverse/round-trip mapping
2020-02-08 20:00:42 -08:00
Earle F. Philhower, III
cd5cbae1f6
Merge branch 'master' into wmath_map 2020-02-08 13:51:48 -08:00
Earle F. Philhower, III
50a491b7fd Merge pull request #7066 from mhightower83/pr-postmortem-offset-update
Updated stack offsets for postmortem stack dump.
2020-02-08 13:12:01 -08:00
M Hightower
f45da1cf25 Updated stack offsets for postmortem stack dump.
Changed ets_putc to ets_uart_putc1 to better newline handling.
2020-02-07 10:02:14 -08:00
Dirk O. Kaar
50fab5162f No need for preprocessor undefinition of optimistic_yield, after all. 2020-02-05 14:31:42 +01:00
Dirk O. Kaar
8d2eca5684 Remove long-since disused define. 2020-02-05 14:31:42 +01:00
Dirk O. Kaar
554435780b Due to 3rd party use of symbol optimistic_yield without #include <Arduino>, have to resort to preprocessor definition for inlining. 2020-02-05 14:31:42 +01:00
Dirk O. Kaar
3767791fbc Allow constexpr evalution to occur. optimistic_yield is always called with a literal parameter value. 2020-02-05 14:31:42 +01:00
Dirk O. Kaar
3d7423bdde Move yield start time set to esp_yield_within_cont 2020-02-05 14:31:42 +01:00
Dirk O. Kaar
598361f3aa Substitute micros() by CPU cycles - faster, but large values for interval_us can overflow - 26s at 160MHz CPU clock. 2020-02-05 14:31:42 +01:00
Dirk O. Kaar
d6e603f397 Fix optimistic_yield to not yield on every call after a loop runs for x us, but yield only every x us between optimistic_yield calls. 2020-02-05 14:31:42 +01:00
david gauchard
a8515a7d66
use STA as default interface in mDNS (#7042) 2020-02-05 10:14:42 +01:00
Dirk O. Kaar
58829022ed Fix "improved_map" from Servo.cpp and use this is in core implementation.
Greatly reduces error rate (half, or 0 zero errors, depends on in/out ranges) for round-trip mapping at the same performance.
2020-02-05 07:28:04 +01:00
david gauchard
14f627218b
update to new prebuilt win sed version (#7062) 2020-02-05 00:05:05 +01:00
Earle F. Philhower, III
6be561617f
Added dependencies for eboot.ld and Makefile to Makefile. (#7047)
Updated eboot.ld to not fill with zeros through the CS field
on its way to the CRC.
Added size test to elf2bin.py
2020-02-03 09:49:13 -08:00
Earle F. Philhower, III
d0316a13fc
Merge branch 'master' into pr-eboot-cs-fix 2020-02-02 15:18:01 -08:00
StanJ
63b73bf181
add Low-Power demo (#6989)
* add Low-Power demo
2020-02-01 21:57:21 -03:00
ramirocarra
378c1f14c7
Update ESP8266HTTPClient.cpp (#7051)
sendRequest has a major problem when sending a big payload, the comparator in the IF loop has its two operators changed, so the last part of payload is never sent
2020-02-01 20:11:00 -03:00
Dirk Mueller
a2141803f1
Code size optimisation of ESP.getResetReason() (#7029)
* Code size optimisation of ESP.getResetReason()

doing if/else snakes for something that is a switch/case
is wasteful, as it repeatedly evaluates the same if() condition.
Also repeating strcpy_P is adding code bloat.

This simplification reduces size from 111 to 41 bytes.

* add break statement also to default case
2020-01-30 13:07:34 -08:00
M Hightower
fe7faf701e Added dependencies for eboot.ld and Makefile to Makefile.
Updated eboot.ld to not fill with zeros through the CS field
on its way to the CRC.
Added size test to elf2bin.py
2020-01-29 13:26:58 -08:00
liebman
9e9515b49f clear _canReuse in setUrl if its not a local redirect (#7039) 2020-01-28 00:35:16 -03:00
Dirk O. Kaar
bb696dd204 host build: optimistic_yield() wrongly delays() instead of avoiding excessive yields (#6802)
* optimistic_yield is a yield, not a delay, and avoids yielding if last yield has occurred recently enough.

* Suppress an unused argument warning.

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-01-27 16:47:39 -08:00
LeisureLadi
7b0fa3554c Update LEAmDNS.cpp (fix issue #6982) (#7025)
* Update LEAmDNS.cpp (issue #6982)

Check m_pUDPContext before calling functions to reset WiFi event callbacks, stop probing ... to close #6982

* Update LEAmDNS.cpp

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-01-27 16:08:30 -08:00
M Hightower
0c6be9e114 Made changes to include "ESP8266_" with ITEAD board names, {build.board}, (#7024)
as proposed by https://github.com/esp8266/Arduino/pull/6972#issue-358508056.
@ttytyper 's changes have been incorporate into this PR
The build flag ARDUINO_SONOFF_... should now appear as ARDUINO_ESP8266_SONOFF_...
@ttytyper, @mcspr, and @d-a-v thanks!
2020-01-27 14:44:08 -08:00
david gauchard
0989932669
allow ".bin.gz" filter in updater file selector (#7026) 2020-01-26 00:56:46 +01:00
Dirk O. Kaar
baf223c6cb Release 6.7.1 (#7034) 2020-01-25 23:54:32 +01:00
david gauchard
6e37ee36f8
fix CI: switch to python3 for pio (#7035) 2020-01-25 22:55:34 +01:00