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

4265 Commits

Author SHA1 Message Date
Max Prokhorov
06f34ed566
Board ID as build flag (#8634)
* Board ID as build flag

When using IDE or `arduino-cli board list`, show full board name and FQBN
```
$ arduino-cli.exe board list
Port          Protocol Type              Board Name                FQBN                       Core
xxx.xxx.x.xxx network  Network Port      LOLIN(WEMOS) D1 R2 & mini esp8266com:esp8266:d1_mini esp8266com:esp8266
```
Also add `description` field to the mDNS response containing the
original `{build.board}` string value.

resolve #7759

* does not work with recent ide (?)

* fixup! does not work with recent ide (?)
2022-07-27 22:52:20 +02:00
david gauchard
e149829802
update example certs (#8642)
* update certs
2022-07-19 12:21:35 +02:00
david gauchard
a2982f96a4
Add missing license headers (#8630) 2022-07-09 10:02:58 -07:00
david gauchard
00f5f2acc4
emulation on host: fix incorrect lwIP DNS implementation (#8627)
* emulation on host: fix incorrect lwIP DNS implementation
+initialize netif0, make ipv6 example unfail
2022-07-09 12:36:35 +02:00
david gauchard
a8e3786d38
Fix hostname management (#8626)
* manage hostname with sdk string
2022-07-06 22:57:58 +02:00
Max Prokhorov
65d30437f0
Correctly handle unaligned address in EspClass::flashWrite u8 overload (#8605)
Separate page handling logic and the actual writing. Make sure we place both unaligned src and dest into a buffer.
Fixes edge-case introduced for SPIFFS that exclusively works through unaligned flash write function.

This copies the behaviour of official RTOS port, but does not change the original spi_flash_write.
2022-07-03 22:47:16 +03:00
Max Prokhorov
c12a6b48a2
Github Actions updates and setup dependabot (#8624)
* github: actions/checkout v2 -> v3

* github: actions/cache v2 -> v3

* github: actions/setup-python v2 -> v4

* github: dependabot for actions

* github: 'restricted' mode for token permissions

noticed at https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

whenever external action uses our token, overall workflow 'permissions:' apply
https://docs.github.com/en/actions/security-guides/automatic-token-authentication
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

ref. apps documentation to understand which permissions API endpoints need
https://docs.github.com/en/rest/overview/permissions-required-for-github-apps

* missed tag-to-draft action
2022-07-01 22:24:13 +03:00
Max Prokhorov
601da8e933
Fix python warnings and update device tests runner (#8623)
Update soon-to-be deprecated code in the runner.py
https://docs.python.org/3/library/imp.html is deprecated since 3.4, will be removed in 3.12
https://docs.python.org/3/library/configparser.html readfp() is replaced with read_file() since 3.2, will be removed in 3.12

Use venv instead of virtualenv. We don't really use any of the extended features, and might as well simplify installation requirements.
virtualenv/bin/python can execute runner.py inside of venv, no need to activate beforehand.
2022-06-29 14:27:42 +03:00
Max Prokhorov
a2c8a63360
Use current netif address in NetBIOS response (#8622)
* fix 8139 netbios in AP mode

* take the current if addr

* handle enabled ipv6

Co-authored-by: pablo <pablomartikian@hotmail.com>
2022-06-29 14:05:19 +03:00
Joseph Francis
678a477559
HTTPUpdateServer Allow external POSTS (CORS) (#6824)
* HTTPUpdateServer Allow external POSTS (CORS)

* Format Updates - POST HTTPUpdateServer

Co-authored-by: Joseph Francis <joefran@us.ibm.com>
2022-06-27 23:06:10 +02:00
BlazerYoo
9668f77070
Update documentation (#8619) 2022-06-27 16:02:28 +03:00
Max Prokhorov
7e5520c23e
Fix DHCP server pbuf handling and allow to change netif address (#8602)
* Fix sending NACK, use helper function to fill pbuf

As noticed in https://github.com/esp8266/Arduino/pull/8582#issuecomment-1153331408
Plus, handle the case when `pbuf->len` is less than struct size

* Make sure to call SDK functions to start and stop DHCP server

As noticed in https://github.com/esp8266/Arduino/pull/8582#issuecomment-1153331408
Can't really use `server.begin()` and `server.end()` directly, only
default static IP is applied to the interface since DHCP server is
deemed 'running' (see `wifi_softap_dhcps_status()` return value)

* s

Co-authored-by: david gauchard <gauchard@laas.fr>
2022-06-27 03:26:05 +03:00
Max Prokhorov
0bff52fe55
Without autoreconnect, forcibly stop station connection manager (#8607) 2022-06-27 02:21:40 +03:00
sticilface
f0d8f33d83
Add FSTools with examples of how to convert between SPIFFS and LITTLEFS. (#7696)
* Add FSTools with examples of how to convert between SPIFFS and LITTLEFS.

* Oops.  Need to pass layout by reference in order to capture the correct address.  Took a while to find that.  There maybe a better way to store all these configs

* Update FSTools.cpp

fix ESP.h to Esp.h

* Fix unused variable i

* Parsed with restyle.sh.  Compile with all errors.

* remove unused variable

* fix different sign complication error

* Fix indentation to spaces
Run test/restyle.sh
Remove commented code
Use #ifdef blocks for debugging.  `DEBUG_ESP_CORE` and `DEBUG_ESP_PORT`
use `static constexpr  layout` which saves ROM ~500B for unused vars

* Update FSTools.cpp

Add yield in between file copy
2022-06-26 20:22:31 +02: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
Max Prokhorov
5d4ae86565
Check ESP8285 at runtime (#8604)
* esp_is_8285() at runtime
* less code with less statics, just read again
2022-06-25 22:23:45 +02:00
Max Prokhorov
8decdc380a
Allow to use temporary strings in configTime (#8606) 2022-06-24 23:46:03 +02:00
Max Prokhorov
7935bed18f
Provide wl_tcp_state as tcp_state alias (#8609) 2022-06-24 15:41:51 +02:00
Earle F. Philhower, III
8048ea52ca
Rebuilt HAL w/latest toolchain and fixed configure (#8615)
Returns the library contents to the expected functions.
2022-06-24 15:24:56 +02:00
david gauchard
7d9abbb605
do not call tcp/udp ::stopAll() when it is not required to do so (#8598)
* do not call tcp/udp ::stopAll() when it is not required to to so
* remove stopAll also from ArduinoOTA
2022-06-23 22:14:19 +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
Earle F. Philhower, III
dc6b15e38a
Update to toolchain 3.1.0-gcc10.3 (#8613)
* Update to toolchain 3.1.0-gcc10.3

* Update BearSSL with L32R minimized

See https://github.com/earlephilhower/esp-quick-toolchain/issues/36#issuecomment-1162363757
2022-06-22 07:52:15 +02:00
Max Prokhorov
047f14b9db
upload.py should not always fail (#8608)
07789808b9 (r76344981)
thx @jjsuwa-sys3175
2022-06-19 01:22:33 +03:00
Max Prokhorov
07789808b9
Do not show python traceback when esptool fails (#8603)
Path separator already handled by python
Empty strings are false, implicitly checking for length
2022-06-15 02:39:16 +03:00
david gauchard
8bfc2e9eab
Fix lwip2 ping (#8596)
fixes https://github.com/esp8266/Arduino/issues/8555
related to https://github.com/dancol90/ESP8266Ping/pull/42
2022-06-14 20:24:04 +03:00
Earle F. Philhower, III
760a6bc6c7
Update to latest BearSSL (#8600)
Minor SSL bug fix included.
2022-06-14 09:49:22 -07:00
Paul Wieland
0e0ad1f645
Allow UART1 to be inverted (#8601) 2022-06-14 18:33:09 +03:00
Paulo Cabral Sanz
bdc71e5801
Avoid reading past end of non-zero terminated char arrays (#8597) 2022-06-12 23:22:15 +02:00
david gauchard
9ace4ed849
stop incorrectingly increase number of arguments when setting up arg("plain") (#8599) 2022-06-12 22:47:36 +02:00
Max Prokhorov
b7c1cfbc45
DHCP custom option (#8582)
* works

* fixup! works

* back to callbacks

* names

* daisy chain

* seconds

* less inline

* fix dns setter

* might as well keep using initlist

/to d-a-v it has automatic storage, here it's the same stack based one
(just one less line for us)

* shift blame

* naming

* fix impl

* revert to ip4 dns

* merge fix

* restyle

* masking done wrong
2022-06-08 23:19:59 +02:00
M Hightower
9e2103f27e
Patch eap.o memory leak (#8566)
* Patch eap.o memory leak

WiFi Enterprise option can leak up to 3 allocations per connect/disconnect
cycle: anonymous Identity, password, and some unidentified allocation.

This solution patches eap.o from libwpa2 to call a special 2 part
wrapper instead of vPortFree for cleanup.

Corrected typos and adjusted tabs in script.

Added script eval_fix_sdks.sh to aid in evaluating similarity between
patch sections of .o files being patched across different SDKs.

* Add some dev debug code and improve comments

* Patch eap.o memory leak

WiFi Enterprise option can leak up to 3 allocations per connect/disconnect
cycle: anonymous Identity, password, and some unidentified allocation.

This solution patches eap.o from libwpa2 to call a special 2 part
wrapper instead of vPortFree for cleanup.

Corrected typos and adjusted tabs in script.

Added script eval_fix_sdks.sh to aid in evaluating similarity between
patch sections of .o files being patched across different SDKs.

* Add some dev debug code and improve comments
2022-06-02 23:48:28 +02:00
david gauchard
5f2af1945b
lwIP on ethernet: examples (#8395)
* ethernet: examples

* remove duplicate

* styling

* fix comment restyle + comment eth.setdefault()

* comment and add comments about eth.setDefault()

* update comments when using interface::setDefault()

* repair bad merge

* fix default interface case

* factorize

* change comment
2022-06-02 14:03:38 +02:00
Flole998
f5ef02d643
Fix double-free when connecting to WPA2-Enterprise networks (#8529)
* Fix double-free when connecting to WPA2-Enterprise networks

Fixes: #8082

This patches the callx0 instruction to a nop in eap.o which is part of libwpa2.a.
It looks like espressif fixed the Bug in newer SDK versions, so if we update to the latest NONOS-SDK it is most likely not necessary to add/adapt this patch.
Also modifies the fix_sdk_libs.sh script as it even changed files if no changes were necessary, for example adding multiple system_func1 exports.

* Apply suggestions from code review
2022-06-02 11:38:28 +02:00
Max Prokhorov
502d9469fa
Initialize SoftAP DhcpServer object on demand (#8546)
* Initialize SoftAP DhcpServer object on demand

Remove dependency on global ctor, and just construct the object when
someone asks us to do it. Only dependency right now is netif_git, which
is expected to be initialized by the lwip code some time before
dhcps_start happens.

Removing ip_info from begin(), since we never reference later on.
Also removing the specific check for netif id and simplify the ctors.

Update tests and recover old nonos-sdk dhcps functions that were not implemented.

* nonos helpers have a separate header

* wifi ap needs this anyway, simplify sketch includes

* missing example

* existing name :/

* trying to fix header dependency

* restyle

* not a c header

* no need to init

* move dhcp server getter to WiFi

more... arduino'ish? we ahve object as namespace, plus everything else
related to softAP is there
redundant includes, redundant mock impl (out-of-scope here to fix)

* ...move things back, still expose as WiFi method

* review fix

* include -nonos header in wifi lib though

* no more lwip include

* style

* need mock dhcpserver instance
2022-06-01 22:46:04 +02:00
Ryan Gates
61e7605549
Update broken links (#8589)
https://www.arduino.cc/en/main/software - broken
https://www.arduino.cc/en/software - working
2022-06-01 22:30:52 +02:00
DarioGHub
8dee8000ee
Fix DTR offset value (#8586)
Correct value from uart_registers.h mask
> #define UART_DTRN (BIT(29))
2022-05-29 08:20:13 +03:00
Maximilian Gerhardt
c1144c5740
Move _GNU_SOURCE from CCFLAGS to CPPDEFINES (#8579)
Makes _GNU_SOURCE visible in VSCode Intellisense and other IDEs.

Co-authored-by: Ivan Kravets <me@ikravets.com>
2022-05-28 21:17:33 +03:00
Ivan Kravets
35c2ae1cbb
Improve support for hand-written asm source files (#8583) 2022-05-28 20:56:13 +03:00
david gauchard
b080c50713
emulation on host: avoid closing STDIN (#8577)
- avoid closing STDIN
- less verbose during compilation
- better handling user directories
- missing str{,n}case_P declarations
2022-05-20 16:54:27 +02:00
david gauchard
8f71d2c042
emulation on host: allow parallel compilation units (#8574)
-j option wasn't passed to recursive 'make' calls
2022-05-17 17:35:41 +02:00
Takayuki 'January June' Suwa
48b60f4651
tools/sizes.py: Restore to the prior behavior regarding output destination (#8572)
once `tools/sizes.py` outputted to `stderr` rather `stdout` before da4a19fdacd7a859da395e014c9e0fded99aa985

(Arduino IDE 1.8.19 for Windows doesn't capture `stdout`, 2.0.0-rc6 does)
2022-05-17 17:24:36 +03:00
Takayuki 'January June' Suwa
fd9af97e00
tools/sizes.py: Change Unicode box-drawing chars to that of double version (#8573)
Due to historical circumstances, some of light/heavy version of Unicode
box-drawing chars may have twice width of others (aka. "Zen-Kaku" in Japanese,
means full-square), eg. All of '─'(U+2500), '│'(U+2502), '└'(U+2514) and
'├'(U+251C) correspond to that in Windows Japanese fonts and locale.

Double versions, '═'(U+2550), '║'(U+2551), '╚'(U+255A) and '╠'(U+2560) are
not like that.

(See [Box Drawing, The Unicode Standard](https://www.unicode.org/charts/PDF/U2500.pdf))
2022-05-17 16:48:30 +03:00
david gauchard
fbba25cf65
WString: remove operator==(const __FlashStringHelper*) (#8569) 2022-05-17 14:58:53 +02:00
Takayuki 'January June' Suwa
1bb041bb6c
platform.txt: Override python3 anon pipe encoding to utf-8 for 'tools/sizes.py' (#8570) 2022-05-17 01:45:01 +03:00
M Hightower
5311c0d20a
Fix utf-8 encoding (#8565)
* Fix utf-8 encoding

Issue posted to commit
d1d4212e8b (r73517358)

* Added python source code encoding

* for touch operations open/create file in binary mode
2022-05-15 22:19:39 +02:00
david gauchard
33afdc2723
emulation on host: fix internal udp management (#8561)
* emulation on host: fix internal udp management
help dtors: clear map before exit, check with valgrind

* fix style
2022-05-15 22:06:20 +02:00
david gauchard
80c0570620
Define lwIP's s32/u32 to int (#8560)
* Define lwIP's s32/u32 to int

s32/u32 were previously defined as long,
but long can be 64 bits in host mode,
so this commit reduces valgrind complaints and increase coherency.

* some lads like to use `unsigned long` for 32 bits IPv4 addresses

* fix lwIP's `sys_now()` return type

* fix C declarations

* merge upstream (lwip2) update on sys_now() definition

* matching lwIP api (2/2)

Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
2022-05-15 21:55:56 +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
david gauchard
2904021cb9
CI: update arduino IDE url (#8563) 2022-05-12 12:55:03 +02:00