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

1262 Commits

Author SHA1 Message Date
Dirk O. Kaar
efb8aaa5fb EspSoftwareSerial 5.3.0 version update (#6526) 2019-09-16 15:49:19 +02:00
david gauchard
2d1acfa9a4
add or improve some debug messages (#6508) 2019-09-12 16:08:52 +02:00
david gauchard
5ca0bde200 MDNS: fix random crash on startup (#6261)
* mDNS debug option + AP address is used by default when STA is also present

* mDNS: store network interface, checking it is up

* igmp: force on selected interface (avoid crash *sometimes*)

* fix for all lwip2 ipv4 ipv6 & lwip1

* mdns: IPAddress is not needed to reference associated interface

* mdns: debug: fix print warnings

* emulation: add ets_strncpy

* emulation: truly emulate AddrList (remove fake one)
2019-09-04 20:10:47 -07:00
david gauchard
273f4000f0
Experimental: add new WiFi (pseudo) modes: WIFI_SHUTDOWN & WIFI_RESUME (#6356)
* add new WiFimodes: WIFI_SHUTDOWN & WIFI_RESUME with example
* restore WiFi.onWiFiModeChange()
2019-09-05 03:01:01 +02:00
Dirk O. Kaar
db460388cd SoftwareSerial: Bring submodule in line with upstream release 5.2.9 (#6486) 2019-09-05 01:59:12 +02:00
david gauchard
291b321e62
ClientContext: restore use of two different pending booleans for connect and write #6483 2019-09-04 01:22:56 +02:00
david gauchard
85f1ea7c78
exceptions: optionally enforce c++ standards (#6333)
* exceptions: 3 choices: legacy, std::new never returns 0, or exceptions enabled
* arduino_new (doc, example, array)
2019-08-29 00:21:10 +02:00
Earle F. Philhower, III
0a031ce957
Move all scripts and documentation to Python3 (#6378)
* Move all scripts and documentation to Python3

Python 2 EOL is Jan 1, 2020.  Migrate scripts to run under Python 3.

Under Windows, we're already running Python 3.7, by dumb luck.  The
oddness is that the Windows standalone executable for Python 3 is called
"python" whereas under UNIX-like OSes it's called "python3" with
"python" always referring to the Python 2 executable.  The ZIP needs to
be updated to include a Python3.exe (copy of Python.exe) so that we can
use the same command lines under Linux and Windows, and to preserve my
sanity.

Fixes #6376

* Add new Windows ZIP with python3.exe file

* Sort options in boards.txt generation for repeatability

The order of the board opts dict changes depending on the Python version
and machine, so sort the options before printing them to get a stable
ordering.

* Re-add Python2 compatibility tweaks

Most scripts can run as Python 2 or Python 3 with minimal changes, so
re-add (and fix, as necessary) compatibility tweaks to the scripts.
2019-08-28 12:42:48 -07:00
Iscle
1800bb5abe BasicHttpsClient: Updated demo certificate fingerprint (#6462)
The previous certificate had already expired, I swapped it with the current one.
2019-08-28 11:48:34 -07:00
Dirk O. Kaar
e201f614e8 Fix reverse dependency core Updater -> library ESP8266WiFi (#6398)
* Per @earlephilhower suggestion

* Hints from @earlephilhower

* Namespace BearSSL in core "feels" wrong - using catch-all esp8266 instead.

* After review remarks by @earlephilhower
2019-08-28 11:07:04 -07:00
david gauchard
06f1865628
new network feature: NAPT (widely known as NAT) (#6360)
* lwIP: napt patches (enabled with lwip2 w/o IPv6 w/ features)
2019-08-28 17:51:14 +02:00
david gauchard
45dbc65dba
standardizes processing of _delaying in lwIP callbacks (remove assert) (#6460) 2019-08-28 15:24:57 +02:00
david gauchard
0937b076c8
ClientContext: break timeout delays also on error while writing or connecting (#6454)
This PR stops the 1ms-delay loop also when a tcp error occurs (previously this was done only when tcp had just connected or a write/send had succeeded).
The tcp error can be any, in this case with pubsubclient it is "connection refused" after the mqtt server disappeared and pubsubclient tries to reconnect.
2019-08-27 15:26:27 +02:00
Jeroen88
60d519e235 Bugfix/esp8266 http client (#6176) 2019-08-26 16:12:50 +02:00
thangktran
6dd8474014 libraries: wrong value for setFrequency() (#6409)
Thanks to fix suggestion from @UlliBien.

Fixes: https://github.com/esp8266/Arduino/issues/6380
2019-08-17 12:27:45 -07:00
Zakary Kamal Ismail
0dbb04e881 Add HTTP_HEAD to HTTPMethod and parse it (#6413)
* Add HTTP_HEAD to HTTPMethod

* Parse the HTTP_HEAD variant of HTTPMethod from a method string

* Add HTTP_HEAD to the ESP8266WebServer constants

* Skip sending the content of the response if the HTTP method is HEAD method

* Convert the HTTP status code 418  to string
This status code is an easter egg from the IETF and is described in 
[RFC2324](https://tools.ietf.org/html/rfc2324#section-2.3.2)
2019-08-17 11:58:40 -07:00
Ilya
8f45a0fb91 Set method _connectSSL as protected (#6424) 2019-08-16 13:23:05 +02:00
Earle F. Philhower, III
adfc28d7d8
Fix basic SSL server definitions (#6402)
A typo was present in several ifdefs which would allow a server to negotiate
an EC connection even when in basic SSL mode.  When this happened, a crash
would occur (since there were no EC or advanced AES modes installed).

Fix the typo, fixes #6397
2019-08-08 21:54:59 -07:00
teo1978
a8873c2364 fix documented parameter (#6392) 2019-08-07 14:16:07 +02:00
david gauchard
88f0410c4b
ensure consistency for gdb hooks signatures (#6391) 2019-08-07 11:18:45 +02:00
thangktran
f78ab66f89 libraries: fixed no "OK" ACK for Signed Update (#6351) 2019-08-01 14:00:49 +02:00
Earle F. Philhower, III
d2fde8dee0
Fix trivial extra "\n" on web update success (#6350)
Fixes #3290
2019-07-26 16:34:22 -07:00
Earle F. Philhower, III
824a83347d
Update LittleFS/SdFat to current project head (#6345)
* Update LittleFS to current project head

Several bugfixes noted in the LittleFS added:

https://github.com/ARMmbed/littlefs/commits/master

* Also update SdFat to latest upstream head

Also adds a delay(0) every 5000 fat clusters examined to avoid WDT
errors on highly fragmented FAT filesystems.
2019-07-25 13:50:58 -07:00
Earle F. Philhower, III
aa0bc3372f Add plain char* signatures WebServer::sendContent (#6341)
Fixes #2567

Allow the web server to send plain C strings instead of requring they be
encapsulated inside a String class object.  Saves memory vs. having to
convert C strings to Strings (i.e. duplication of data), overloads on
the efficient sendContent_P(char*) methods.
2019-07-25 13:39:57 +02:00
david gauchard
5cb82c1610
webserver: restore legacy request handler (#6321) 2019-07-20 08:29:02 +02:00
Dirk O. Kaar
d9684351c2 Make delay() as overridable as yield() already is, and add overridable loop_end() (#6306)
* Make delay() overridable "weak"

* Add pluggable loop_end()

* Release tag 5.2.3 for SoftwareSerial
2019-07-18 14:40:58 -07:00
Earle F. Philhower, III
52f8c62b81
Fix GCC 9.1 warnings (except Ticker.h, gdbstub) (#6298)
Cleans up all warnings seen w/GCC 9.1 to allow it to track the main
branch more easily until 3.x.

Does not include Ticker.h "fix" of pragmas around a function cast we're
doing that GCC9 doesn't like, that will be addressed separately and
maybe only in the 3.0 branch.

Does not include GDB hook fix, either, because the pragmas required
to disable the GCC9.1 warnings don't exist in 4.8 at all.
2019-07-14 21:22:49 -07:00
Earle F. Philhower, III
c18b402c31
Add a dump of received FP and CERT when in debug mode (#6300)
* Add a dump of received FP and CERT when in debug mode

To simplify BearSSL debugging, print the received FP (when it doesn't
match the expected) and the binary certificate (always), when in debug
mode.

* Add documentation section on FP mismatch in rare instances.
2019-07-14 14:09:44 -07:00
Earle F. Philhower, III
8c37601614 Fix Ticker callback casting. (#6282)
Fixes errors seen in #6281 and adds a slight test case to the examples
to ensure no compiler errors.
2019-07-10 23:15:10 -04:00
Earle F. Philhower, III
7c6701512f
Clean up remaining non-LeaMDNS diffs from gcc4.8 to gcc7.2 (#6279)
With this change plus the leamdns change, the core will compile
unmodified on GCC 4.8 and GCC 7.2, making keeping the two in sync for
3.0 much easier.
2019-07-10 13:52:38 -07:00
Dirk O. Kaar
48ace77b48 Refactored to avoid compiler warning (#6278)
Fixes commit 2d9253e46c41ef6949759ec028a356917d289831.
2019-07-10 10:47:01 -07:00
david gauchard
1b3ac4f5e9
Switch default FW to "2.2.2-dev(38a443e)" (menu:2.2.1+100) (#6272)
* enable by default latest 2.2.x firmware, including fixed espnow
* LittleFS: avoid crash when FS size is 0
* flash size defaults: 1M for generic board, not empty FS for all
2019-07-09 20:18:55 +02:00
nouser2013
adf2b14a6a Add support for newer mobile OS changes. (#5529)
* Add support for newer mobile OS changes.

Took me quite a while to figure this out, but according to this issue (https://github.com/espressif/arduino-esp32/issues/1037), in order to get a captive notification to show or the popup to open, the DNS server must resolve to a public IP. It will not work with a pivate one (e.g. 192.168.4.1).

On Android, a notification ("Register with Network") is displayed in top left notification bar.
On IOS, the login popup is displayed.

* Add support for newer mobile OS changes.

Took me quite a while to figure this out, but according to this issue (espressif/arduino-esp32#1037), in order to get a captive notification to show or the popup to open, the DNS server must resolve to a public IP. It will not work with a pivate one (e.g. 192.168.4.1).

On Android, a notification ("Register with Network") is displayed in top left notification bar.
On IOS, the login popup is displayed.
2019-07-08 16:12:28 +02:00
Earle F. Philhower, III
d2a487dfd9 Clean up code to build under GCC7, fix pgm_read_unaligned (#6270)
Apply most compatible changes needed to get the core compiling under GCC
7.2 to the main gcc 4.8 tree to ease porting for 3.0.0.

Update pgmspace.h with corrected and optimized unaligned pgm_read
macros.  Now pgm_read_dword in the unaligned case gives proper results
even if optimization is enabled and is also written in assembly and only
1 instruction longer than the pgm_read_byte macro (which also has been
optimized to reduce 1 instruction).  These changes should marginally
shrink code and speed up flash reads accordingly.

The toolchain should/will be rebuilt at a later time with this
optimization to ensure it's used in the libc.a/etc. files.
2019-07-08 10:17:48 +02:00
david gauchard
3f0f2143f8
fix bug in storing UDP remote address (#6263) 2019-07-06 12:30:40 +02:00
Earle F. Philhower, III
6bd4b1c4f7
Clean up trivial gcc -wextra warnings (#6254)
After verifying that they really were spurious, clean up the warnings
that gcc -wextra reports, except for LeaMDNS.

Upgrade GCC to gcc-7 for host builds
2019-07-05 22:31:50 -07:00
mayankgour13
8b1af68e3f Infinite loop while passing File(FS.h) resolved (#5038)
Stream.available() never reaches to -1 which makes it an infinite loop. When File (FS.h) goes empty it reaches to 0 not -1.
2019-07-05 09:02:01 -04:00
Alexander Emelianov
4bfa2ae889 TCP connect and send delay fix (#6213)
* TCP connect and send delay fix
Implement early exit as connection established or data already sent.
(Previous implementation was exiting only on timeout expired)
2019-07-05 12:11:40 +02:00
Earle F. Philhower, III
a0634a71a9
Fix mixup with boolean/bitwise or for BSSL probing (#6252)
Fix an error identified by -wextra where the size of the SSL extension
section in the probeMFLN call only.
2019-07-04 09:14:50 -07:00
dav1901
16312949c9 Add timeout to STA::waitForConnectResult (#5371) 2019-07-04 14:08:02 +02:00
aesapronov
e81bb6f57c HTTPClient: Added possibility of sending POST with empty payload (#4275)
* Added possibility of sending POST with empty payload
Specification does not prohibit the sending of an empty POST requests. In this case "Content-Length: 0" should be set. See thread here: http://lists.w3.org/Archives/Public/ietf-http-wg/2010JulSep/0276.html
2019-07-04 13:00:54 +02:00
Chris van Marle
6272b49406 Updater signature validation - format incompatible w/RFC8017 (#6250)
* Add hash OID to signature verification (#6201)

* Add legacy signing option

* Describe and use the legacy option of signing.py
2019-07-04 12:17:30 +02:00
Earle F. Philhower, III
7036297920 Convert ESP8266WebServer* into templatized model (#5982)
* Convert ESP8266WebServer* into templatized model

Supercedes #4912

Refactor the three versions of ESP8266WebServer and *WebServerSecure to a
single templated class. Use "using" to enable old, non-templated names to b
used (so no user changes required to compile or run).

Fixes #4908 and clean up the code base a lot.

Basic tests run (the ones in the example code).

No code changes are required in userland except for setting the SSL
certificates which now use a cleaner "getServer()" accessor and lets the
app use the native BearSSL calls on the WiFiClientSecure object.

@devyte should be proud, it removes virtuals and even has template specialization...

* Fix HTTPUpdate templates and examples

* Fix HTTPUpdateServer library build

Need to remove dot-a linkage since there are no .cpp files in the
directory anymore due to templates.

* Provide backward-compat names for updt template

Allow existing code to use the same well known names for
HTTPUpdateSecure.

* Remove ClientType from all templates, auto-infer

Remove the ClientType template parameter from all objects.  Simplifies
the code and makes it more foolproof.

Add a "using" in each server to define the type of connection returned
by all servers, which is then used in the above templates automatically.

* Can safely include FS.h now that SD/SPIFFS unified

* Move the templates/objects to their own namespaces

* Fix merge issues with untemplated methods

* Address review comments

* Fix mock test, remove warnings inside test dir

Make the simple mock test CI job pass and clean up
any spurious warnings in the test directory.

There still are warnings in the libraries and core, but they
should be addressed in a separate PR.
2019-07-04 10:58:22 +02:00
david gauchard
6272e897ca
mock: addrList fix (#6248)
* improve mock tcp write
* mock addrlist
* add a single mock build in travis
2019-07-03 09:49:03 +02:00
david gauchard
f9009b8a5e
mDNS: restriction to a single interface (#6224)
Default interface is STA (or AP if available and STA is unavailable).
An interface can also be specified in ::begin() by its IP address.
MDNS will not cross interfaces (there is currently no notion of "bridged interfaces")

Multiple instances should be working, this is not tested in this commit.
2019-06-27 09:30:12 +02:00
david gauchard
5306976db1
udp remote pbuf helper: honor fragmented packets (#6222)
fix for #5960 didn't take fragmented packets into account
fixes #6218
2019-06-26 21:35:43 +02:00
Dirk O. Kaar
7d8782acfc EspSoftwareSerial public release 5.2.2 (source code collision with DHT lib resolved) (#6227) 2019-06-26 07:44:35 -07:00
Dirk O. Kaar
f5a882d03d Put InterruptLock (from interrupts.h) into namespace esp8266 to fix now and future (#6225)
collisions with 3rd party Arduino libraries (currently Adafruit DHT has this issue)
2019-06-25 11:14:45 +02:00
Dirk O. Kaar
2e3e1d5e98 EspSoftwareSerial release 5.2.1 (#6219)
* Track breaking API chance in EspSoftwareSerial.

* Revert "Track breaking API chance in EspSoftwareSerial."

This reverts commit 78aa3e84321935dcc3cfb7ebe8c293ccb0c06a79.

* Track breaking API chance in EspSoftwareSerial.

* Bug fix in EspSoftwareSerial

* EspSoftwareSerial: improved memory fences

* Refactoring upstream

* EspSoftwareSerial fixed a high-bitrate error source, probably caused by end-bit detection

without checking for same-level timestamps from the IRQ

* EspSoftwareSerial examples updates

* Fix to stop bit detection in EspSoftwareSerial

* Latest bit timings fix in EspSoftwareSerial.

* EspSoftwareSerial examples

* EspSoftwareSerial latest throughput results in comments of loopback.ino

* Lastest EspSoftwareSerial, dependent on a few as yet unmerged PRs, tho

* Submodule EspSoftwareSerial release 5.2.0 with workaround for as yet missing attachInterruptArg in Arduino.h

* EspSoftwareSerial release 5.2.0, includes workaround for missing attachInterruptArg in ESP8266 Arduino

* EspSoftwareSerial: CI failed on examples - defines for Wemos board GPIOs.
2019-06-24 14:32:59 +02:00
david gauchard
fc77f2e89c
littlefs: fixes for mock/emulation, use in FSBrowser example (#6211)
* littlefs: fixes for mock/emulation, use in FSBrowser example
* emulation: makefile: integrate arch size into object file names
2019-06-20 23:34:27 +02:00