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

460 Commits

Author SHA1 Message Date
Max Prokhorov
7af5246c12
Docs - fix sphinx v8 builds (#9235)
abnormal version selection w/ nbsphinx causing us to fall down to 5.x.x
venv install specific versions, fix arguments provided to the sphinx-build
2025-03-11 00:04:47 +03:00
Greg Sadetsky
bb79e9076e
Documentation - fix links in station-class.rst (#9191) 2024-11-20 20:07:01 +03:00
raliotech
bd136f1c20
Boards - add Mercury 1.0 (#9166)
Co-authored-by: Gaurang Gupta <iotgupta@gmail.com>
2024-07-31 01:40:57 +03:00
Max Prokhorov
1b6f815463
Sphinx syntax fixes (#9180)
get rid of warnings when converting python -> rst, force quit when they happen
fix code-blocks, always need extra line
fix invalid headers refs so they actually work
2024-07-31 01:28:46 +03:00
Clemens Kirchgatterer
2bb1b5a4d5
Fix semantic typo in generic-examples.rst (#9107)
exists -> exits
2024-03-19 18:01:59 +03:00
Max Prokhorov
2064d437a3
ESP8266WiFi - document event handler lifetime, add [[nodiscard]] (#9087)
* disallow not assigning wifieventhandler somewhere

* fix markdown syntax in rst

* mention lifetime in example and docs
2024-03-17 21:11:32 +03:00
david gauchard
d5eb265f78
WiFi config(): warning for legacy idioms (#9050) 2023-12-12 00:57:57 +01:00
Juraj Andrássy
ce210840b4
document WiFi.config Arduino parameters versions (#9045) 2023-12-08 10:25:38 +01:00
david gauchard
71764d2681
doc: config(0,0,0) to restore dhcp + mention portable network API (#9042) 2023-12-04 16:12:32 +01:00
Juraj Andrássy
ee953737dd
WiFiServer - allow constructor without parameters (#9026) 2023-11-13 00:10:26 +01:00
david gauchard
d0f7293491
optionally move float emulation code into iram (#8958)
* optionally move float emulation code into iram
allows doing float operation in iram
suitable for libraries like AccelStepper when called from ISR
* proposed changes for pio from @mcspr
2023-11-12 23:53:39 +01:00
Holger Müller
fb8d6d668d
ESP8266HTTPUpdate: Get available firmware version from update server (#8968)
* added getAvailableVersion(), moved _httpClientTimeout and _followRedirects to protected, added enum HTTPUpdateError

* auto numbering of HTTPUpdateError enum

* added getAvailableVersion(), debug output current current Sketch MD5

* updated advanced updater php script

* switch case indention corrected

* Revert "added getAvailableVersion(), debug output current current Sketch MD5"

This reverts commit 60d2c7762e7fb1fed7fae37fa99be149e12f125c.

* Revert "auto numbering of HTTPUpdateError enum"

This reverts commit 61785b27da3f2d42f8f95316d78ce22e5b00103a.

* Revert "added getAvailableVersion(), moved _httpClientTimeout and _followRedirects to protected, added enum HTTPUpdateError"

This reverts commit cec84ed17ab149d3e48082293f9e2723246b7d0b.

* corrected incorrect merge with master
2023-11-05 00:01:49 +01:00
Earle F. Philhower, III
1662248b39
Add link to IDE 2.x LittleFS upload tool (#8998) 2023-10-08 10:30:00 -07:00
Luciano Martorella
1a4663fbe8
Add virtual beginMulticast(...) stub to UDP class (#8969)
* - Same UDP API of ESP32 core

* - PR review
2023-08-15 19:25:58 +03:00
Max Prokhorov
10cd3a1eae
Document git version install, upkeep and PR management (#8902) 2023-07-19 00:12:35 +02:00
M Hightower
d3c102e717
Update documentation and arduino debug options (#8837)
* Update documentation

Describe how to improve Exception Decoder results.

Updated build option details.

* Added d-a-v's code. And updated description and debug macro.

* Update doc

Updated platform.txt - positioned -Os such that it can be overridden by `build.opt`.

Add suggestion of using `-Og` which may improve the Decoder's line number correlation
with the problem in the source code.

Untested adjustments to platformio-build.py

* Fixed code formatting

* Fixed example

Previously `-O3` in the example had no effect. It was overridden by later flags.
Reording the `-Os` allowed changing optimization to  work. Somehow this triggered
a new warning "Stream.h:50:7: warning: 'f.Stream::_startMillis' may be used
uninitialized in this function". Replaced `-O3` with `-Og`.

* Proposed "Debug port" menu change
Preserves a pathway for `build.opt` override.

* Update boards.txt.py and docs - WIP

* Improve organization of optimization content.
Use "Debug Optimization" for menu name.
The menu item defines the initial optimization.
platform.txt - optimization parameter can be overridden by build.opt.

* Add fallback value for build.debug_optim to platform.txt

* update text and undo changes to platformio-build.py

* tweak text

* Added ':orphan:' mark to a06-global-build-options.rst

* Update doc. Added link in page index to 'Improving Exception Decoder Results'

* Update text to reference PR#8868 improvements for leaf function.
2023-03-29 11:16:33 +02:00
Max Prokhorov
734defb87d
mkbuildoptglobals.py: assert python version (#8886)
Fix unused var causing warnings
Assert minimal supported version of python3
Python 3.7 in documentation
2023-03-17 11:10:14 +03:00
Lars Kellogg-Stedman
6ad9bf3b07
Expand the esp8266 hardware debugging limitations section (#8879)
It's trivial to run into a problem caused by the single hardware breakpoint
limitation, but the existing documentation doesn't explicitly address this
situation (and search results for the error message aren't particularly
helpful).

This commit updates the documentation with an explicit example of what
happens when a breakpoint expression matches multiple locations, along with
a possible workaround.
2023-03-11 12:44:50 +01:00
Max Prokhorov
204d2c93a7
NONOS SDK clean-up (#8770)
Remove nonos-sdk-v2.2.0-28-g89920dc aka 3v0, since we have a real v3
Remove 3.0.0...3.0.4 to reduce overhead in maintaining a bunch or binary patches
Update our docs and menu opts to mention 'experimental' status

Old versions still remains in git history, so anyone wanting to play around with 3.0.x could still make use of that work
2023-01-03 01:40:53 +03:00
M Hightower
4a0b66b017
Heap addendum to handle changes in NON-OS SDK 3.0.x (#8746)
## WPA2 Enterprise connections
References - merged PRs:
* https://github.com/esp8266/Arduino/pull/8529
* https://github.com/esp8266/Arduino/pull/8566 - these occurred with connect/disconnect with WPA-Enterprise
* https://github.com/esp8266/Arduino/pull/8736#issue-1470774550

The NON-OS SDK 3.0.x has breaking changes to the [`pvPortMalloc`](bf890b22e5/include/mem.h (L42)) function. They added a new `bool` argument for selecting a heap. 
```cpp
void *pvPortMalloc (size_t sz, const char *, unsigned, bool);
```

To avoid breaking the build, I added a new thin wrapper function `sdk3_pvPortMalloc` to `heap.cpp`. 
Edited new SDK LIBs to call `pvPortMalloc`'s replacement `sdk3_pvPortMalloc`.

They also added `pvPortZallocIram` and `pvPortCallocIram`, which are not a problem to support. Support added to `heap.cpp`.

Issues with WPA2 Enterprise in new SDKs:
* v3.0.0 and v3.0.1 - have the same memory leak and duplicate free bugs from before
* v3.0.2 through v3.0.5 - have the same memory leak; however, _no_ duplicate free crash.
* memory leak can be seen by cycling through setup, connect, disconnect, and clear setup - repeatedly.

Updated `wpa2_eap_patch.cpp` and binary patch scripts to handle v3.0.0 through v3.0.5.
Patched SDKs v3.0.0 through v3.0.5

## Duplicate Non-32-bit exception handler
Issue: At v3.0.0 and above `libmain.a` supplies a built-in exception handler (`load_non_32_wide_handler`) for non-32-bit access. Our non-32-bit access handler (`non32xfer_exception_handler`) overrides it. 

Solution: Add "weak" attribute to symbol `load_non_32_wide_handler`. Adjust the build to default to the SDK's built-in non-32-bit handler.  If there is a need to use our non-32-bit handler, make the selection from the Arduino IDE Tools menu `Non-32-Bit Access: "Byte/Word access to IRAM/PROGMEM (very slow)"`.

With SDKs v3.0.0 and above a "non-32-bit exception handler" is always present.
2022-12-16 11:11:19 +03:00
Amju
9cd560b451
Add httpupdate lib import in ota example (#8667)
Docs doesn't include any reference to include <ESP8266httpUpdate.h> library in Advanced OTA Updater section. It took me some time to find out while reading the docs
2022-12-14 12:07:41 +01:00
DarioGHub
a4a8782c56
Correct class name in readme.rst (#8751)
Text referred to an object name ESPHTTPUpdate, but context called for class name ESP8266HTTPUpdate
2022-12-11 09:10:56 -08:00
RobertGnz
3c6db4ed9b
WiFiClient::abort() (#8738)
Api for saving heap when Client class is used by a Server (WiFiServer class): Client = Server.available().

Suppose the local end is the server and the remote end is the client, we will deal with heap memory at the local end.

When the local application (server) decides to close an active connection with a remote end it issues an Client.stop.
The stop() function calls the close() function of ClientContext class which in turn calls tcp_close.
The connexion is closed by tcp_close and the protocol control block (pcb) can be put in the following states depending on the requests sent by the remote: CLOSING, FIN_WAIT_1 and FIN_WAIT_2. In theses states pcbs are not freed, then consume some memory heap.
If an acknowledgment from the remote end is received, the pcb enter in TIME_WAIT state for some minutes but pcbs in TIME_WAIT state are not freed. Then consume some heap memory.
TIME_WAIT pcbs are automatically freed after some minutes or can be freed for instance issuing an tcp_kill_timewait()
in the local application which will free the oldest pcb in TIME_WAIT state.

If the connection is first closed from the remote end (the client), the local end (server) receive a connection termination request. It then acknowledge it and enter in CLOSE_WAIT state waiting for a connection termination request from the local application.
It then send a termination request and enter in LAST_ACK state until it receive an acknowledgment from the remote end.
After receiving the acknowledgment it enter in ClOSED state and the local pcb is freed leaving some room in the heap memory.

To summarize, when a connexion termination request is send by one end (remote or local), the local pcb is not freed immediatly.
This pcb can be in the following states: FIN_WAIT_1, FIN_WAIT_2, CLOSING, TIME_WAIT, CLOSE_WAIT, LAST_ACK.
As a consequence, some old pcbs from old closed connections are still consuming heap memory.

The local application can call tcp_kill_timewait hoping it will free some TIME_WAIT state pcbs. But if the server receive frequent connections requests and close them after sending whatever it has to send, there may be zero pcbs in TIME_WAIT state among all previously closed connections.

In case of insufficient memory to accept a new connection, lwip has developped a strategy: it successively tries to kill the oldest pcb in TIME_WAIT state, or in LAST_ACK state or in CLOSING state or the oldest active connection with lower priority than the new one.

As a matter of fact this "urgent" strategy is deployed only when very few heap memory remain available (less than some kb). In case of success, Client.available returns a valid Client but the local application will crash when sending or receiving data from the client (Client.read ou readuntil or available) because this need more heap memory and just some kb were freed in lwip to allocate the new pcb structure ans start the new connection.

The propose API is intended to avoid this drawback by calling the abort function of ClientContext which in turn calls tcp_abort which calls tcp_abandon. The connection is aborted and notified to the client with a RESET and the pcb and ressources associated are immediately released increasing the available heap memory.
2022-12-06 12:40:48 +03:00
M Hightower
3a2fe9ff0f
Correction on Heap API available from ISR (#8708)
* Correction on Heap API available from ISR

* Expand reason for avoid realloc/free
2022-11-04 16:07:31 +03:00
Max Prokhorov
fff12e3068
Updater lifetime callbacks (#8653)
follow-up of #8598 
similar to ArduinoOTA API, execute certain callback in the Updater context.
2022-11-03 08:58:53 +03:00
rotulet
78444a5037
Add Wemos ESP-WROOM-02 board (#8664)
* add fixes from https://github.com/esp8266/Arduino/issues/6551#issuecomment-534737671
* add flashfreq_26 to the macro list
2022-11-01 01:38:35 +03:00
Max Prokhorov
7b2c627ed4
Update WiFi scan docs (#8685) 2022-10-10 18:08:06 +03:00
Max Prokhorov
5c22dbc163
Fix Sphinx build warnings (#8686)
* `doc/faq/a06-global-build-options.rst: WARNING: document isn't included in any toctree`
ref. https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#special-metadata-fields
same as other a#-... .rst pages
* `doc/faq/readme.rst:190: WARNING: Inline literal start-string without end-string.`
 just a typo
2022-10-10 17:36:47 +03:00
M Hightower
313b3c07ec
Add debug support for build.opt (#8637)
Add support to have different build option comment blocks
for debug and production builds.

Updated example esp8266/HwdtStackDump to use build.opt
2022-08-04 21:33:24 +03:00
BlazerYoo
9668f77070
Update documentation (#8619) 2022-06-27 16:02:28 +03:00
david gauchard
5656035bed
document side-effects for wifi-off-at-boot (#8614)
* adding wifi-off-at-boot side-effects mention in documentation
2022-06-25 23:18:54 +02:00
M Hightower
d5d6a3b023
Correct "list" formatting (#8610)
Correct "list" formating in a06-global-build-options.rst.
A formatting error was introduced in .md to .rst conversion.
2022-06-23 14:14:13 +02:00
Chris Kitras
2de142b8db
Update RFC 5246 URL (#8564)
The old link to RFC 5246 has been moved to https://tools.ietf.org/search/rfc5246
2022-05-12 23:03:32 +02:00
M Hightower
d1d4212e8b
Add support for global build defines and options (#8504)
* Add support to specify global build defines and options

A script manages the use of a file with a unique name, like
`SketchName.ino.globals.h`, in the Sketch source directory to provide compiler
command-line options (build options) and sketch global defines. The build
option data is encapsulated in a unique "C" comment block and extracted into
the build tree during prebuild.

* Applied os.path.normpath() liberally to input arguments. Fixes windows file path issue.
Improved helpful message for adding embedded build options.

* doubleup '\'

* Added context help for build option support

* expunged sketchbook global
added workaround for aggressive caching

* inital pass at searching for and reading preferences.txt

* Correct Windows path for preferences.txt
Added portable path for preferences.txt
Expanded file timestamp granularity
Improved error message printing for Arduino IDE 2.0 RC4

* Improved portable path and various Windows paths to preferences.txt

* Add cleanup logic and identify 1st run after IDE restart

* text corrections

* Create mkbuildoptglobals.py

When global header file does not exist, this print makes it easier for user to create the header file by providing its name and documentation pointer.

* build.opt heads up to user

Compiler command line changes from build.opt are shown to user

* Updated text

* oops

* Expanded comment and made print help consistent

* Improve handling stderr/stdout with "no verbose output"
Grouped helpful info to print at the end.
Added missing return value.

* Correct timestamp on CommonHFile.h
More improvements to printing
Updated docs.

* Added command-line parser

Support hints for compiler.cache_core. For use when Arduino IDE uses
command-line options that override compiler.cache_core.

Removed overuse of ()

Improve FAQ entry

* Fix script failure under windows

Rely on argpaser for checking that all arguments are present.
Removed redundant argument check in main().

Added '--debug' option and print_dbg method.

Rethink failures on overrides. Remove well know path fallbacks,
error exit when override file is missing.

In well-known path search for preferences.txt, do not assume true.
Make failure to find an error exit event.

When Windows has two preferences.txt files and they have different
values for caching and globals.h is used, error exit. It is not
possible to know from the script which is being used.

* Use quotes on build.opt

Update comment
Include the @ within the expantion string use quotes around file name.
Update doc example to remind and use quotes.

* Update CI for build option and global support

Added "mkbuildoptglobals.extra_flags=--cache_core" to platform.loca.txt
Update "-ide-version=10802" this version number indicates aggressive caching support
Added example to test global .h support

* Add debug prints
Added --debug to CI - this needs to be removed later
Tweaks to touch...

* Give each build VM a unique build.tmp space

* Corrected style on example
temp CI changes
debug crud
Added --ci switch

* Removed CI debug crud

run_CI_locall.sh works fine locally. Hosted Multi-VM CI fails
to work with 'aggressive caching' workaround method.

Add #if defined(CORE_MOCK) to failing example.

* Try HOST_MOCK

* CI adjustments

mkbuildoptglobals.py is optimized around the Arduino IDE 1.x
behaviour. One way the CI differs from the Arduino IDE is in the
handling of core and caching core. With the Arduino IDE, each sketch
has a private copy of core and contributes to a core cache. With the
CI, there is one shared copy of core for all sketches. When global
options are used, the shared copy of core and cache are removed before
and after the build.

* Doc update
2022-05-12 17:14:17 +02:00
Max Prokhorov
fd53a080ee
Add documentation entry about compiler warnings (#8492)
per #8421 and #8475
after checking HW, suggest to check SW as well by at least by enabling some or all compiler warnings
(and also note of the IDE weirdest defaults causing issues we expected to stay solved)
2022-02-22 13:42:26 +03:00
NaincyKumariKnoldus
d7c3d7b797
Minor git install documentation fix (#8488) 2022-02-15 12:06:25 -08:00
david gauchard
f60defc3d3
flash-size agnostic builds (#6690)
* flash: mapping definition by sketch at runtime depending on flash chip size and user configuration
2022-02-10 18:25:18 +01:00
Juraj Andrássy
f401f08aba
WiFiServer - 'rename' available() to accept() (#8419)
* WiFiServer - 'rename' available() to accept()
* use server.accept() instead of available()
* WiFiServer.accept() and ArduinoWiFiServer class doc update
2022-01-03 14:32:02 +01:00
Earle F. Philhower, III
b5f3d1d6d5
Remove Python installation from OTA doc (#8417)
Fixes #8416

We install now a private Python and use it for OTA calls, so users do not need to manually install anything.
2021-12-20 14:49:45 +01:00
aWZHY0yQH81uOYvH
f8de3fb464
ESP8266WebServer - Drop inactive connection when another is waiting to improve page load time (#8216)
* ESP8266WebServer - drop current HC_WAIT_READ connection sooner when another has data

Safari sometimes opens two connections when loading a page and only
sends a request over the second one, resulting in a 5 second wait
(HTTP_MAX_DATA_WAIT) before the request is processed. This commit
drops the current connection after 30ms (HTTP_MAX_DATA_AVAILABLE_WAIT)
when there is a new connection with data available or the buffer of
pending TCP clients is full (currently 5).
2021-10-27 22:28:47 +02:00
gneiss15
7ba596a5fe
Add wifi kit 8 to boards (#8190)
* Create pins_arduino.h

* Update boards.txt.py

* Update boards.txt

* done a "boards.txt.py --allgen"

* Removed the definition of LED_BUILTIN from variants/wifi_kit_8/pins_arduino.h, because this board has no build in lED
2021-07-03 23:33:20 +02:00
david gauchard
d2a3cbeb6f
Documentation: Note about options on PIO (#8174) 2021-06-25 15:44:02 -07:00
Matthew Smith
d99dd5d3f5
Update debug level list link (#8172) 2021-06-25 11:29:40 +02:00
david gauchard
d3136738ad
fix readthedoc python dependencies (#8166) 2021-06-23 21:08:26 +02:00
david gauchard
32fad07a70
ESP266httpUpdate: remove dead API and fix doc (#8063) 2021-06-22 18:22:42 -07:00
david gauchard
d283541380
documentation: Arduino IDE options: fix hyperlinks and format (#8158)
(this time, sphinx was used locally)
2021-06-22 03:39:53 +02:00
david gauchard
e55dfc3a0e
Documentation: Arduino IDE specific options for esp82xx (#8154) 2021-06-21 17:03:14 -07: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
Max Prokhorov
4436e32a50
WiFi: clean up AP SSID setter & getter, support 32 chars (#7941) 2021-05-15 12:28:22 -07:00
david gauchard
bdd341c9ea
boards: wemos d1 clones: new entry with menus for flash mode and flash freq (#7989) 2021-05-15 11:04:09 -07:00