Commit Graph

675 Commits

Author SHA1 Message Date
Shawn A
41d972564c
Proposed fix for #2501 (#6113)
Reliability fix for autoReconnect when assoc_fail, autoReconnect did not work before for these failures.

Changes behavior of WIFI_REASON_ASSOC_FAIL event when autoReconnect is set, removes WIFI_REASON_ASSOC_FAIL/WL_CONNECT_FAILED so retry waitforconnectresult loop stays active for the retry, was not working before.
2022-01-17 16:39:16 +02:00
Eckhard Völlm
a0beb81a4c
Consistently change device index to singed integer in BluetoothSerial lib (#6109)
* change parameter to signed int

As of wrong paramater, the following problem existed, that will be fixed now with this change.

BTScanResultsSet.cpp:67:8: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (i < 0)

* Change parameter and variable to int

As of wrong paramater, the following problem existed, that will be fixed now with this change.

BTScanResultsSet.cpp:67:8: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (i < 0)
2022-01-17 16:31:58 +02:00
P-R-O-C-H-Y
702db50627
BUGFIX - Sd check status (#6103)
* Edit sd_diskio to check card status

* Bugfix of ff_sd_status
2022-01-17 16:15:16 +02:00
Darek7D
1ac3aefa61
Add KSZ8041 support (#6087) 2022-01-17 16:14:09 +02:00
vortigont
b3b3403296
NTP Examples: revert obsolete comment and updated Time example (#6073)
* Revert "Examples update, add a note for configTime() that only one ntp server is supported by lwip",
fixed in espressif/esp32-arduino-lib-builder#51

This reverts commit 6b1020967a.

* SimpleTime: add NTPoDHCP option and TimeZone env variable
2022-01-17 16:09:58 +02:00
P-R-O-C-H-Y
caef4006af
Implement SigmaDelta based on ESP-IDF API (#6053)
Summary

This PR is refactoring of SigmaDelta HAL in order to use IDF instead of current Register manipulation approach.

Impact

Change in API:

uint32_t sigmaDeltaSetup(uint8_t channel, uint32_t freq);
changed to -->
uint32_t sigmaDeltaSetup(uint8_t pin, uint8_t channel, uint32_t freq);

void sigmaDeltaAttachPin(uint8_t pin); removed, no longer needed. Pin is attached in sigmaDeltaSetup()
2021-12-22 16:41:52 +02:00
Rodrigo Garcia
7cf162346a
RMT refactoring based on IDF (#6024)
Summary

RMT HAL refactoring based on IDF.

Impact

Improves RMT by adding IDF v4.4 support.
Receiving RMT can handle any size of data.
rmtInit() has a new parameter - RxBufferSize - to hold any number of data when receiving RMT.
rmtWrite() has a new parameter - wait_tx_done - to block writing until sending all data.

Related links

fix #5905
2021-12-21 15:02:40 +02:00
Pedro Minatel
c66c7fe27e
[Examples] README revision to include missing and remove old entries (#6049) 2021-12-21 15:00:37 +02:00
discapacidad5
6b90627b21
HID_BRAILLE_DISPLAY (#6043)
23 Braille Display Page (0x41)
Braille display allow visually impaired computer users to read out text using raised pins. The pins are electro-mechanically
activated. These devices also have support for controls that help navigate the computer screen. Typically, braille displays
interface with software known as a screen reader in order to perform this navigation.
2021-12-20 13:22:58 +02:00
Rodrigo Garcia
82ec74a072
Adds support to change LoopTask Stack size (#6025)
## Summary
Arduino ```setup()``` and ```loop()``` run under a Task with a fixed Stack size of 8KB.
Users may want to change this size.

This PR adds this possibility by just adding a line of code, as for example:
``` dart
ESP_LOOP_TASK_STACK_SIZE(16384);

void setup() { 
}

void loop() { 
}
```
## Impact
None. It adds a new functionality to ESP32 Arduino.
If ```ESP_LOOP_TASK_STACK_SIZE(newSize);``` is not declared/used, it will compile the sketch with the default stack size of 8KB.

## Related links
fix #6010 

https://github.com/espressif/arduino-esp32/issues/6010#issuecomment-992701658
Thanks @igrr for the suggestion!
2021-12-20 13:10:36 +02:00
me-no-dev
5940d89e67 Fix wrongly applied patch to WiFi STA Init 2021-12-20 10:17:25 +02:00
Me No Dev
40a5c1e461
Change default WiFi encryption to WIFI_AUTH_WPA2_PSK (#6022)
Fixes: https://github.com/espressif/arduino-esp32/issues/6020
2021-12-14 20:07:08 +02:00
Alexandre-Jacques St-Jacques
7bb30b3cf8
Refactoring TwoWire::requestFrom() headers in Wire.cpp (#5935)
* Refactoring function headers

Changing the header so the main TwoWire::requestFrom() definition uses a `size_t` instead of a `uint8_t`, removing the 255 bytes limit on I2C requests.

Co-authored-by: Flaviu Tamas <me@flaviutamas.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2021-12-14 16:25:01 +02:00
Vítor Ângelo Russi
4b638de19d
using ksz8081 only from ESP-IDF 4.4 onwards (#5918)
* using ksz8081 only from ESP-IDF 4.4 onwards

The previous assertion only considerate the existance of ESP-IDF 4.3, but with the ESP-IDF 4.3.1 release this assertion would generate errors. Now only includes from ESP-IDF 4.4 onwards.

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2021-12-14 16:09:01 +02:00
Paolo Messina
f29f4485b5
Fix memory leaks when SSL/TLS connection fails (#5945) 2021-12-14 15:59:26 +02:00
Jakub Rybakowski
8a8f87d3a0
Fix for BluetoothSerial build when using nimBLE instead of Bluedroid (#5920) 2021-12-14 15:56:25 +02:00
Wojtek Kaniewski
cb25fe8c7e
Don't clear headers on redirect (#5973)
Current implementation clears _headers when request was sent. If the
user added custom request headers, they will be lost and the redirected
request will not contain them. This commit changes the scope of cleanup
so that the headers survive redirects but don't survive connection
reuse.
2021-12-14 15:37:31 +02:00
obaterspok
f5b04b9197
Use WIFI_FAST_SCAN if a specific channel was used (#5975)
1.0.6 changed scanning method to always scan all available channels during connect. This results in results in connect taking about ~3 seconds instead of ~1. This patch changes the behavior to use WIFI_FAST_SCAN if client used a specific channel.
2021-12-14 15:37:00 +02:00
Pedro Minatel
fa03966fcf
[Feature] Added Sonoff DUALR3 support with RainMaker example (#5980)
* [Feature] Added Sonoff DUALR3 support with RainMaker example

* [Feature] Added skip files for C3 and S2
2021-12-14 14:35:10 +02:00
P-R-O-C-H-Y
c90dffef44
Edit sd_diskio to check card status (#5988) 2021-12-14 14:22:30 +02:00
Rodrigo Garcia
da72bc90b7
eliminates error messages when using Ethernet Static IP (#5836)
Summary

Only affects ETH (not WiFi)

This PR solves #5733 by allowing the DHCP IDF server to complete its tasks and only then it sets a static IP.
This also solves another related failure reported in this issue (#5733 (comment)).

fix #5733

Impact

Adds a delay in order to wait for DHCP to actually terminate before setting the static IP configuration in ETH.
2021-11-09 10:23:29 +02:00
Anthony Elder
16a9cf781f
Add another Wire requestFrom function signature (#5768)
* Re-add with clean master

* Address @me-no-dev's comments

* static_cast<size_t> to static_cast<uint8_t>
2021-11-08 14:29:04 +02:00
Benjamin Staar
4b9dc61447
Solving *"wifi:channel=0 is invalid"* when using FTM example code (#5809)
When using the FTM examples I got an error in the FTM_Initiator.ino:

*"wifi:channel=0 is invalid"*

I solved it for myself by simply passing the channel argument to be 1 in *WiFi.initiateFTM*. However, a better fix would be to directly change the default channel here.
2021-11-04 16:08:50 +02:00
Pedro Minatel
a2d7c0dcf6
[Examples] WiFi and Ethernet examples organization (#5830)
* examples: WiFi and Ethernet examples organization

* examples: Change on CI scripts to include new folder

* Library name reverted to WiFi

* examples: WiFi and Ethernet examples organization in a new folder

* examples: Eth files moved from WiFi to Ethernet lib and CMakeLists updated
2021-11-04 16:08:08 +02:00
Scott Smith
4aff6dde39
Support additional authorization schemes (#5845)
The client always appends "Basic" to the authorization header, however there are other auth schemes that can be used: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
For example "Bearer" when using OAuth.
This PR adds a `setAuthorizationType` method to the HTTPClient which allows this scheme to be configured by the caller. Authorization type is set to "Basic" by default so this will have no impact on existing usecases.
2021-11-04 14:25:12 +02:00
Anthony Elder
15bbd0a187
Add ALPN support to WiFiClientSecure (#5633)
This adds a function to WiFiClientSecure to set the ALPN protocol.

This is required for an MQTT client to connect to AWS IoT when using an AWS Custom Authorizer, as described here.

Example code snippet:

...
WiFiClientSecure wiFiClient;

// ALPN protocol, needed with AWS custom authorizer
const char *aws_protos[] = {"mqtt", NULL};

void setup() {
  wiFiClient.setCACert(AWSCAPEM);
  wiFiClient.setAlpnProtocols(aws_protos);
}
...
2021-10-25 09:20:47 +03:00
Hideaki Tai
02c3ec01cc
remove _user_defined_size from EEPROM (#5775)
Summary

Related to the issue #5773 and #2280.

_user_defined_size is removed from EEPROMClass because it is redundant in the current code
EEPROMClass::length() returns _size that is the true available size of EEPROM
Impact

_user_defined_size is removed from EEPROMClass
EEPROMClass::length() returns _size that is the true available size of EEPROM
2021-10-25 09:15:47 +03:00
Rodrigo Garcia
a418058a66
log statement missing parameter #5778 (#5796) 2021-10-23 11:34:00 -03:00
Rodrigo Garcia
2673b88582 removes deprecated esp_eth_set_default_handlers() 2021-10-22 21:56:14 -03:00
Rodrigo Garcia
67c99142d2
Allows spiram malloc with wifi dynamic buffers - better free heap (#5791)
Summary

Modifies WiFi lib to allow dynamic buffer allocation along with SPIRAM MALLOC enabled
This gives more heap space to the users

Related PR in Arduino Lib Builder: espressif/esp32-arduino-lib-builder#47

Impact

WiFi will work the same as it was in version 1.0.6, restoring free heap.

close #5630
close #5474
close #5699
close #5697
2021-10-22 02:22:20 +03:00
michlv
951c8bece5
libraries/SPI/src/SPI.h: SPIClass: add method to get SS pin number (#5788)
* SPI.h add new call to return a SS pin number used.

As code example states, the SS pin needs to be explicitly set for output for SPI to work, but the pin number have to be coded in addition to the SPI logic in the library, which means this duplicates code. It is much better to just be able to get the pin number from library itself.

* Update SPI_Multiple_Buses.ino to use new pinSS method

Simplify the example case, to show usage of pinSS method. This also simplifies the example, removing duplicated code.
2021-10-21 16:48:55 +03:00
me-no-dev
b145e65975 API Optimizations
- Support Wire::end() for Slave
- Prevent Master operations when in Slave mode
2021-10-11 14:46:31 +03:00
Me No Dev
951c32056a
Merge branch 'master' into i2c-slave 2021-10-11 13:13:13 +03:00
Me No Dev
7a7bd37e51
feat: Add the ability to get the peer certificate of an SSL connection
Summary

New feature: Add the ability to get the peer certificate of an SSL connectio. This is useful for IoT when the root/cert trust chain has a shorter lifecylce than the device itself. Includes example code.

It adds two methods to the WiFiClientSecure client:

bool getFingerprintSHA256( uint8_t fingerprint_remote_sha256[32]) -- return true and the fingerprint (i.e. the SHA256 of the raw x509 as a DER - identical to what you see in for example your webbrowser). Or false on error.
const mbedtls_x509_crt* getPeerCertificate(); -- return the actual X509 struct or NULL on error.
Impact

No impact; backwards compatible (only adds to the API)
2021-10-11 13:04:13 +03:00
otakuto
a75602dc68
Add support M5Stack Unit CAM (#5748)
In this PR, we add support for M5Stack Unit CAM to CameraWebServer.
https://docs.m5stack.com/en/unit/unit_cam
2021-10-11 13:01:10 +03:00
Uri Shaked
88789cd817
Fix build error when compiling with verbose logging (#5747)
When compiling with verbose logging, the build would error with a message saying `len` is not defined in `tud_vendor_rx_cb()`. This change fixes the error.
2021-10-11 13:00:25 +03:00
me-no-dev
f9f70d2f73 I2C Slave Implementation 2021-10-09 14:30:20 +03:00
P-R-O-C-H-Y
5b207104aa
Fix: SD_MMC deinit (#5732)
* SD.open() new feature for creating all folders in path

This PR adds to the SD.open() function option to create all folders to the file.

SD.open(const char* path, const char* mode, const bool create)

Default value of create is false.
When true folders are created.

From issue #5019

* Update vfs_api.cpp

memccpy -> memcpy

* SD_MMC deinit fix

Wrong deinit function was called.
2021-10-09 14:12:25 +03:00
Dirk-Willem van Gulik
1706af4656
Add the ability to get the peer certificate of an SSL connection; useful for IoT when the root/cert trust chain has a shorter lifecylce than the device itself. Includes example 2021-10-08 14:20:43 +02:00
Me No Dev
00214d5c2a
IDF master 3e370c4296
* Fix build compilation due to changes in the HW_TIMER's structs

* Fix compilation warnings and errors with USB

* Update USBCDC.cpp

* Update CMakeLists.txt

* Update HWCDC.cpp
2021-10-01 17:52:29 +03:00
Me No Dev
f87107dedb
Implement Thread-Safe I2C based on ESP-IDF API (#5683)
* Implement Thread-Safe I2C based on ESP-IDF API

* Update esp32-hal.h

* use proper types for size and timeout

* Allow disabling of the HAL locks

* Limit frequency settings to prevent Interrupt WDT
2021-10-01 17:34:20 +03:00
Akash Mankar
ce85cf03cc
added comment for user clarity (#5724) 2021-10-01 17:17:42 +03:00
P-R-O-C-H-Y
f2a20e8a38
SD.open() new feature for creating all folders in path (#5721)
* SD.open() new feature for creating all folders in path

This PR adds to the SD.open() function option to create all folders to the file.

SD.open(const char* path, const char* mode, const bool create)

Default value of create is false.
When true folders are created.

From issue #5019

* Update vfs_api.cpp

memccpy -> memcpy

* File f = open() edit

added false for create
2021-10-01 17:16:59 +03:00
Serguei S. Dukachev
93f10609f4
SDMMC frequency selection based on board type (#5688)
* SDMMC frequency selection based on board type

On Olimex ESP32 EVB I/O operations with SD card can cause error when LAN is used in same time.
Problem is disappearing if SD MMC frequency lower down from SDMMC_FREQ_HIGHSPEED to SDMMC_FREQ_DEFAULT.

No problem if WiFi used instead LAN.

* Code rewritten according to https://github.com/espressif/arduino-esp32/pull/5688#pullrequestreview-759359645
2021-10-01 15:48:20 +03:00
Felix Collins
67583e84d6
Return size_t instead of uint8_t from BLECharacteristic::getLength(). Allows large MTU to be used. (#5687) 2021-10-01 15:47:42 +03:00
long_long_float
204f360dce
Append '/' to an URL with empty path in HTTPClient::begin (#5634)
* Add an error check for empty path of an URL

* Append '/' to an URL with empty path instead of returning an error
2021-10-01 15:04:09 +03:00
Danylo Ulianych
3f06a38f69
SD_MMC max_freq_khz is set to HIGHSPEED by default (#5631) 2021-10-01 15:03:38 +03:00
liebman
e4acfbc54a
only use ksz8081 for idf versions later than 4.3 (this fixes compile as component for idf 4.3) (#5599)
esp_eth_phy_new_ksz8081 was added in IDF after version 4.3 and generates a compilation error with IDF-4.3. This change will only use esp_eth_phy_new_ksz8081 for IDF versions after 4.3
2021-10-01 14:38:45 +03:00
Mark
9eea85f9ff
Check if m_pServerCallbacks is not null before calling method. (#5603)
Fixes: https://github.com/espressif/arduino-esp32/issues/5573

To reproduce:
1. Run any sample code that starts a BLE server, and does not call `setCallbacks`.
2. Connect to the device using the "LightBlue" app on iOS.
3. Observe crash shown in the issue linked above.
2021-08-31 09:20:02 +03:00
beamholder
0730e0ec93
Include nvs_commit() on three methods (#5309)
* Include nvs_commit() on three methods

In [Preferences.cpp](https://github.com/espressif/arduino-esp32/blob/master/libraries/Preferences/src/Preferences.cpp),  the functions:
```
Preferences::clear()
Preferences::remove()
Preferences::end()
```
should be revised to include a call to 
`nvs_commit()`
as required per 
[Non-volatile storage library](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/nvs_flash.html)
when using 
```
nvs_erase_all()
nvs_erase_key()
nvs_close()
```
2021-08-23 21:23:42 +03:00