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

1635 Commits

Author SHA1 Message Date
Hasenradball
193043d19b
Update ESP8266WiFiSTA.cpp (#8229)
change return to `WL_WRONG_PASSWORD` if there is an issue with the password!
2021-09-29 09:35:32 +02:00
Juraj Andrássy
64e87f1149
WiFi library ArduinoWiFiServer update (#8238)
* ArduinoWiFiServer - check for clients in write() too
2021-09-22 19:31:07 +02:00
Benoît Blanchon
612e7ffd7f
Remove temporary buffer in ConfigFile.ino (#8298)
When reading from a `Stream`, like `File`, using a temporary buffer is counterproductive because it complexifies the code and increases memory usage.
It's also a source of confusion because it can create dangling pointers in the `JsonDocument`.
The only benefit of using a buffer is the reading speed, but I don't think speed is the focus in this example; if it were, it would use a buffer in `saveConfig()` too.
2021-09-16 11:23:08 +02:00
Claus Näveke
140d0ffde1
Add writeToPrint to ESP8266HTTPClient (#8056) 2021-09-04 10:46:47 -07:00
Vlasta Hajek
d3f16b3177
Allow manually setting MD5 checksum for HTTP update (#8204) 2021-09-04 10:34:00 -07:00
Paulo Cabral Sanz
058ce7c08e
Allow control over HTTPClient authorization String allocation (#8225) 2021-09-04 10:17:00 -07:00
behrooz bozorg chami
65db3aec72
Add HTTP delete method (#8214) 2021-09-01 09:42:19 -07:00
Oxan van Leeuwen
fb5c4a6420
Place deprecated attribute in front of function (#8258) 2021-09-01 09:03:12 -07:00
Dirk O. Kaar
9f30f2469f
EspSoftwareSerial maintenance update 6.13.2 (#8295)
* EspSoftwareSerial maintenance update 6.13.1

* EspSoftwareSerial 6.13.2
2021-08-30 16:48:28 -07:00
Dirk O. Kaar
5f04fbbf5f
EspSoftwareSerial minor release 6.13.0: Improve support for availability of GPIOS on ESP32 S2 and ESP32C3 (#8260) 2021-08-07 15:05:05 -07:00
david gauchard
14c3798d4f
release 3.0.2 (#8242) 2021-07-26 22:27:44 +02:00
Earle F. Philhower, III
f9084603de
Make multiple FS begin calls noops() SDFS/LittleFS (#8235)
When LittleFS.begin() or SDFS.begin() is called after the filesystem is
already mounted, don't unmount/remount.  When an unmount happens, all old
Files become invalid (but the core doesn't know this), so you would end
up with random crashes in FS code.

Now, check for _mounted, and if so just return immediately from begin().
This mimics the original SPIFFS code.

Fixes https://github.com/earlephilhower/ESP8266Audio/issues/407
2021-07-26 21:58:40 +02:00
Earle F. Philhower, III
cfb6d50844
Fix PRxxx printf format macros (#8222)
* Fix PRxxx printf format macros

Update toolchain (newlib) to supply proper definitions for PRxxx macros.
Fixes #8220

Added a PRxxx macro to an example to ensure CI will catch any problem like
this in the future.
2021-07-26 21:41:08 +02:00
Dirk O. Kaar
bc302511f5
Clean up use of "byte" as a type. uint8_t or (C++17) std::byte are better. (#8090) 2021-07-26 21:20:45 +02:00
M Hightower
8a42163a50
Call umm_init just before starting SDK (#8207)
* Recover the BearSSL crash stack before the Heap is initialized and zeros it.
* Added comments for hwdt_pre_sdk_init()
* Keep Basic ASM version of app_entry_redefinable and removed alternate "C"/Extended ASM version. Update comments.
* Improved example HwdtStackDump to use StackThunk
2021-07-19 07:58:37 -07:00
david gauchard
69f8cd6934
Certificate and public keys automatic updater (#8218) 2021-07-17 16:29:46 -07:00
Paulo Cabral Sanz
c9f27410f7
Fix NO_GLOBAL_INSTANCES for Serial ports (#8184) 2021-07-17 16:21:37 -07:00
hreintke
09c4e33106
Netdump printf fix (#8215)
* Fix crash printf long getTime()

* Update several printf to printf_P
2021-07-17 11:50:15 -07:00
per1234
25a21c3e7d
Use valid categories in library.properties of bundled libraries (#8221)
When using previous IDE versions, the use of an invalid category value caused a warning to be displayed on every compilation:

WARNING: Category 'Network' in library lwIP_PPP is not valid. Setting to 'Uncategorized'
WARNING: Category 'Network' in library lwIP_enc28j60 is not valid. Setting to 'Uncategorized'
WARNING: Category 'Network' in library lwIP_w5500 is not valid. Setting to 'Uncategorized'
WARNING: Category 'Network' in library lwIP_w5500 is not valid. Setting to 'Uncategorized'

List of valid category values:
https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format
2021-07-17 11:00:14 -07:00
M Hightower
40876dc6ba
Fixes failing https connections to HelloServerBearSSL when using the (#8206)
MMU option with 48K IRAM shared. This happended after changes that
increased IRAM code size that caused  free IRAM for Heap to fall
below ~16K, then "new" would OOM out in WiFiClientSecureBearSSL.

Added private function to try IRAM first then switch to DRAM on fail
to WiFiClientSecureBearSSL for iobuff allocations.
2021-07-11 22:22:34 +02:00
M Hightower
a105bdd359
add comments and corrections (#8201)
* Added comments for ets_install_uart_printf and corrected it usage.

* Correct case for hotkey 'p'.
Added conditional build around option 'p' to call stack_thunk_dump_stack
which can only print when debug is enabled.
2021-07-08 16:11:58 -07:00
Dirk O. Kaar
29c63506f7
Update to EspSoftwareSerial bug fix release 6.12.7, build fix for ESP-C3 RISC V MCU. (#8195) 2021-07-07 08:47:08 -07:00
Earle F. Philhower, III
d1c7c046d5
Don't crash when includeing LittleFS.h w/no FS (#8173)
* Don't crash when includeing LittleFS.h w/no FS

The LittleFS constructor could cause a divide-by-zero error and crash the
chip during pre-main startup (i.e. when the constructors were called).

Avoid by only initializing the LittleFS control structure when there is
a filesystem specified in the flash layout.

* Be even more paranoid on begin() and format()
2021-06-26 00:30:42 +02:00
david gauchard
20de82588e
SDFS: fix AvailableForWrite: do not always return 0 when space is available (#8167) 2021-06-25 17:19:17 +02:00
david gauchard
32fad07a70
ESP266httpUpdate: remove dead API and fix doc (#8063) 2021-06-22 18:22:42 -07:00
Earle F. Philhower, III
45e7976c50
Fix stopAllExcept with WiFiClientSecure (#8136)
Fixes #8079

Because WiFiClientSecure inherits WiFiClient, and WiFiClientSecureCtx also
inherits WiFiClient, they both end up in the list of TCP connections that
are used for WiFiClient::stopAllExcept().  This would cause the underlying
SSL connection to be closed whenever you attempted to
stopAllExcept(WiFiClientSecure)

Fix by adding a "_owned"(by) pointer in the WiFiClient object which points to
nullptr (default case) or to the associated lower-layer connection.
When stopping all connections except one, only look at the lowermost
connections.
2021-06-20 10:43:05 -07:00
idolpx
1a5ef71298
Change protocol detection so uppercase or lowercase works (#8137)
Make protocol detection case insensitive
2021-06-17 15:48:30 -07:00
david gauchard
b4774edbfb
httpclient: remove old example (#8111) 2021-06-09 10:04:10 -07:00
Earle F. Philhower, III
2185f9bd73
BREAKING - "i2s.h" removed, I2S library added (#8108)
* BREAKING - "i2s.h" removed, I2S library added

An "i2S.h" header was present in prior cores, but this conflicts with the
Arduino standard I2S.h header for the I2S class under Windows (because of
case insensitivity).

Initial 3.0.0 release has a redirect "i2s.h" file in the cores directory to
redirect to the "I2S.h" file in the library, but under Windows this resulted
in the IDE not building the I2S library and link errors.

Remove the offending header.  Code will need to mode to including "I2S.h"
instead (which will include both the Arduino class as well as the low-level
definitions).

Fixes #8107

* Update examples to use proper I2S.h version
2021-06-08 23:12:23 +02:00
david gauchard
a183e3fce5
more of Use optimal bundled library name (#8098)
Ref: https://github.com/esp8266/Arduino/pull/8088#issuecomment-853711167
2021-06-03 13:20:11 +02:00
per1234
e21ae06699
Use optimal bundled library names (#8088)
When multiple libraries contain files matching an #include directive in the program, the Arduino build system must pick
one to use for compilation. Multiple factors are used in order to make an intelligent determination of which library is
best.

In order to enhance this determination, the closeness of match between the library.properties name value and the
filename in the #include directive is being added as one of those factors. This new factor is referred to as
"Library Name Priority".

Unfortunately, this change can result in platform bundled libraries which had previously been correctly correctly chosen
no longer being given priority over their equivalent standalone libraries, which may be incompatible or not optimized
for the platform's boards.

This priority inversion only occurs when all the following conditions are true:

- There is a standalone library installed which provides a header filename collision.
- The platform bundled library is architecture optimized (e.g., architectures=esp32).
- The standalone library is architecture compatible (architectures=*).
- The standalone library has equal "Folder Name Priority".
- The standalone library has better "Library Name Priority" (e.g., name=SD vs name=SD(ESP32) for a library with primary
  header file SD.h.

The fix is to simply give the platform bundled library a perfect "Library Name Priority".

Some platform bundled libraries were given a modified name as a workaround to a bug in the Arduino IDE's Library Manager
which caused Library Manager to always show the library as updatable under specific circumstances. That bug was fixed in
Arduino IDE 1.8.6, ~3 years ago.
2021-05-31 07:34:35 -07:00
Dirk O. Kaar
fa7a330741 Update EspSoftwareSerial to bug fix release 6.12.6 2021-05-27 21:33:15 +02:00
Earle F. Philhower, III
60fe7b4ca8
Add code-spell spelling checks to CI (#8067)
Help find and fix silly spelling errors as they are added to the repo.
2021-05-23 08:53:04 -07:00
Dirk O. Kaar
7571c729f5 Revert change after review comments. 2021-05-18 15:43:27 +02:00
Dirk O. Kaar
95b06cee0b Explain function of special PolledTimeout to the code reader 2021-05-18 15:43:27 +02:00
Dirk O. Kaar
f382fc9d77 Refactoring to PolledTimeout or optimistic_yield on the grounds that these are not wait loops on slow input. 2021-05-18 15:43:27 +02:00
Juraj Andrássy
3a3d1c693d
added ArduinoWiFiServer with send-to-all-clients functionality (#7612)
and with available() working according to Arduino documentation
plus PagerServer example
2021-05-15 13:50:15 -07:00
Max Prokhorov
4436e32a50
WiFi: clean up AP SSID setter & getter, support 32 chars (#7941) 2021-05-15 12:28:22 -07:00
Dirk O. Kaar
1a455ffd8d
Fix a warning reported by @Tech-TX (#8014) 2021-05-15 10:54:53 -07:00
Max Prokhorov
b0ece8cac4
[BREAKING] wifi: remove pseudo-modes for shutdown, expose ::[resumeFrom]shutdown() (#7956)
* wifi: remove pseudo-modes for shutdown

make shutdown and resumeFromShutdown public
removes extra code from the mode handler and include method description
in the docs

* typo

* dup

* typos

* reference only shutdown() & resumeFromShutdown()

prefer to have some specific function, don't simply chain into sleep
update examples and docs

* safeguard raw sdk config usage
2021-05-15 19:49:35 +02:00
Adam Horvath
e9820c1f27
Adding comment to ignore SSL in sample code. (#7994) 2021-05-15 18:24:33 +02:00
david gauchard
6da2bfb664
simplifying internal code using stream::send api (#7995) 2021-05-15 18:13:05 +02:00
Dirk O. Kaar
4462fea2a6
Maintenance release 6.12.3: better dependency declarations for Platformio (#8030) 2021-05-15 17:58:11 +02:00
david gauchard
f4178e58dc
fixes for WiFiClient::write(Stream) (#7987)
fixes for WiFiClient::write(Stream) and Stream transfers
- remove deprecated WiFiClient::write(Stream,size)
- fix and deprecate WiFiClient::write(Stream) to use Stream::sendAll instead of ::sendAvailable
- update ESP8266WebServer::streamFile to use file.sendAll(client) instead of client.write(file)
- remove stream dependence in ClientContext
- Stream::send(): honor timeout in all case, avoid short transfer when output is temporarily full
- example WiFiEcho: show sendAll and sendAvailable
2021-04-27 16:02:19 +02:00
Dirk O. Kaar
457692101a
Move prototype for enablePhaseLockedWaveform linker magic into header that's included by default instead of particular internal core header. (#7996) 2021-04-22 14:02:54 -07:00
Dirk O. Kaar
cfbbd6f22d
enableWiFiAtBootTime() should be declared in ESP8266WiFi.h (#7993) 2021-04-18 22:17:14 +02:00
Dirk O. Kaar
ae359cc5f6
EspSoftwareSerial 6.12.2: Inlining push() functions that must be in IRAM for calling from ISRs (#7986) 2021-04-18 00:04:17 -07:00
Dirk O. Kaar
41de4115fd
Resolve "PWM-locked" / "phase-locked" waveform merge leftover in Servo lib (#7978)
Library was overlooked in "PWM-locked" / "phase-locked" waveform mode merge.
2021-04-17 13:43:02 -07:00
david gauchard
1cc6960a55
[BREAKING] Disable WiFi at boot by default (#7902)
* Disable WiFi at boot by default

* +define WIFI_IS_OFF_AT_BOOT

* remove now useless example

* mv enableWiFiAtBootTime() to core_esp8266_features.h

* sync with master

* per @earlephilhower review: a file was missing

* doc

* WiFi persistence is now false by default

* fix doc

* ditto

* doc: remove sphinx warnings (fix links and formatting)

* fix link name

* fix doc

* legacy: restore persistence

* undeprecate preinit()

* move force modem up to when mode has changed (per @mcspr review)

* do not wake up from sleep when mode if OFF

* fix doc per review
2021-04-09 23:01:11 +02:00
M Hightower
da6ec83b5f
Hardware WDT Stack Dump Tool (#7010)
* Hardware WDT Stack Dump

This Sketch demonstrates the use of a tool to print a stack dump
at reboot after a Hardware WDT event.

The module hwdt_app_entry.cpp writes a stack dump to the serial interface
after a Hardware Watchdog Timer has struck and a new boot cycle has begun.
The sketch must properly initialized the Serial port before the crash.

hwdt_app_entry.cpp is the core file that does the work.

* Corrected Style. Improved HWDT reset detectionat boot.

* Style and typos

* Update comments.

* Improvements to reset reason determination.
Improved comments.
Added option to match the UART speed used by the sketch.
Added option to print greeting at the start to indicate the HWDT stack dump code is active.
Isolated logic for handling strings: one assuming they are not inited at
the time the code is running and one that does. The later appears to be the case.

* Style plus
Fix issue with HWDT reason detection when sketch crashes too fast.
Added sample sketch menu option for crashing with a function defined
with a weak attribute via prototype, but never actually defined in
full function form. eg. `void trouble(void){return;}`

* Moved all configuration options to the top.
Adjusted configuration option order for most likely to be used to the top.
Tried to improve comments.
Replace numbers with enum values.

* Removed clutter of having an alternate printing method.
Regular global strings have worked reliably.
Tweaked reset reason detection.
Reordered elements in global structure.
Improve #if test for debug option
Always improving comments.

* Added delays around uart_div_modify. This appeara to resolve the lost
data problem that occurs when printing after a flash upload using esptool.
Curiously, esptool stub also uses similar delays.
Word choices and description improvements.

* Finished TODO looked at assembly of app_entry_redefinable to confirm
no mixed up stack frame was created. Also removed no longer needed
extra level of function calling.
Use existing macros from uart_register,h to handle getting current
UART speed. Added some missing `const`.

* Comment changes.
Added a few newlines to printing.
Decreased the settling delay after the uart_div_modify call.

* Improved comments.
Print caution message when stack integrity checks failed.

* Several corrections to set_uart_speed
Comment improvements
Added missing ";"

* Removed unused include.
Code cleanup.
Comments.

* Now runs from flash before SDK is started.
Cache_Read_Enable working. Free 1K of IRAM and 200 bytes of DRAM.

* Changed ICACHE size from 32K to 16K to avoid conflict with
SDK or core selecting smaller 16K ICACHE.

The Issue: Cache_Read_Enable does not clear the bit field when mapping IRAM to
ICACHE on register 0x3FF00024. Thus, no problem upgrading from 16K to 32K;
however, you cannot downgrade from 32K to 16K. These bits are cleared at boot.

Improved uart data rate change handling.

Update comments.

* Added support to print ThunkStack.
Adjustments to inline asm. Added "memory" when callx0 is used.

* comment cleanup. added missing additional #if defined()
Made structure name unique. Changed HWDT_INFO to HWDR_INFO_S.

* Update style used for structure and typedef to match that used in core
when snake case is used. Moved a constexpr block up a scope so that
some #ifdef debug code compiles again.

* Updated comments

* Corrected new errors from upgrade to GCC 10.1 toolchain related to
constexpr and casting integers to pointers.
Cleared warning for asm.

* Work around divide by 0 HWDT event under toolchain 10.1.

* Changes to move feature into core.

Making ready for selection via tools menu, updated defines to DEBUG_ESP_,,, format.
Added HWDT and HWDT_NO4KEXTRA options to boards.txt.py. These options are selectable
from Arduino IDE 'Tools->Debug Level'
Converted macro names that use to be constexprs to uppercase.
Update comments. Added comments to maintainers anotated by '//C'
Revised example.

* Fix stack character buffer length.

* Updated comment to reflect support via Arduino IDE Tools menu.

* Improve meshing of HWDT and NOEXTRA4K

* Made compatible with `disable_extra4k_at_link_time()` usage.

Changed to strings containing "no4kextra" to "noextra4k" to be consistant with
original usage.

Updated example to provide indications of which build options were used or resulted.

Some comment cleanup.

* CI style

* Adjusted down the ROM Stack space for the extra 4K Heap option.
If too large, a really bad crashes occurs.

Updated the example to start WiFi. This helps double check ROM
Stack space size is not too small at start.

Removed stale comment.

Changed cont stack check functions to make globally available.

* Add replacement aes_unwrap for the debug HWDT option.
Improves the SYS stack space available when using the extra 4K Heap
option in conjunction with HWDT. Replaces the ROM AES buffer at
0x3FFFEA80 with one provided by malloc().

* Update umm_info_safe_printf_P to support default of unaligned PROGMEM strings.

* Improve cont stack trace for yielding case.
Check if cont stack is yielding to SYS, use g_pcont->sp_yield to limit the
amount of the cont stack dumped.

Generalized dev logic path to create a generalized debug function hwdt_pre_sdk_init_icache.

* Added missed update to heap.cpp for change to use PSTR instead of PSTR4

* Updated comments and #if in aes_unwrap.

* Update boards.txt
2021-04-08 01:35:49 +02:00