-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from ayushsharma82/dev
v2.0.3
- Loading branch information
Showing
10 changed files
with
384 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,14 +64,20 @@ jobs: | |
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/mathieucarbou/esphome-ESPAsyncTCP#v2.0.0 | ||
|
||
- name: Install ESPAsyncWebServer | ||
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/mathieucarbou/ESPAsyncWebServer#v2.10.4 | ||
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/mathieucarbou/ESPAsyncWebServer#v3.0.2 | ||
|
||
- name: Build Demo | ||
run: arduino-cli compile --library . --warnings none -b ${{ matrix.board }} "examples/Demo/Demo.ino" | ||
|
||
- name: Build Demo_AP | ||
run: arduino-cli compile --library . --warnings none -b ${{ matrix.board }} "examples/Demo_AP/Demo_AP.ino" | ||
|
||
- name: Build Logging | ||
run: arduino-cli compile --library . --warnings none -b ${{ matrix.board }} "examples/Logging/Logging.ino" | ||
|
||
- name: Build HighPerf | ||
run: arduino-cli compile --library . --warnings none -b ${{ matrix.board }} "examples/HighPerf/HighPerf.ino" | ||
|
||
platformio: | ||
name: pio ${{ matrix.name }} | ||
runs-on: ubuntu-latest | ||
|
@@ -82,31 +88,31 @@ jobs: | |
- name: esp32dev|arduino | ||
board: esp32dev | ||
platform: espressif32 | ||
opts: | ||
opts: "--project-option 'lib_compat_mode = strict'" | ||
- name: esp32dev|arduino-2 | ||
board: esp32dev | ||
platform: [email protected] | ||
opts: | ||
opts: "--project-option 'lib_compat_mode = strict'" | ||
- name: esp32dev|arduino-3 | ||
board: esp32dev | ||
platform: espressif32 | ||
opts: "--project-option 'platform_packages=platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0, platform_packages=platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip'" | ||
opts: "--project-option 'lib_compat_mode = strict' --project-option 'platform_packages=platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.2, platform_packages=platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip'" | ||
- name: esp32-s3-devkitc-1|arduino | ||
board: esp32-s3-devkitc-1 | ||
platform: espressif32 | ||
opts: | ||
opts: "--project-option 'lib_compat_mode = strict'" | ||
- name: esp32-s3-devkitc-1|arduino-2 | ||
board: esp32-s3-devkitc-1 | ||
platform: [email protected] | ||
opts: | ||
opts: "--project-option 'lib_compat_mode = strict'" | ||
- name: esp32-s3-devkitc-1|arduino-3 | ||
board: esp32-s3-devkitc-1 | ||
platform: espressif32 | ||
opts: "--project-option 'platform_packages=platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0, platform_packages=platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip'" | ||
opts: "--project-option 'lib_compat_mode = strict' --project-option 'platform_packages=platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.2, platform_packages=platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip'" | ||
- name: huzzah|espressif8266 | ||
board: huzzah | ||
platform: espressif8266 | ||
opts: | ||
opts: "--project-option 'lib_compat_mode = strict'" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up cache | ||
|
@@ -123,4 +129,11 @@ jobs: | |
- run: platformio platform install ${{ matrix.platform }} | ||
|
||
- run: platformio ci "examples/Demo/Demo.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
- run: platformio ci "examples/Demo_AP/Demo_AP.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
- run: platformio ci "examples/Demo_AP/Demo_AP.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
- run: platformio ci "examples/Logging/Logging.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
- run: platformio ci "examples/HighPerf/HighPerf.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
|
||
- run: PLATFORMIO_BUILD_FLAGS="-DWSL_HIGH_PERF" platformio ci "examples/Demo/Demo.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
- run: PLATFORMIO_BUILD_FLAGS="-DWSL_HIGH_PERF" platformio ci "examples/Demo_AP/Demo_AP.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
- run: PLATFORMIO_BUILD_FLAGS="-DWSL_HIGH_PERF" platformio ci "examples/Logging/Logging.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} | ||
- run: PLATFORMIO_BUILD_FLAGS="-DWSL_HIGH_PERF" platformio ci "examples/HighPerf/HighPerf.ino" -l '.' -b ${{ matrix.board }} ${{ matrix.opts }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* This example shows how to use WebSerial variant to send data to the browser when timing, speed and latency are important. | ||
* WebSerial focuses on reducing latency and increasing speed by enqueueing messages and sending them in a single packet. | ||
* | ||
* The responsibility is left to the caller to ensure that the messages sent are not too large or not too small and frequent. | ||
* For example, use of printf(), write(c), print(c), etc are not recommended. | ||
* | ||
* This variant can allow WebSerial to support a high speed of more than 20 messages per second like in this example. | ||
* | ||
* It can be used to log data, debug, or send data to the browser in real-time without any delay. | ||
* | ||
* You might want to look at the Logging variant to see how to better use WebSerial for streaming logging. | ||
* | ||
* You might want to control these flags to control the async library performance: | ||
* -D CONFIG_ASYNC_TCP_QUEUE_SIZE=128 | ||
* -D CONFIG_ASYNC_TCP_RUNNING_CORE=1 | ||
* -D WS_MAX_QUEUED_MESSAGES=128 | ||
*/ | ||
#include <Arduino.h> | ||
#if defined(ESP8266) | ||
#include <ESP8266WiFi.h> | ||
#include <ESPAsyncTCP.h> | ||
#elif defined(ESP32) | ||
#include <AsyncTCP.h> | ||
#include <WiFi.h> | ||
#endif | ||
#include <DNSServer.h> | ||
#include <ESPAsyncWebServer.h> | ||
#include <WString.h> | ||
#include <WebSerial.h> | ||
|
||
AsyncWebServer server(80); | ||
|
||
static const char* dict = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890"; | ||
static uint32_t last = millis(); | ||
static uint32_t count = 0; | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
|
||
WiFi.softAP("WSLDemo"); | ||
Serial.print("IP Address: "); | ||
Serial.println(WiFi.softAPIP().toString()); | ||
|
||
WebSerial.onMessage([](const String& msg) { Serial.println(msg); }); | ||
WebSerial.begin(&server); | ||
|
||
server.onNotFound([](AsyncWebServerRequest* request) { request->redirect("/webserial"); }); | ||
server.begin(); | ||
} | ||
|
||
void loop() { | ||
if (millis() - last > 50) { | ||
count++; | ||
long r = random(10, 250) + 15; | ||
String buffer; | ||
buffer.reserve(r); | ||
buffer += count; | ||
while (buffer.length() < 10) { | ||
buffer += " "; | ||
} | ||
buffer += ""; | ||
for (int i = 0; i < r; i++) { | ||
buffer += dict[random(0, 62)]; | ||
} | ||
WebSerial.print(buffer); | ||
last = millis(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* This example shows how to use WebSerial variant to send logging data to the browser. | ||
* | ||
* Before using this example, make sure to look at the WebSerial example before and its description.\ | ||
* | ||
* You might want to control these flags to control the async library performance: | ||
* -D CONFIG_ASYNC_TCP_QUEUE_SIZE=128 | ||
* -D CONFIG_ASYNC_TCP_RUNNING_CORE=1 | ||
* -D WS_MAX_QUEUED_MESSAGES=128 | ||
*/ | ||
#include <Arduino.h> | ||
#if defined(ESP8266) | ||
#include <ESP8266WiFi.h> | ||
#include <ESPAsyncTCP.h> | ||
#elif defined(ESP32) | ||
#include <AsyncTCP.h> | ||
#include <WiFi.h> | ||
#endif | ||
#include <DNSServer.h> | ||
#include <ESPAsyncWebServer.h> | ||
#include <WString.h> | ||
#include <WebSerial.h> | ||
|
||
AsyncWebServer server(80); | ||
|
||
static uint32_t last = millis(); | ||
static uint32_t count = 0; | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
|
||
WiFi.softAP("WSLDemo"); | ||
Serial.print("IP Address: "); | ||
Serial.println(WiFi.softAPIP().toString()); | ||
|
||
WebSerial.onMessage([](const String& msg) { Serial.println(msg); }); | ||
WebSerial.begin(&server); | ||
WebSerial.setBuffer(100); | ||
|
||
server.onNotFound([](AsyncWebServerRequest* request) { request->redirect("/webserial"); }); | ||
server.begin(); | ||
} | ||
|
||
void loop() { | ||
if (millis() - last > 1000) { | ||
count++; | ||
|
||
WebSerial.print(F("IP address: ")); | ||
WebSerial.println(WiFi.softAPIP()); | ||
WebSerial.printf("Uptime: %lums\n", millis()); | ||
WebSerial.printf("Free heap: %" PRIu32 "\n", ESP.getFreeHeap()); | ||
|
||
last = millis(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=WebSerial | ||
version=2.0.2 | ||
version=2.0.3 | ||
author=Ayush Sharma | ||
category=Communication | ||
maintainer=Ayush Sharma <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.