Skip to content

Commit

Permalink
Merge branch 'espressif:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Aug 2, 2024
2 parents baee3a9 + 1a42b87 commit 955521a
Show file tree
Hide file tree
Showing 54 changed files with 466 additions and 65 deletions.
49 changes: 48 additions & 1 deletion .github/scripts/on-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,54 @@ if [ "$RELEASE_PRE" == "false" ]; then
fi
fi

# Upload package JSONs (temporary halted to fix json generation)
# Test the package JSONs

echo "Installing arduino-cli ..."
export PATH="/home/runner/bin:$PATH"
source ./.github/scripts/install-arduino-cli.sh

echo "Testing $PACKAGE_JSON_DEV install ..."
echo "Updating index ..."
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_DEV"
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi

echo "Installing esp32 ..."
arduino-cli core install esp32:esp32
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi

echo "Compiling example ..."
arduino-cli compile --fqbn esp32:esp32:esp32 $GITHUB_WORKSPACE/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
if [ $? -ne 0 ]; then echo "ERROR: Failed to compile example ($?)"; exit 1; fi

echo "Uninstalling esp32 ..."
arduino-cli core uninstall esp32:esp32
if [ $? -ne 0 ]; then echo "ERROR: Failed to uninstall esp32 ($?)"; exit 1; fi

echo "Test successful!"

if [ "$RELEASE_PRE" == "false" ]; then
echo "Testing $PACKAGE_JSON_REL install ..."
echo "Updating index ..."
arduino-cli core update-index --additional-urls "file://$OUTPUT_DIR/$PACKAGE_JSON_REL"
if [ $? -ne 0 ]; then echo "ERROR: Failed to update index ($?)"; exit 1; fi

echo "Installing esp32 ..."
arduino-cli core install esp32:esp32
if [ $? -ne 0 ]; then echo "ERROR: Failed to install esp32 ($?)"; exit 1; fi

echo "Compiling example ..."
arduino-cli compile --fqbn esp32:esp32:esp32 $GITHUB_WORKSPACE/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
if [ $? -ne 0 ]; then echo "ERROR: Failed to compile example ($?)"; exit 1; fi

echo "Uninstalling esp32 ..."
arduino-cli core uninstall esp32:esp32
if [ $? -ne 0 ]; then echo "ERROR: Failed to uninstall esp32 ($?)"; exit 1; fi

echo "Test successful!"
fi

# Upload package JSONs

echo "Uploading $PACKAGE_JSON_DEV ..."
echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`
echo "Pages URL: "`git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"`
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
with:
python-version: '3.x'
- run: pip install packaging
- run: pip install pyserial
- name: Build Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/esp_arduino_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern "C" {
/** Minor version number (x.X.x) */
#define ESP_ARDUINO_VERSION_MINOR 0
/** Patch version number (x.x.X) */
#define ESP_ARDUINO_VERSION_PATCH 3
#define ESP_ARDUINO_VERSION_PATCH 4

/**
* Macro to convert ARDUINO version number into an integer
Expand Down
2 changes: 1 addition & 1 deletion libraries/ArduinoOTA/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ArduinoOTA
version=3.0.3
version=3.0.4
author=Ivan Grokhotkov and Hristo Gochkov
maintainer=Hristo Gochkov <[email protected]>
sentence=Enables Over The Air upgrades, via wifi and espota.py UDP request/TCP download.
Expand Down
2 changes: 1 addition & 1 deletion libraries/AsyncUDP/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP32 Async UDP
version=3.0.3
version=3.0.4
author=Me-No-Dev
maintainer=Me-No-Dev
sentence=Async UDP Library for ESP32
Expand Down
2 changes: 1 addition & 1 deletion libraries/BLE/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=BLE
version=3.0.3
version=3.0.4
author=Neil Kolban <[email protected]>
maintainer=Dariusz Krempa <[email protected]>
sentence=BLE functions for ESP32
Expand Down
2 changes: 1 addition & 1 deletion libraries/BluetoothSerial/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=BluetoothSerial
version=3.0.3
version=3.0.4
author=Evandro Copercini
maintainer=Evandro Copercini
sentence=Simple UART to Classical Bluetooth bridge for ESP32
Expand Down
2 changes: 1 addition & 1 deletion libraries/DNSServer/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=DNSServer
version=3.0.3
version=3.0.4
author=Kristijan Novoselić
maintainer=Kristijan Novoselić, <[email protected]>
sentence=A simple DNS server for ESP32.
Expand Down
2 changes: 1 addition & 1 deletion libraries/EEPROM/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EEPROM
version=3.0.3
version=3.0.4
author=Ivan Grokhotkov
maintainer=Paolo Becchi <[email protected]>
sentence=Enables reading and writing data a sequential, addressable FLASH storage
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP32/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP32
version=3.0.3
version=3.0.4
author=Hristo Gochkov, Ivan Grokhtkov
maintainer=Hristo Gochkov <[email protected]>
sentence=ESP32 sketches examples
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP_I2S/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP_I2S
version=3.0.3
version=3.0.4
author=me-no-dev
maintainer=me-no-dev
sentence=Library for ESP I2S communication
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP_NOW/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP_NOW
version=3.0.3
version=3.0.4
author=me-no-dev
maintainer=P-R-O-C-H-Y
sentence=Library for ESP_NOW
Expand Down
12 changes: 11 additions & 1 deletion libraries/ESP_NOW/src/ESP32_NOW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,19 @@ bool ESP_NOW_Class::end() {
if (!_esp_now_has_begun) {
return true;
}
//remove all peers?
//remove all peers
for (uint8_t i = 0; i < ESP_NOW_MAX_TOTAL_PEER_NUM; i++) {
if (_esp_now_peers[i] != NULL) {
removePeer(*_esp_now_peers[i]);
}
}
esp_err_t err = esp_now_deinit();
if (err != ESP_OK) {
log_e("esp_now_deinit failed! 0x%x", err);
return false;
}
_esp_now_has_begun = false;
//clear the peer list
memset(_esp_now_peers, 0, sizeof(ESP_NOW_Peer *) * ESP_NOW_MAX_TOTAL_PEER_NUM);
return true;
}
Expand Down Expand Up @@ -262,6 +268,10 @@ void ESP_NOW_Class::onNewPeer(void (*cb)(const esp_now_recv_info_t *info, const
new_arg = arg;
}

bool ESP_NOW_Class::removePeer(ESP_NOW_Peer &peer) {
return peer.remove();
}

ESP_NOW_Class ESP_NOW;

/*
Expand Down
47 changes: 26 additions & 21 deletions libraries/ESP_NOW/src/ESP32_NOW.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@
#include "esp32-hal-log.h"
#include "esp_mac.h"

class ESP_NOW_Peer; //forward declaration for friend function

class ESP_NOW_Class : public Print {
public:
const uint8_t BROADCAST_ADDR[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};

ESP_NOW_Class();
~ESP_NOW_Class();

bool begin(const uint8_t *pmk = NULL /* 16 bytes */);
bool end();

