-
Notifications
You must be signed in to change notification settings - Fork 573
feat: Support Nano 33 IoT, MKR WIFI 1010, XIAO, Wio Terminal #901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
7b84f07
feat: arduino uno r wifi r 4 support
kakopappa 809b9a3
Merge branch 'master' of https://github.com/kakopappa/arduinoWebSockets
kakopappa 6c69b58
Update library.json
kakopappa fa6435a
Update README.md
kakopappa 59289b1
feat: read me updated. example fixed.
kakopappa 633fb98
fix: broken link
kakopappa cbba76e
fix: logging
kakopappa 01387c9
Update library.properties
kakopappa 07c3b94
Update WebSocketsVersion.h
kakopappa 3f7795c
Update WebSocketsVersion.h
kakopappa 15a8053
feat: Arduino NINA support.
kakopappa daf2d38
feat: Support Arduino NINA
kakopappa 4d373f0
feat: Support Arduino NINA
kakopappa 0d34f7c
feat: Support Arduino NINA
kakopappa 1b1dbe5
feat: remove Rev2
kakopappa 8c59076
feat: Support Arduino NINA
kakopappa 6bf4622
feat: Support Wio-Terminal
kakopappa debb30b
Create arduino-lint.yaml
kakopappa 6e154a8
Create arduino-lint.yaml
kakopappa b44ea5c
Delete .github/workflows/.github/workflows directory
kakopappa aaae82c
Create compile-unor4wifi-examples.yaml
kakopappa 716bc83
Create compile-arduino_wifinina-examples.yaml
kakopappa 47986cb
fix: install WiFiNINA
kakopappa 30da358
Update compile-unor4wifi-examples.yaml
kakopappa 8f3f464
feat: workflow for wio terminal
kakopappa 7e586b6
fix: comments
kakopappa 53ddebc
fix: workflow name
kakopappa a29e0c1
fix: workflow path
kakopappa d01a3a7
feat: add seeed XIAO
kakopappa 3a56020
fix: examples path
kakopappa 940f047
feat: wio_terminal added
kakopappa ccc772d
fix: samd
kakopappa b8261af
Merge pull request #1 from kakopappa/wio-terminal
kakopappa c279673
SSL support for Uno 4 and bugfixes
kakopappa 0037ebd
fix: SSL class
kakopappa 1b368be
Merge pull request #2 from kakopappa/wio-terminal
kakopappa c5abae3
fix: make workflows tigger on relavent changes.
kakopappa d4c275e
chor: add links
kakopappa 997c9c6
Merge branch 'master' into main
kakopappa ffe6d90
fix: pr comments
kakopappa 11bd92a
Merge branch 'main' of https://github.com/kakopappa/arduinoWebSockets…
kakopappa 865490d
fix: pr comments
kakopappa 7ee5b45
fix: remove dup definition
kakopappa 271ebe8
fix: pr comments
kakopappa 12f1ad8
fix: compliation errors
kakopappa b32f3c2
fix: distructor
kakopappa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,81 @@ | ||
name: Compile SeedStudio Examples | ||
|
||
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/compile-seeed-studio-examples.yaml" | ||
- "examples/seeed-studio/**" | ||
- "src/**" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/compile-seeed-studio-examples.yaml" | ||
- "examples/seeed-studio/**" | ||
- "src/**" | ||
schedule: | ||
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). | ||
- cron: "0 8 * * TUE" | ||
workflow_dispatch: | ||
repository_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.board.fqbn }} | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SKETCHES_REPORTS_PATH: sketches-reports | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
board: | ||
- fqbn: Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off | ||
platforms: | | ||
- name: Seeeduino:samd | ||
source-url: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json | ||
libraries: | | ||
- name: Seeed Arduino rpcWiFi | ||
- name: Seeed Arduino rpcUnified | ||
- name: Seeed_Arduino_mbedtls | ||
- name: Seeed Arduino FS | ||
- name: Seeed Arduino SFUD | ||
artifact-name-suffix: seeeduino-xia0 | ||
- fqbn: Seeeduino:samd:seeed_wio_terminal | ||
platforms: | | ||
- name: Seeeduino:samd | ||
source-url: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json | ||
libraries: | | ||
- name: Seeed Arduino rpcWiFi | ||
- name: Seeed Arduino rpcUnified | ||
- name: Seeed_Arduino_mbedtls | ||
- name: Seeed Arduino FS | ||
- name: Seeed Arduino SFUD | ||
artifact-name-suffix: seeeduino-wio_terminal | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Compile examples | ||
uses: arduino/compile-sketches@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
fqbn: ${{ matrix.board.fqbn }} | ||
platforms: ${{ matrix.board.platforms }} | ||
libraries: | | ||
# Install the library from the local path. | ||
- source-path: ./ | ||
${{ matrix.board.libraries }} | ||
sketch-paths: | | ||
- examples/seeed-studio/xio-wio-terminal/WebSocketClient | ||
enable-deltas-report: true | ||
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} | ||
|
||
- name: Save sketches report as workflow artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
path: ${{ env.SKETCHES_REPORTS_PATH }} | ||
name: sketches-report-${{ matrix.board.artifact-name-suffix }} |
This file contains hidden or 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 hidden or 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
105 changes: 105 additions & 0 deletions
105
examples/seeed-studio/xio-wio-terminal/WebSocketClient/WebSocketClient.ino
This file contains hidden or 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,105 @@ | ||
/* | ||
* WebSocketClient.ino | ||
* | ||
* Created on: 10.08.2024 | ||
* | ||
*/ | ||
|
||
#include <Arduino.h> | ||
#include <rpcWiFi.h> | ||
#include <WiFiMulti.h> | ||
#include <WebSocketsClient.h> | ||
|
||
WebSocketsClient webSocket; | ||
WiFiMulti wifiMulti; | ||
|
||
#define USE_SERIAL Serial | ||
|
||
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) { | ||
const uint8_t* src = (const uint8_t*) mem; | ||
USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len); | ||
for(uint32_t i = 0; i < len; i++) { | ||
if(i % cols == 0) { | ||
USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i); | ||
} | ||
USE_SERIAL.printf("%02X ", *src); | ||
src++; | ||
} | ||
USE_SERIAL.printf("\n"); | ||
} | ||
|
||
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { | ||
|
||
switch(type) { | ||
case WStype_DISCONNECTED: | ||
USE_SERIAL.printf("[WSc] Disconnected!\n"); | ||
break; | ||
case WStype_CONNECTED: | ||
USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload); | ||
|
||
// send message to server when Connected | ||
webSocket.sendTXT("Connected"); | ||
break; | ||
case WStype_TEXT: | ||
USE_SERIAL.printf("[WSc] get text: %s\n", payload); | ||
|
||
// send message to server | ||
// webSocket.sendTXT("message here"); | ||
break; | ||
case WStype_BIN: | ||
USE_SERIAL.printf("[WSc] get binary length: %u\n", length); | ||
hexdump(payload, length); | ||
|
||
// send data to server | ||
// webSocket.sendBIN(payload, length); | ||
break; | ||
case WStype_ERROR: | ||
case WStype_FRAGMENT_TEXT_START: | ||
case WStype_FRAGMENT_BIN_START: | ||
case WStype_FRAGMENT: | ||
case WStype_PONG: | ||
case WStype_PING: | ||
case WStype_FRAGMENT_FIN: | ||
break; | ||
} | ||
|
||
} | ||
|
||
void setup() { | ||
// USE_SERIAL.begin(921600); | ||
USE_SERIAL.begin(115200); | ||
|
||
USE_SERIAL.println(); | ||
USE_SERIAL.println(); | ||
USE_SERIAL.println(); | ||
|
||
for(uint8_t t = 4; t > 0; t--) { | ||
USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); | ||
USE_SERIAL.flush(); | ||
delay(1000); | ||
} | ||
|
||
wifiMulti.addAP("SSID", "passpasspass"); | ||
|
||
//WiFi.disconnect(); | ||
while(wifiMulti.run() != WL_CONNECTED) { | ||
delay(100); | ||
} | ||
|
||
// server address, port and URL | ||
webSocket.begin("192.168.0.123", 81, "/"); | ||
|
||
// event handler | ||
webSocket.onEvent(webSocketEvent); | ||
|
||
// use HTTP Basic Authorization this is optional remove if not needed | ||
webSocket.setAuthorization("user", "Password"); | ||
|
||
// try ever 5000 again if connection has failed | ||
webSocket.setReconnectInterval(5000); | ||
|
||
} | ||
|
||
void loop() { | ||
webSocket.loop(); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.