Skip to content

Commit

Permalink
Merge branch 'master' into component-template-example
Browse files Browse the repository at this point in the history
  • Loading branch information
P-R-O-C-H-Y authored Nov 13, 2023
2 parents c4a499a + fbfcb80 commit 24e635d
Show file tree
Hide file tree
Showing 12 changed files with 1,557 additions and 1,328 deletions.
2,636 changes: 1,382 additions & 1,254 deletions boards.txt

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/source/boards/boards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The ESP32 is divided by family:
* Wi-Fi only
* ESP32-C
* Wi-Fi and BLE 5
* ESP32-H
* BLE and IEEE 802.15.4

For each family, we have SoC variants with some differentiation. The differences are more about the embedded flash and its size and the number of the cores (dual or single).

Expand Down Expand Up @@ -71,6 +73,9 @@ Espressif
ESP32-S2-Saola-1 <ESP32-S2-Saola-1>
ESP32-C3-DevKitM-1 <ESP32-C3-DevKitM-1>

.. note::
Only a few development boards are described on this documentation page. For more information about other Espressif development boards please refer to the `Espressif website <https://www.espressif.com/en/products/devkits>`_.

Third Party
-----------

Expand Down
7 changes: 5 additions & 2 deletions idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ files:
- "**/*"
dependencies:
idf: ">=5.1"
mdns: "^1.1.0"
chmorgan/esp-libhelix-mp3: "1.0.3"
# mdns 1.2.1 is necessary to build H2 with no WiFi
mdns: "1.2.1"
chmorgan/esp-libhelix-mp3:
version: "1.0.3"
require: public
espressif/esp-zboss-lib: "^1.0.1"
espressif/esp-zigbee-lib: "^1.0.1"
esp-dsp: "^1.3.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "RMaker.h"
#include "WiFi.h"
#include "WiFiProv.h"
#include "led_strip.h"

#define DEFAULT_POWER_MODE true
#define DEFAULT_SWING false
Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
log_e("esp_wifi_set_ps failed");
}
} else if(event->event_id == ARDUINO_EVENT_WIFI_STA_STOP) {
WiFiSTAClass::_setStatus(WL_NO_SHIELD);
WiFiSTAClass::_setStatus(WL_STOPPED);
clearStatusBits(STA_STARTED_BIT | STA_CONNECTED_BIT | STA_HAS_IP_BIT | STA_HAS_IP6_BIT);
} else if(event->event_id == ARDUINO_EVENT_WIFI_STA_CONNECTED) {
WiFiSTAClass::_setStatus(WL_IDLE_STATUS);
Expand Down
29 changes: 26 additions & 3 deletions libraries/WiFi/src/WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ wifi_auth_mode_t WiFiSTAClass::_minSecurity = WIFI_AUTH_WPA2_PSK;
wifi_scan_method_t WiFiSTAClass::_scanMethod = WIFI_FAST_SCAN;
wifi_sort_method_t WiFiSTAClass::_sortMethod = WIFI_CONNECT_AP_BY_SIGNAL;

static wl_status_t _sta_status = WL_NO_SHIELD;
static wl_status_t _sta_status = WL_STOPPED;
static EventGroupHandle_t _sta_status_group = NULL;

void WiFiSTAClass::_setStatus(wl_status_t status)
Expand Down Expand Up @@ -373,6 +373,7 @@ bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap)
wifi_sta_config(&conf);

if(WiFi.getMode() & WIFI_MODE_STA){
_useStaticIp = false;
if(eraseap){
if(esp_wifi_set_config((wifi_interface_t)ESP_IF_WIFI_STA, &conf)){
log_e("clear config failed!");
Expand Down Expand Up @@ -430,6 +431,19 @@ bool WiFiSTAClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subne
return err == ESP_OK;
}

/**
* Change DNS server for static IP configuration
* @param dns1 Static DNS server 1
* @param dns2 Static DNS server 2 (optional)
*/
bool WiFiSTAClass::setDNS(IPAddress dns1, IPAddress dns2)
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL)
return false;
esp_err_t err = set_esp_interface_dns(ESP_IF_WIFI_STA, dns1, dns2);
return err == ESP_OK;
}

