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

4431 Commits

Author SHA1 Message Date
Vic-Y
338b62577e
Fix spelling errors in WebServer source (#9146) 2024-06-15 21:55:27 +03:00
Max Prokhorov
7e3d1bd0d8
Broken EspSoftwareSerial example (#9153) 2024-06-15 21:40:36 +03:00
Matthias Hertel
754324e56e
Example WebServer WebServer.ino does not redirect when index.htm does not exist (#9142) 2024-06-15 21:32:27 +03:00
Ayush Sharma
9afeaf5694
Implemented support for filters and removable routes in ESP8266WebServer (#9152)
* feat: added filters and removeable routes

* Update Filters.ino

* fix: clang-format

* chore: updated docs

* chore: updated doc

* fix: use new implementation

* fix: filters.ino example

* fix: filters.ino

* fix: formatting

* fix: formatting (2)
2024-06-15 21:20:13 +03:00
david gauchard
685f2c97ff
decoder.py: allowing to use it live (#9108)
- avoid ctx repetition and hide some useless fw debug lines
- hide "DECODE IT"
- immediately print stack at closing marker
- check for tool executable at startup

live command line example
>  pyserial-miniterm /dev/ttyUSB0 115200 | \
        path/to/esp8266/Arduino/tools/decoder.py \
            --tool addr2line \
            --toolchain-path path/to/esp8266/Arduino/tools/xtensa-lx106-elf/bin \
            path/to/build.elf
2024-03-31 19:24:25 +03:00
David Refoua
75cd58f647
fix minor typo (#9111) 2024-03-27 22:58:51 +01:00
David Baka
d7c50f76aa
Updater - fixed signature verification for compressed binaries (#9109)
Previously, Arduino Core attempted to read from flash memory without proper consideration for the 4-byte alignment requirement when calculating the hash for the signature verification. This did not present an issue when uncompressed binaries are checked as all compiled binaries are 4-aligned (unconfirmed, just an educated guess), and signature verification appears to work well in these cases.

When uploading a compressed binary (based on this) the gzip algorithm makes no attempt to produce a 4-aligned file. The rest of the signing results in a valid signed binary regardless, however when calculating the hash for the verification process there is a ~75% chance that the hash will include some bytes from the signature, thus compromising the whole signature verification process.

editorial note: ESP.flashRead for u8 arrays (aka byte arrays) was already updated to properly handle both aligned and unaligned target buffer and / or length, while u32 expects that its arguments are already aligned. Since array pointer in Updater is already aligned, this properly handles unaligned size case.
2024-03-27 16:07:29 +03:00
Max Prokhorov
eda4e0855f
CONT stack overflow postmortem (#9083)
- check in cont_run() and cont_suspend() whether a1 is out of bounds
- in case a1 is broken, postmortem will still report proper context in
  proper stack boundaries

additionally
- as suggested in #9069, change stack smashing to a single line that
  does not mention any Exceptions
- reduce overall stack dump length when there are know garbage values i.e. cont stackguard
- decoder.py addr search regexp would no longer skip stack lines with '<'
- fix decoder.py parsing so it notices both stack smashing and alloc errors
2024-03-26 10:58:20 +03:00
david gauchard
41ecd65c6a
Stream: +helpers to stream regular String (#9043)
This allows to use a String as a destination Stream by using a temporary with streaming helpers.
2024-03-25 00:35:19 +01:00
David Refoua
8731f63594
minor typo fixes (#9106) 2024-03-25 00:15:29 +01:00
Holger Müller
877d44059e
Add url redirect (#8970)
* added getAvailableVersion(), moved _httpClientTimeout and _followRedirects to protected, added enum HTTPUpdateError

* auto numbering of HTTPUpdateError enum

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

* 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.

* add redirect function

* enhanced redirect() by cache control and client stop

* updated redirect() comment

* replaced redirect() API calls in examples

* server.client().stop() not needed, redirect() does this
2024-03-24 23:52:28 +01:00
Clemens Kirchgatterer
2bb1b5a4d5
Fix semantic typo in generic-examples.rst (#9107)
exists -> exits
2024-03-19 18:01:59 +03:00
Holger Lembke
dc9abed8b9
ESP8266WiFiMulti - get number of APs in the list (#9082)
When having some more complex setups it might be helpful to know the number of APs already added to the list.
2024-03-18 00:04:44 +03:00
David Refoua
1248d3874e
Updater - missing error codes (#9104)
Adds the two missing error states when beginning an Update. There were debugging logs for this but the error state was not set which would lead to confusion
2024-03-17 23:55:29 +03:00
david gauchard
760dbeeda9
emulation-on-host: +memcmp_P (#9093) 2024-03-17 21:52:26 +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 Refoua
b0d9e75d50
LwipIntf - typo (#9103) 2024-03-17 20:58:39 +03:00
Max Prokhorov
c96dc26792
Generate TZ.h from zoneinfo (#9084)
* Generate TZ.h from zoneinfo

Using tzdata pypi package that ships zoneinfo blobs
Can't use raw data package from IANA, need it built first
Minor tweaks to Espurna script that generated .md

More data than the original, not limited to ZONE/...
Zoneinfo source can be overwritten using path args, if needed
(but, probably not needed, since it would always be preferable to pull the latest version)

Also, allow to override certain names and tz strings independent
of tzdata values (resolves #9007)
2024-02-11 18:51:35 +01:00
Clemens Kirchgatterer
9217458353
Free memory for _currentArgs after request has been handled in WebServer. (#9077)
This can reduce permanent RAM consumption significantly, if the last request had lots of arguments, but it assumes, that we do not need the arguments after we have handled a request.
2024-02-11 12:27:18 +01:00
Max Prokhorov
ed9e8ce9ba
Sync with esp82xx-nonos-linklayer (#9078)
* Update lwip2 builder
* Rebuild lwip2 libs
2024-02-11 12:15:26 +01:00
Max Prokhorov
d7d50ffc6f
Prefer Serial1 logging in examples (#9079) 2024-02-09 20:22:49 +03:00
Max Prokhorov
e6df345584
CI - clang-format-15 (#9085)
Stop CI from pulling LLVM repos and using GNUPG keyservers,
ubuntu-latest already has clang-format-{13,14,15}

Fixes long-standing issue with -style=file:...
2024-02-09 17:39:38 +03:00
Clemens Kirchgatterer
16e19181b9
ESP8266WebServer - fix possible memory leak in request argument handling (#9076)
* fix possible leak of _postArgs array in case of returning early from _parseForm().
* don't use _postArgs member, but instead use a new local variable postArgs instead.
* same for _postArgsLen member vs.local postArgsLen.
* remove useless NULL pointer check before delete().
* Remove _postArgs member from ESP8266WebServer.h
* Remove searching through always empty _postArgs array in ESP8266WebServer-impl.h
2024-02-09 17:28:14 +03:00
dependabot[bot]
de1029ffe0
Bump actions/cache from 3 to 4 (#9074)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 23:34:12 +03:00
dependabot[bot]
47327e8449
Bump actions/setup-python from 4 to 5 (#9052)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
2024-01-19 20:12:40 +03:00
Adriano Cunha
b3b9276bf9
Avoid NPE and "multi-deinitialization" of ArduinoOTA (#9058)
Avoid a null pointer exception when ArduinoOTA.end() is called more than once and thus the UDP socket is already freed.

Also avoid unnecessary teardown if the class is not initialized yet (for example, begin() wasn't called yet, or end() is called multiple times).
2024-01-18 23:26:18 +03:00
david gauchard
d5eb265f78
WiFi config(): warning for legacy idioms (#9050) 2023-12-12 00:57:57 +01:00
Juraj Andrássy
cb9734c97d
WiFi.h as alias to ESP8266WiFi.h (#9044) 2023-12-08 10:50:54 +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
David Buchmann
089fe8fca7
use uriglob to catch all android captive portal requests (#9041) 2023-12-04 16:01:57 +01:00
Juraj Andrássy
9e73cf0021
LwipIntfDev - config static IP auto gw,mask,dns as in Arduino libraries (#9040)
for 'modern' Ethernet libraries W5100lwIP, W5500lwIP and ENC28J60lwIP
used without EthernetCompat
2023-12-01 10:36:35 +01:00
Juraj Andrássy
1efe5ee3fc
LwipIntfDev - add parameter's missing default value for dnsIP(n) (#9039) 2023-12-01 09:44:55 +01:00
Juraj Andrássy
9a4e17876e
WiFi - static IP auto gw,mask,dns as in Arduino libraries (#9031) 2023-11-24 10:10:27 +01:00
david gauchard
32c858df6d
ask user not to post stack dumps, but to decode them (#9037)
* ask user not to post stack dumps, but to decode them
2023-11-24 09:32:29 +01:00
Julien Herr
0301465a3c
elf2bin.py - Fix syntax warning (#9034) 2023-11-17 23:15:34 +01:00
Juraj Andrássy
5e0ed3a38b
Revert "WiFiSTA - allow using DHCP again after disconnecting static IP (#9020)" (#9028)
This reverts commit 0c599ee0dcdd9b04f4f3082697992fe79b1e9ac6.
2023-11-13 00:26:16 +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
Juraj Andrássy
74c04c88c5
LwipIntfDev - method end() to enable repeated begin (#9023) 2023-11-12 23:41:08 +01:00
M Hightower
c84fda145c
Resolve HWDT Reset with core_esp8266_vm (#9025)
* Resolve HWDT Reset with core_esp8266_vm

With the newer GCC compiler (after tag 3.0.2), example virtualmem was crashing with a HWDT reset.
Reordered some SPI register set lines in spi_init().
New ordering was based on ::begin in SPI.cpp

This change may resolve issues describe in
https://github.com/esp8266/Arduino/discussions/9010

* Added memory barrier to changes
spi_ctrl appears to need setting before other SPI registers
2023-11-12 23:26:35 +01:00
Juraj Andrássy
7fc2caa72f
WiFiSTA - method setDNS as in WiFi libraries by Arduino (#9021)
https://www.arduino.cc/reference/en/libraries/wifi/wifi.setdns/
2023-11-10 15:30:31 +01:00
Juraj Andrássy
5bd52d4f86
EthernetCompat - static IP auto gw,mask,dns as in Arduino libraries (#9024) 2023-11-10 15:00:56 +01:00
Juraj Andrássy
0c599ee0dc
WiFiSTA - allow using DHCP again after disconnecting static IP (#9020) 2023-11-10 10:54:17 +01:00
Juraj Andrássy
097e59f2e1
LwipImtfDev - add DNS IP getters/setters and MAC getters (#9022)
Ethernet styles getters/setters and WiFi styles getters/setters
2023-11-10 10:27:38 +01:00
AriaN
31c1592ad6
add Stream::readStringUntil function that uses string terminator (#9011)
* add readStringUntil function with string terminator
* rename count parameter to untilTotalNumberOfOccurrences
2023-11-07 14:19:31 +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
Juraj Andrássy
30c6df4639
WiFiServer - operator bool() and method end() (#8995) 2023-11-04 23:39:46 +01:00
Juraj Andrássy
497dacc78f
WiFi.BSSID and scan result BSSID with parameter as other WiFi libraries (#9008) 2023-11-04 23:29:06 +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