int getTotalPeerCount();
int getEncryptedPeerCount();

int availableForWrite();
size_t write(const uint8_t *data, size_t len);
size_t write(uint8_t data) {
return write(&data, 1);
}

void onNewPeer(void (*cb)(const esp_now_recv_info_t *info, const uint8_t *data, int len, void *arg), void *arg);
bool removePeer(ESP_NOW_Peer &peer);
};

class ESP_NOW_Peer {
private:
uint8_t mac[6];
Expand Down Expand Up @@ -47,28 +72,8 @@ class ESP_NOW_Peer {
virtual void onSent(bool success) {
log_i("Message transmission to peer " MACSTR " %s", MAC2STR(mac), success ? "successful" : "failed");
}
};

class ESP_NOW_Class : public Print {
public:
const uint8_t BROADCAST_ADDR[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};

ESP_NOW_Class();
~ESP_NOW_Class();

bool begin(const uint8_t *pmk = NULL /* 16 bytes */);
bool end();

int getTotalPeerCount();
int getEncryptedPeerCount();

int availableForWrite();
size_t write(const uint8_t *data, size_t len);
size_t write(uint8_t data) {
return write(&data, 1);
}

void onNewPeer(void (*cb)(const esp_now_recv_info_t *info, const uint8_t *data, int len, void *arg), void *arg);
friend bool ESP_NOW_Class::removePeer(ESP_NOW_Peer &);
};

extern ESP_NOW_Class ESP_NOW;
2 changes: 1 addition & 1 deletion libraries/ESP_SR/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP_SR
version=3.0.3
version=3.0.4
author=me-no-dev
maintainer=me-no-dev
sentence=Library for ESP Sound Recognition
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESPmDNS/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESPmDNS
version=3.0.3
version=3.0.4
author=Hristo Gochkov, Ivan Grokhtkov
maintainer=Hristo Gochkov <[email protected]>
sentence=ESP32 mDNS Library
Expand Down
78 changes: 78 additions & 0 deletions libraries/Ethernet/examples/ETH_WIFI_BRIDGE/ETH_WIFI_BRIDGE.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#include <WiFi.h>
#include <ETH.h>
#include <SPI.h>

#define ETH_TYPE ETH_PHY_W5500
#define ETH_ADDR 1
#define ETH_CS 15
#define ETH_IRQ 4
#define ETH_RST 5
#define ETH_SPI_SCK 14
#define ETH_SPI_MISO 12
#define ETH_SPI_MOSI 13

#define AP_SSID "ESP32-ETH-WIFI-BRIDGE"
#define AP_PASS "password"

IPAddress ap_ip(192, 168, 4, 1);
IPAddress ap_mask(255, 255, 255, 0);
IPAddress ap_leaseStart(192, 168, 4, 2);
IPAddress ap_dns(8, 8, 4, 4);

void setup() {
Serial.begin(115200);
Serial.setDebugOutput(true);
Network.onEvent(onEvent);

WiFi.AP.begin();
WiFi.AP.config(ap_ip, ap_ip, ap_mask, ap_leaseStart, ap_dns);
WiFi.AP.create(AP_SSID, AP_PASS);
if (!WiFi.AP.waitStatusBits(ESP_NETIF_STARTED_BIT, 1000)) {
Serial.println("Failed to start AP!");
return;
}
delay(100);

SPI.begin(ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI);
ETH.begin(ETH_TYPE, ETH_ADDR, ETH_CS, ETH_IRQ, ETH_RST, SPI);
}

void loop() {
delay(20000);
}

void onEvent(arduino_event_id_t event, arduino_event_info_t info) {
switch (event) {
case ARDUINO_EVENT_ETH_START: Serial.println("ETH Started"); break;
case ARDUINO_EVENT_ETH_CONNECTED: Serial.println("ETH Connected"); break;
case ARDUINO_EVENT_ETH_GOT_IP:
Serial.println("ETH Got IP");
Serial.println(ETH);
WiFi.AP.enableNAPT(true);
break;
case ARDUINO_EVENT_ETH_LOST_IP:
Serial.println("ETH Lost IP");
WiFi.AP.enableNAPT(false);
break;
case ARDUINO_EVENT_ETH_DISCONNECTED:
Serial.println("ETH Disconnected");
WiFi.AP.enableNAPT(false);
break;
case ARDUINO_EVENT_ETH_STOP: Serial.println("ETH Stopped"); break;

case ARDUINO_EVENT_WIFI_AP_START:
Serial.println("AP Started");
Serial.println(WiFi.AP);
break;
case ARDUINO_EVENT_WIFI_AP_STACONNECTED: Serial.println("AP STA Connected"); break;
case ARDUINO_EVENT_WIFI_AP_STADISCONNECTED: Serial.println("AP STA Disconnected"); break;
case ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED:
Serial.print("AP STA IP Assigned: ");
Serial.println(IPAddress(info.wifi_ap_staipassigned.ip.addr));
break;
case ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED: Serial.println("AP Probe Request Received"); break;
case ARDUINO_EVENT_WIFI_AP_STOP: Serial.println("AP Stopped"); break;

default: break;
}
}
5 changes: 5 additions & 0 deletions libraries/Ethernet/examples/ETH_WIFI_BRIDGE/ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"targets": {
"esp32h2": false
}
}
2 changes: 1 addition & 1 deletion libraries/Ethernet/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Ethernet
version=3.0.3
version=3.0.4
author=Hristo Gochkov
maintainer=Hristo Gochkov <[email protected]>
sentence=Enables network connection (local and Internet) using the ESP32 Ethernet.
Expand Down
2 changes: 1 addition & 1 deletion libraries/FFat/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=FFat
version=3.0.3
version=3.0.4
author=Hristo Gochkov, Ivan Grokhtkov, Larry Bernstone
maintainer=Hristo Gochkov <[email protected]>
sentence=ESP32 FAT on Flash File System
Expand Down
2 changes: 1 addition & 1 deletion libraries/FS/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=FS
version=3.0.3
version=3.0.4
author=Hristo Gochkov, Ivan Grokhtkov
maintainer=Hristo Gochkov <[email protected]>
sentence=ESP32 File System
Expand Down
2 changes: 1 addition & 1 deletion libraries/HTTPClient/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=HTTPClient
version=3.0.3
version=3.0.4
author=Markus Sattler
maintainer=Markus Sattler
sentence=HTTP Client for ESP32
Expand Down
2 changes: 1 addition & 1 deletion libraries/HTTPUpdate/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=HTTPUpdate
version=3.0.3
version=3.0.4
author=Markus Sattler
maintainer=Markus Sattler
sentence=Http Update for ESP32
Expand Down
2 changes: 1 addition & 1 deletion libraries/HTTPUpdateServer/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=HTTPUpdateServer
version=3.0.3
version=3.0.4
author=Hristo Kapanakov
maintainer=
sentence=Simple HTTP Update server based on the WebServer
Expand Down
2 changes: 1 addition & 1 deletion libraries/Insights/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP Insights
version=3.0.3
version=3.0.4
author=Sanket Wadekar <[email protected]>
maintainer=Sanket Wadekar <[email protected]>
sentence=ESP Insights
Expand Down
2 changes: 1 addition & 1 deletion libraries/LittleFS/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=LittleFS
version=3.0.3
version=3.0.4
author=
maintainer=
sentence=LittleFS for esp32
Expand Down
2 changes: 1 addition & 1 deletion libraries/NetBIOS/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=NetBIOS
version=3.0.3
version=3.0.4
author[email protected]
maintainer=Hristo Gochkov<[email protected]>
sentence=Enables NBNS (NetBIOS) name resolution.
Expand Down
2 changes: 1 addition & 1 deletion libraries/Network/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Networking
version=3.0.3
version=3.0.4
author=Hristo Gochkov
maintainer=Hristo Gochkov <[email protected]>
sentence=General network management library.
Expand Down
Loading

0 comments on commit 955521a

Please sign in to comment.