/**
* is STA interface connected?
* @return true if STA is connected to an AP
Expand Down Expand Up @@ -716,14 +730,23 @@ String WiFiSTAClass::psk() const
* Return the current bssid / mac associated with the network if configured
* @return bssid uint8_t *
*/
uint8_t* WiFiSTAClass::BSSID(void)
uint8_t* WiFiSTAClass::BSSID(uint8_t* buff)
{
static uint8_t bssid[6];
wifi_ap_record_t info;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return NULL;
}
if(!esp_wifi_sta_get_ap_info(&info)) {
esp_err_t err = esp_wifi_sta_get_ap_info(&info);
if (buff != NULL) {
if(err) {
memset(buff, 0, 6);
} else {
memcpy(buff, info.bssid, 6);
}
return buff;
}
if(!err) {
memcpy(bssid, info.bssid, 6);
return reinterpret_cast<uint8_t*>(bssid);
}
Expand Down
3 changes: 2 additions & 1 deletion libraries/WiFi/src/WiFiSTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class WiFiSTAClass
wl_status_t begin();

bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000);
bool setDNS(IPAddress dns1, IPAddress dns2 = (uint32_t)0x00000000); // sets DNS IP for all network interfaces

bool reconnect();
bool disconnect(bool wifioff = false, bool eraseap = false);
Expand Down Expand Up @@ -98,7 +99,7 @@ class WiFiSTAClass
String SSID() const;
String psk() const;

uint8_t * BSSID();
uint8_t * BSSID(uint8_t* bssid = NULL);
String BSSIDstr();

int8_t RSSI();
Expand Down
11 changes: 10 additions & 1 deletion libraries/WiFi/src/WiFiScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,20 @@ int32_t WiFiScanClass::RSSI(uint8_t i)
/**
* return MAC / BSSID of scanned wifi
* @param i specify from which network item want to get the information
* @param buff optional buffer for the result uint8_t array with length 6
* @return uint8_t * MAC / BSSID of scanned wifi
*/
uint8_t * WiFiScanClass::BSSID(uint8_t i)
uint8_t * WiFiScanClass::BSSID(uint8_t i, uint8_t* buff)
{
wifi_ap_record_t* it = reinterpret_cast<wifi_ap_record_t*>(_getScanInfoByIndex(i));
if(buff != NULL) {
if(!it) {
memset(buff, 0, 6);
} else {
memcpy(buff, it->bssid, 6);
}
return buff;
}
if(!it) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFiScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WiFiScanClass
String SSID(uint8_t networkItem);
wifi_auth_mode_t encryptionType(uint8_t networkItem);
int32_t RSSI(uint8_t networkItem);
uint8_t * BSSID(uint8_t networkItem);
uint8_t * BSSID(uint8_t networkItem, uint8_t* bssid = NULL);
String BSSIDstr(uint8_t networkItem);
int32_t channel(uint8_t networkItem);
static void * getScanInfoByIndex(int i) { return _getScanInfoByIndex(i); };
Expand Down
1 change: 1 addition & 0 deletions libraries/WiFi/src/WiFiType.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

typedef enum {
WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library
WL_STOPPED = 254,
WL_IDLE_STATUS = 0,
WL_NO_SSID_AVAIL = 1,
WL_SCAN_COMPLETED = 2,
Expand Down
128 changes: 64 additions & 64 deletions package/package_esp32_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
"packager": "esp32",
"name": "esp32-arduino-libs",
"version": "idf-release_v5.1-6b1f40b9bf"
"version": "idf-release_v5.1-b6a66b7d8c"
},
{
"packager": "esp32",
Expand Down Expand Up @@ -74,7 +74,7 @@
{
"packager": "esp32",
"name": "openocd-esp32",
"version": "v0.12.0-esp32-20230419"
"version": "v0.12.0-esp32-20230921"
},
{
"packager": "esp32",
Expand All @@ -97,63 +97,63 @@
"tools": [
{
"name": "esp32-arduino-libs",
"version": "idf-release_v5.1-6b1f40b9bf",
"version": "idf-release_v5.1-b6a66b7d8c",
"systems": [
{
"host": "i686-mingw32",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
},
{
"host": "x86_64-mingw32",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
},
{
"host": "arm64-apple-darwin",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
},
{
"host": "x86_64-apple-darwin",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
},
{
"host": "aarch64-linux-gnu",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/91077b905f50a66c4ecfae2fd5070530c932e97f",
"archiveFileName": "esp32-arduino-libs-91077b905f50a66c4ecfae2fd5070530c932e97f.zip",
"checksum": "SHA-256:7862c881730df293d129a34994c8f0416276c5aa22df01df6f6b9a5ba11b7dd4",
"size": "361692919"
"url": "https://codeload.github.com/espressif/esp32-arduino-libs/zip/9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a",
"archiveFileName": "esp32-arduino-libs-9ceb4a6f9bf33c9b72c95b647ad67d45f25fd01a.zip",
"checksum": "SHA-256:a7ba8799757ab5c59501895f936ce77cdb0b2599c3a63b437f9a2ca686207abe",
"size": "367803590"
}
]
},
Expand Down Expand Up @@ -531,56 +531,56 @@
},
{
"name": "openocd-esp32",
"version": "v0.12.0-esp32-20230419",
"version": "v0.12.0-esp32-20230921",
"systems": [
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz",
"archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230419.tar.gz",
"checksum": "SHA-256:5144e7516cd75a2152b35ecae0a400f7d3d4424c2488fbacc49433564f54c70d",
"size": "2126949"
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz",
"archiveFileName": "openocd-esp32-linux-amd64-0.12.0-esp32-20230921.tar.gz",
"checksum": "SHA-256:61e38e0a13a5c1664624ec1c397d7f7d6868554b0d345d3fb1f7294cce38cc4b",
"size": "2193783"
},
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz",
"archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230419.tar.gz",
"checksum": "SHA-256:1c4d900c738fe00730c6033abb6cf1cc6587717dbeee291d5908272d153d329a",
"size": "1989161"
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz",
"archiveFileName": "openocd-esp32-linux-arm64-0.12.0-esp32-20230921.tar.gz",
"checksum": "SHA-256:6430315dc1b926541c93cef63d2b08982543ad3f9fe6e0d7107c8a518ef20432",
"size": "2062058"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz",
"archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230419.tar.gz",
"checksum": "SHA-256:293258fd67618dd352e1096137ad9f2b801926eaf74ffcd570540ae94ad8ee5c",
"size": "2129727"
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz",
"archiveFileName": "openocd-esp32-linux-armel-0.12.0-esp32-20230921.tar.gz",
"checksum": "SHA-256:5df16d8a91f013a547f6b3b914c655a9d267996a3b6503031b335ac04a4f8d15",
"size": "2206666"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz",
"archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230419.tar.gz",
"checksum": "SHA-256:621aad7d011c6817cde9570dfea42c7bcc699458bf43c37706cb4c2f6475a247",
"size": "2237976"
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz",
"archiveFileName": "openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz",
"checksum": "SHA-256:0a4f764934f488af18cdac2a0d152dd36b4870f3bec1a2d4e25b6b3b7a5258a0",
"size": "2305832"
},
{
"host": "arm64-apple-darwin",
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz",
"archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230419.tar.gz",
"checksum": "SHA-256:3af7eac3a7de3939731ec4c13fb5d72a8e6ce5e5d274bb9697f5d93039561e42",
"size": "2270699"
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz",
"archiveFileName": "openocd-esp32-macos-arm64-0.12.0-esp32-20230921.tar.gz",
"checksum": "SHA-256:6dce89048f642eb0559a915b6e514f90feb2a95afe21b84f0b0ebf2b27824816",
"size": "2341406"
},
{
"host": "i686-mingw32",
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip",
"archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip",
"checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7",
"size": "2619680"
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip",
"archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip",
"checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d",
"size": "2710475"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230419/openocd-esp32-win32-0.12.0-esp32-20230419.zip",
"archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230419.zip",
"checksum": "SHA-256:f2cb3d9cacfe789c20d3272af846d726a062ce8f2e4ee142bddb27501d7dd7a7",
"size": "2619680"
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-win32-0.12.0-esp32-20230921.zip",
"archiveFileName": "openocd-esp32-win32-0.12.0-esp32-20230921.zip",
"checksum": "SHA-256:ac9d522a63b0816f64d921547bd55c031788035ced85c067d8e7c2862cb1bd0d",
"size": "2710475"
}
]
},
Expand Down
Loading

0 comments on commit 24e635d

Please sign in to comment.