├── .all-contributorsrc ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug-report---problem.md │ ├── config.yml │ ├── feature_request.md │ └── question-template.md ├── ci │ ├── build-esp3d.sh │ ├── final-check.sh │ ├── install-arduino.sh │ ├── install-esp32.sh │ ├── install-esp8266.sh │ ├── install-platformio.sh │ └── prepare-libs.sh ├── stale.yml └── workflows │ ├── build-ci-2.0.yml │ ├── greetings.yml │ ├── lock.yml │ └── pr_notif.yml ├── .gitignore ├── .gitmodules ├── .vscode ├── extensions.json ├── settings.json └── tasks.json ├── Changelog.txt ├── FUNDING.yml ├── LICENSE.txt ├── README.md ├── archives └── repetier │ └── testui.htm ├── embedded ├── build.bat ├── footer.txt ├── gulpfile.js ├── header.txt ├── nofile.h ├── package-lock.json ├── package.json ├── tool.html.gz └── www │ ├── css │ └── style.css │ ├── js │ └── script.js │ └── tool.html ├── esp3d ├── GenLinkedList.h ├── asyncwebserver.cpp ├── asyncwebserver.h ├── command.cpp ├── command.h ├── config.cpp ├── config.h ├── data │ ├── 404.htm │ ├── favicon.ico │ └── index.html.gz ├── esp3d.cpp ├── esp3d.h ├── esp3d.ino ├── esp_oled.cpp ├── esp_oled.h ├── espcom.cpp ├── espcom.h ├── nofile.h ├── notifications_service.cpp ├── notifications_service.h ├── syncwebserver.cpp ├── syncwebserver.h ├── webinterface.cpp ├── webinterface.h ├── wificonf.cpp └── wificonf.h ├── extra-files ├── Files │ ├── 404.htm │ └── favicon.ico └── Readme.txt ├── images ├── ESP3D.png ├── ESP3D72x72.png ├── ESP3D_logo.png ├── ESP3D_logo.xbm ├── ESP3D_logo2.xbm ├── ESP3D_social.png ├── UI │ ├── Page1.png │ ├── Page2.png │ ├── Page3.png │ ├── Page4.png │ ├── Page5-2.png │ ├── Page6.png │ ├── Page7.png │ ├── Page8.png │ ├── files.png │ └── page5.png ├── docs │ └── embedded.png └── sponsors-supporters │ ├── FYSETC │ ├── LOGO.png │ └── fysetc2.svg │ ├── PanucattDevices │ └── Panucatt.jpg │ ├── patrickS.png │ └── sponsor.PNG ├── libraries ├── AsyncTCP │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── component.mk │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── AsyncTCP.cpp │ │ └── AsyncTCP.h │ └── travis │ │ └── common.sh ├── DHT_sensor_library_for_ESPx │ ├── DHTesp.cpp │ ├── DHTesp.h │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── DHT_ESP32 │ │ │ └── DHT_ESP32.ino │ │ ├── DHT_Multi │ │ │ └── DHT_Multi.ino │ │ └── DHT_Test │ │ │ └── DHT_Test.ino │ ├── keywords.txt │ ├── library.json │ └── library.properties ├── ESP32NETBIOS │ ├── ESP32NetBIOS.cpp │ ├── ESP32NetBIOS.h │ ├── LICENSE.md │ ├── examples │ │ └── ESP_NBNST │ │ │ └── ESP_NBNST.ino │ ├── keywords.txt │ └── library.properties ├── ESP32SSDP │ ├── ESP32SSDP.cpp │ ├── ESP32SSDP.h │ ├── README.rst │ ├── examples │ │ └── SSDP │ │ │ └── SSDP.ino │ ├── keywords.txt │ └── library.properties ├── ESPAsyncTCP │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE.txt │ ├── README.md │ ├── examples │ │ └── SyncClient │ │ │ ├── .esp31b.skip │ │ │ └── SyncClient.ino │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── AsyncPrinter.cpp │ │ ├── AsyncPrinter.h │ │ ├── ESPAsyncTCP.cpp │ │ ├── ESPAsyncTCP.h │ │ ├── ESPAsyncTCPbuffer.cpp │ │ ├── ESPAsyncTCPbuffer.h │ │ ├── SyncClient.cpp │ │ ├── SyncClient.h │ │ ├── async_config.h │ │ ├── tcp_axtls.c │ │ └── tcp_axtls.h │ ├── ssl │ │ ├── gen_server_cert.sh │ │ ├── server.cer │ │ └── server.key │ └── travis │ │ └── common.sh ├── ESPAsyncWebServer │ ├── .travis.yml │ ├── README.md │ ├── component.mk │ ├── examples │ │ ├── ESP_AsyncFSBrowser │ │ │ ├── .esp31b.skip │ │ │ ├── ESP_AsyncFSBrowser.ino │ │ │ └── data │ │ │ │ ├── .exclude.files │ │ │ │ ├── ace.js.gz │ │ │ │ ├── ext-searchbox.js.gz │ │ │ │ ├── favicon.ico │ │ │ │ ├── index.htm │ │ │ │ ├── mode-css.js.gz │ │ │ │ ├── mode-html.js.gz │ │ │ │ ├── mode-javascript.js.gz │ │ │ │ └── worker-html.js.gz │ │ └── simple_server │ │ │ └── simple_server.ino │ ├── keywords.txt │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── AsyncEventSource.cpp │ │ ├── AsyncEventSource.h │ │ ├── AsyncJson.h │ │ ├── AsyncWebSocket.cpp │ │ ├── AsyncWebSocket.h │ │ ├── ESPAsyncWebServer.h │ │ ├── SPIFFSEditor.cpp │ │ ├── SPIFFSEditor.h │ │ ├── StringArray.h │ │ ├── WebAuthentication.cpp │ │ ├── WebAuthentication.h │ │ ├── WebHandlerImpl.h │ │ ├── WebHandlers.cpp │ │ ├── WebRequest.cpp │ │ ├── WebResponseImpl.h │ │ ├── WebResponses.cpp │ │ ├── WebServer.cpp │ │ └── edit.htm │ └── travis │ │ └── common.sh ├── arduinoWebSockets │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── Nginx │ │ │ └── esp8266.ssl.reverse.proxy.conf │ │ ├── avr │ │ │ └── WebSocketClientAVR │ │ │ │ └── WebSocketClientAVR.ino │ │ ├── esp32 │ │ │ ├── WebSocketClient │ │ │ │ └── WebSocketClient.ino │ │ │ ├── WebSocketClientSSL │ │ │ │ └── WebSocketClientSSL.ino │ │ │ └── WebSocketServer │ │ │ │ └── WebSocketServer.ino │ │ ├── esp8266 │ │ │ ├── WebSocketClient │ │ │ │ └── WebSocketClient.ino │ │ │ ├── WebSocketClientSSL │ │ │ │ └── WebSocketClientSSL.ino │ │ │ ├── WebSocketClientSocketIO │ │ │ │ └── WebSocketClientSocketIO.ino │ │ │ ├── WebSocketClientStomp │ │ │ │ └── WebSocketClientStomp.ino │ │ │ ├── WebSocketClientStompOverSockJs │ │ │ │ └── WebSocketClientStompOverSockJs.ino │ │ │ ├── WebSocketServer │ │ │ │ └── WebSocketServer.ino │ │ │ ├── WebSocketServerAllFunctionsDemo │ │ │ │ └── WebSocketServerAllFunctionsDemo.ino │ │ │ ├── WebSocketServerFragmentation │ │ │ │ └── WebSocketServerFragmentation.ino │ │ │ ├── WebSocketServerHttpHeaderValidation │ │ │ │ └── WebSocketServerHttpHeaderValidation.ino │ │ │ └── WebSocketServer_LEDcontrol │ │ │ │ └── WebSocketServer_LEDcontrol.ino │ │ └── particle │ │ │ └── ParticleWebSocketClient │ │ │ └── application.cpp │ ├── library.json │ ├── library.properties │ ├── src │ │ ├── WebSockets.cpp │ │ ├── WebSockets.h │ │ ├── WebSocketsClient.cpp │ │ ├── WebSocketsClient.h │ │ ├── WebSocketsServer.cpp │ │ ├── WebSocketsServer.h │ │ ├── libb64 │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ ├── cdecode.c │ │ │ ├── cdecode_inc.h │ │ │ ├── cencode.c │ │ │ └── cencode_inc.h │ │ └── libsha1 │ │ │ ├── libsha1.c │ │ │ └── libsha1.h │ ├── tests │ │ ├── webSocket.html │ │ └── webSocketServer │ │ │ ├── index.js │ │ │ └── package.json │ └── travis │ │ └── common.sh └── oled-ssd1306 │ ├── .travis.yml │ ├── OLEDDisplay.cpp │ ├── OLEDDisplay.h │ ├── OLEDDisplayFonts.h │ ├── OLEDDisplayUi.cpp │ ├── OLEDDisplayUi.h │ ├── README.md │ ├── SH1106.h │ ├── SH1106Brzo.h │ ├── SH1106Spi.h │ ├── SH1106Wire.h │ ├── SSD1306.h │ ├── SSD1306Brzo.h │ ├── SSD1306Spi.h │ ├── SSD1306Wire.h │ ├── UPGRADE-3.0.md │ ├── examples │ ├── SSD1306ClockDemo │ │ ├── SSD1306ClockDemo.ino │ │ └── images.h │ ├── SSD1306DrawingDemo │ │ └── SSD1306DrawingDemo.ino │ ├── SSD1306OTADemo │ │ └── SSD1306OTADemo.ino │ ├── SSD1306SimpleDemo │ │ ├── SSD1306SimpleDemo.ino │ │ └── images.h │ └── SSD1306UiDemo │ │ ├── SSD1306UiDemo.ino │ │ └── images.h │ ├── library.json │ ├── library.properties │ ├── license │ └── resources │ ├── DemoFrame1.jpg │ ├── DemoFrame2.jpg │ ├── DemoFrame3.jpg │ ├── DemoFrame4.jpg │ ├── FontTool.png │ ├── SPI_version.jpg │ └── xbmPreview.png └── platformio.ini /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | #github: luc-github 4 | #patreon: # Replace with a single Patreon username 5 | #open_collective: # Replace with a single Open Collective username 6 | ko_fi: ESP3D # Replace with a single Ko-fi username 7 | #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | #community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: ESP3D 10 | #issuehunt: # Replace with a single IssueHunt username 11 | #otechie: # Replace with a single Otechie username 12 | custom: https://www.paypal.com/donate/?hosted_button_id=FQL59C749A78L 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report---problem.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report / Problem 3 | about: Create a report to help us improve and help you 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | 12 | 13 | 14 | **To Reproduce** 15 | 16 | 17 | 1. Go to '...' 18 | 2. Click on '....' 19 | 3. Scroll down to '....' 20 | 4. See error 21 | 22 | **Expected behavior** 23 | 24 | 25 | 26 | **Screenshots** 27 | 28 | 29 | 30 | **ESP3D Firmware:** 31 | 32 | - ESP3D FW version: [e.g. 2.1b4] 33 | - ESP3D-WebUI Version:[e.g. 2.1b14] 34 | - Wifi mode:[e.g. STA/AP] 35 | - Flash method: [Arduino Ide / PlatformIO] 36 | If you build with Arduino: 37 | - Arduino ESP8266 package version: [e.g. 2.5.2] 38 | - Any change done in FW: 39 | 40 | **Target Firmware:** 41 | 42 | 43 | - Name: [e.g. Marlin] 44 | - Version [e.g. 2.0] 45 | 46 | **Board used (please complete the following information):** 47 | 48 | - MCU:[e.g. ESP32] 49 | - Name:[e.g. NodeMCU2s] 50 | - Flash size: [e.g. 4M: 2M/2M] 51 | 52 | **Additional context** 53 | 54 | 56 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Wiki 4 | url: https://github.com/luc-github/ESP3D/wiki 5 | about: The Wiki has lot of informations. 6 | - name: F.A.Q. (Frequent asked questions) 7 | url: https://github.com/luc-github/ESP3D/issues?utf8=%E2%9C%93&q=label%3AFAQ 8 | about: The usual questions / problems meet and their solution 9 | - name: Discord chat 10 | url: https://discord.gg/Z4ujTwE 11 | about: Join the discord for support and discussion. 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[FEATURE REQUEST]" 5 | labels: Feature request 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | 12 | 13 | 14 | **Describe the solution you'd like** 15 | 16 | 17 | 18 | **Describe alternatives you've considered** 19 | 20 | 21 | 22 | **Additional context** 23 | 24 | 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question template 3 | about: Ask your question, if not bug neither feature request, neither an error you 4 | meet. 5 | title: "[Question]" 6 | labels: question 7 | assignees: '' 8 | 9 | --- 10 | 11 | What is your question ? 12 | -------------------------------------------------------------------------------- /.github/ci/build-esp3d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit immediately if a command exits with a non-zero status. 3 | set -e 4 | # Enable the globstar shell option 5 | shopt -s globstar 6 | 7 | #arduino or PlatformIO 8 | target=$1 9 | ide=$2 10 | #bluetooth 11 | #local bt=$3 12 | #authentication 13 | #local auth=$4 14 | #filesystem 15 | #local fs=$5 16 | 17 | 18 | # Make sure we are inside the github workspace 19 | cd $GITHUB_WORKSPACE 20 | #export paths 21 | export PATH="$HOME/arduino_ide:$PATH" 22 | export ARDUINO_IDE_PATH="$HOME/arduino_ide" 23 | if [[ "$ide" == "arduino" ]]; 24 | then 25 | if [[ "$target" == "esp32" ]]; 26 | then 27 | echo "setup for esp32" 28 | fqbn="esp32:esp32:esp32:PartitionScheme=min_spiffs,FlashFreq=80,PSRAM=disabled,CPUFreq=240,FlashMode=qio,FlashSize=4M,DebugLevel=none" 29 | else 30 | echo "setup for esp8266" 31 | sed -i "s/\/\/#define AUTHENTICATION_FEATURE /#define AUTHENTICATION_FEATURE/g" $GITHUB_WORKSPACE/esp3d/config.h 32 | fqbn="esp8266com:esp8266:generic:eesz=4M3M,xtal=160,FlashMode=dio,FlashFreq=40,sdk=nonosdk221,ip=lm2f,dbg=Disabled,vt=flash,exception=disabled,ssl=basic" 33 | 34 | fi 35 | 36 | arduino-builder -hardware "$ARDUINO_IDE_PATH/hardware" -tools "$ARDUINO_IDE_PATH/tools-builder" -tools "$ARDUINO_IDE_PATH/tools" -libraries "$ARDUINO_IDE_PATH/libraries" -fqbn=$fqbn -compile -logger=human -core-api-version=10810 ./esp3d/esp3d.ino 37 | else 38 | platformio run -e esp32dev 39 | platformio run -e esp8266 40 | fi 41 | -------------------------------------------------------------------------------- /.github/ci/final-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit immediately if a command exits with a non-zero status. 3 | set -e 4 | # Enable the globstar shell option 5 | shopt -s globstar 6 | # Make sure we are inside the github workspace 7 | cd $GITHUB_WORKSPACE 8 | echo $STEPS_CONTEXT 9 | step=$1 10 | status=$2 11 | export BODYMESSAGE="$(git log -1 $GITHUB_SHA --pretty="%B")" 12 | export BACKTICK='`'; 13 | export TIMESTAMP=$(date --utc +%FT%TZ); 14 | export GITHUB_ACTOR_NAME="$(git log -1 $GITHUB_SHA --pretty="%aN")"; 15 | export COMMIT_FORMATTED="[$BACKTICK${GITHUB_SHA:0:7}$BACKTICK](https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)"; 16 | 17 | if [[ "$status" == "success" ]]; 18 | then 19 | echo "Success build" 20 | if [ -z "$DISCORD_WEBHOOK_URL" ]; 21 | then 22 | echo "no need bot" 23 | else 24 | curl -v -H User-Agent:bot -H Content-Type:application/json -d '{"avatar_url":"https://pngimg.com/uploads/github/github_PNG90.png","username":"github-action","embeds":[{"author":{"name":"Build #'"$step"' Passed - '"$GITHUB_ACTOR_NAME"'","url":"https://github.com/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'"},"url":"https://github.com/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'","title":"['"$GITHUB_REPOSITORY"':job#'"$GITHUB_RUN_NUMBER"'] ","color":65280,"fields":[{"name":"_ _", "value": "'"$COMMIT_FORMATTED"' - '"$BODYMESSAGE"'"}],"timestamp":"'"$TIMESTAMP"'","footer":{"text":"ESP3D CI"}}]}' $DISCORD_WEBHOOK_URL; 25 | fi 26 | else 27 | echo "Build failed" 28 | if [ -z "$DISCORD_WEBHOOK_URL" ]; 29 | then 30 | echo "no need bot" 31 | else 32 | curl -v -H User-Agent:bot -H Content-Type:application/json -d '{"avatar_url":"https://pngimg.com/uploads/github/github_PNG90.png","username":"github-action","embeds":[{"author":{"name":"Build #'"$step"' Failed - '"$GITHUB_ACTOR_NAME"'","url":"https://github.com/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'"},"url":"https://github.com/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'","title":"['"$GITHUB_REPOSITORY"':job#'"$GITHUB_RUN_NUMBER"'] ","color":16711680,"fields":[{"name":"_ _", "value": "'"$COMMIT_FORMATTED"' - '"$BODYMESSAGE"'"}],"timestamp":"'"$TIMESTAMP"'","footer":{"text":"ESP3D CI"}}]}' $DISCORD_WEBHOOK_URL; 33 | fi 34 | exit 1 35 | fi 36 | 37 | 38 | -------------------------------------------------------------------------------- /.github/ci/install-arduino.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit immediately if a command exits with a non-zero status. 3 | set -e 4 | # Enable the globstar shell option 5 | shopt -s globstar 6 | 7 | wget http://downloads.arduino.cc/arduino-1.8.13-linux64.tar.xz 8 | 9 | tar xf arduino-1.8.13-linux64.tar.xz 10 | 11 | mv arduino-1.8.13 $HOME/arduino_ide 12 | 13 | -------------------------------------------------------------------------------- /.github/ci/install-esp32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit immediately if a command exits with a non-zero status. 3 | set -e 4 | # Enable the globstar shell option 5 | shopt -s globstar 6 | 7 | #install pyserial 8 | echo "Installing Python Serial ..." 9 | pip install pyserial 10 | 11 | echo "Clone esp32 core" 12 | cd $HOME/arduino_ide/hardware 13 | mkdir esp32 14 | cd esp32 15 | git clone -b 1.0.4 https://github.com/espressif/arduino-esp32.git esp32 16 | cd esp32 17 | git submodule update --init 18 | cd tools 19 | python get.py 20 | -------------------------------------------------------------------------------- /.github/ci/install-esp8266.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit immediately if a command exits with a non-zero status. 3 | set -e 4 | # Enable the globstar shell option 5 | shopt -s globstar 6 | 7 | cd $HOME/arduino_ide/hardware 8 | mkdir esp8266com 9 | cd esp8266com 10 | git clone -b 2.5.2 https://github.com/esp8266/Arduino.git esp8266 11 | cd esp8266 12 | git submodule update --init 13 | cd tools 14 | python get.py 15 | -------------------------------------------------------------------------------- /.github/ci/install-platformio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit immediately if a command exits with a non-zero status. 3 | set -e 4 | # Enable the globstar shell option 5 | shopt -s globstar 6 | 7 | pip install -U platformio 8 | platformio update 9 | 10 | -------------------------------------------------------------------------------- /.github/ci/prepare-libs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit immediately if a command exits with a non-zero status. 3 | set -e 4 | # Enable the globstar shell option 5 | shopt -s globstar 6 | ls $HOME 7 | # Make sure we are inside the github workspace 8 | cd $GITHUB_WORKSPACE 9 | cp -r ./libraries/ESP32SSDP $HOME/arduino_ide/libraries/ 10 | cp -r ./libraries/arduinoWebSockets $HOME/arduino_ide/libraries/ 11 | cp -r ./libraries/DHT_sensor_library_for_ESPx $HOME/arduino_ide/libraries/ 12 | cp -r ./libraries/oled-ssd1306 $HOME/arduino_ide/libraries/ 13 | cp -r ./libraries/ESP32NETBIOS $HOME/arduino_ide/libraries/ 14 | 15 | 16 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-stale - https://github.com/probot/stale 2 | 3 | # Number of days of inactivity before an Issue or Pull Request becomes stale 4 | daysUntilStale: 21 5 | 6 | # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. 7 | # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. 8 | daysUntilClose: 3 9 | 10 | # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) 11 | onlyLabels: [] 12 | 13 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable 14 | exemptLabels: 15 | - pinned 16 | - security 17 | - "Under Investigation" 18 | - "Work in progress" 19 | - Planned 20 | - "Feedback Welcome" 21 | 22 | # Set to true to ignore issues in a project (defaults to false) 23 | exemptProjects: false 24 | 25 | # Set to true to ignore issues in a milestone (defaults to false) 26 | exemptMilestones: false 27 | 28 | # Set to true to ignore issues with an assignee (defaults to false) 29 | exemptAssignees: false 30 | 31 | # Label to use when marking as stale 32 | staleLabel: stale 33 | 34 | # Comment to post when marking as stale. Set to `false` to disable 35 | markComment: > 36 | This issue has been automatically marked as stale because it has not had 37 | recent activity. It will be closed if no further activity occurs. Thank you 38 | for your contributions. 39 | # Comment to post when removing the stale label. 40 | unmarkComment: > 41 | This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. 42 | # Comment to post when closing a stale Issue or Pull Request. 43 | closeComment: > 44 | This stale issue has been automatically closed. Thank you for your contributions. 45 | # Limit the number of actions per hour, from 1-30. Default is 30 46 | limitPerRun: 30 47 | 48 | # Limit to only `issues` or `pulls` 49 | only: issues 50 | -------------------------------------------------------------------------------- /.github/workflows/build-ci-2.0.yml: -------------------------------------------------------------------------------- 1 | name: build-ci-2.0 2 | 3 | on: [pull_request, push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Set up Python 3.x 11 | uses: actions/setup-python@v2 12 | with: 13 | python-version: "3.x" 14 | architecture: "x64" 15 | - name: Install Arduino 16 | run: bash ./.github/ci/install-arduino.sh 17 | - name: Install platformIO 18 | run: bash ./.github/ci/install-platformio.sh 19 | - name: Install ESP8266 20 | run: bash ./.github/ci/install-esp8266.sh 21 | - name: Install ESP32 22 | run: bash ./.github/ci/install-esp32.sh 23 | - name: Setup libraries 24 | run: bash ./.github/ci/prepare-libs.sh 25 | - name: Build ESP8266 arduino 26 | id: esp8266_1 27 | run: bash ./.github/ci/build-esp3d.sh esp8266 arduino 28 | continue-on-error: true 29 | - name: Build ESP32 arduino 30 | id: esp32_1 31 | run: bash ./.github/ci/build-esp3d.sh esp32 arduino 32 | continue-on-error: true 33 | - name: Build platformIO 34 | id: pio_1 35 | run: bash ./.github/ci/build-esp3d.sh esp32 pio 36 | continue-on-error: true 37 | - name: Final check 38 | env: 39 | STEPS_CONTEXT: ${{ toJson(steps) }} 40 | DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} 41 | if: steps.esp8266_1.outcome == 'failure' || steps.esp32_1.outcome == 'failure' 42 | run: bash ./.github/ci/final-check.sh "$GITHUB_RUN_ID" "failure" 43 | - name: Final confirmation 44 | env: 45 | DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} 46 | if: steps.esp8266_1.outcome == 'success' && steps.esp32_1.outcome == 'success' 47 | run: bash ./.github/ci/final-check.sh "$GITHUB_RUN_ID" "success" 48 | -------------------------------------------------------------------------------- /.github/workflows/greetings.yml: -------------------------------------------------------------------------------- 1 | name: Greetings 2 | 3 | on: [pull_request, issues] 4 | 5 | jobs: 6 | greeting: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/first-interaction@v1 10 | with: 11 | repo-token: ${{ secrets.GITHUB_TOKEN }} 12 | issue-message: 'Thank your for submiting, please be sure you followed template or your issue may be dismissed. if you deleted the template it is [here](https://github.com/luc-github/ESP3D/blob/2.1.x/.github/ISSUE_TEMPLATE/bug-report---problem.md)' 13 | pr-message: 'Thank you for your contribution, be patient, review can take a time.' 14 | -------------------------------------------------------------------------------- /.github/workflows/lock.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '0 0 * * *' 6 | 7 | jobs: 8 | lock: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: dessant/lock-threads@v2 12 | with: 13 | github-token: ${{ github.token }} 14 | issue-lock-inactive-days: '10' 15 | issue-exclude-created-before: '' 16 | issue-exclude-labels: 'planned' 17 | issue-lock-labels: 'outdated' 18 | issue-lock-comment: 'This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.' 19 | issue-lock-reason: 'resolved' 20 | pr-lock-inactive-days: '365' 21 | pr-exclude-created-before: '' 22 | pr-exclude-labels: '' 23 | pr-lock-labels: '' 24 | pr-lock-comment: '' 25 | pr-lock-reason: 'resolved' 26 | process-only: 'issues' 27 | -------------------------------------------------------------------------------- /.github/workflows/pr_notif.yml: -------------------------------------------------------------------------------- 1 | name: 'PR Notifications' 2 | 3 | on: 4 | # Trigger the workflow on push or pull request 5 | pull_request: 6 | branches: 7 | - 2.1.x 8 | 9 | jobs: 10 | comment: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/github-script@v6 14 | with: 15 | script: | 16 | github.rest.issues.createComment({ 17 | issue_number: context.issue.number, 18 | owner: context.repo.owner, 19 | repo: context.repo.repo, 20 | body: 'This branch does not take new feature, only bugfix, if your PR is a new feature please push it to 3.0 instead, thank you' 21 | }) 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | .DS_Store 3 | *.orig 4 | embedded/node_modules 5 | embedded/dist 6 | .pio 7 | .pioenvs 8 | .piolibdeps 9 | .vscode/.browse.c_cpp.db* 10 | .vscode/c_cpp_properties.json 11 | .vscode/launch.json 12 | esp3d/myconfig.h 13 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ESP3D-WEBUI"] 2 | path = ESP3D-WEBUI 3 | url = https://github.com/luc-github/ESP3D-WEBUI 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide", 6 | "DavidAnson.vscode-markdownlint", 7 | "shd101wyy.markdown-preview-enhanced", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "PlatformIO", 8 | "task": "Build (esp8266)", 9 | "problemMatcher": [ 10 | "$platformio" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /Changelog.txt: -------------------------------------------------------------------------------- 1 | ## What's Changed 2 | 3 | # Updates 4 | * Update CI to use github-actions instead of Travis 5 | * Update platformio.ini to support more features 6 | * Create wiki source directory and github-action to sync with wiki 7 | * Add ESP01S in platformIO thanks @padcom 8 | * Added support for IFTTT Webhook integration thanks @KingBain 9 | 10 | # Fixes 11 | * Fix compilation issues with esp32 core 1.0.5 12 | * Fix wrong detection of [ESPXXX]Command if used in macro or web command and sent to printer using M118 13 | * Fix warnings in updater only mode 14 | * Fix several warnings in code and libs 15 | * Fix typo in pushError function (wrong type) 16 | 17 | # Wiki / Documentation / Readme 18 | * Add connection diagram for weedo tina2 thanks @atsju 19 | * Add recommended extensions for easier linting thanks @atsju 20 | * Update feature request template thanks @atsju 21 | * Update Wiki / Readme thanks @atsju 22 | * Update Readme thanks @jschwalbe 23 | * Update funding methods 24 | * Update chat from gitter to discord 25 | * Update index.html.gz (use english mono language) 26 | 27 | **Full Changelog**: https://github.com/luc-github/ESP3D/compare/v2.1.1...v2.1.2 -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y8FFE7NA4LJWQ 2 | -------------------------------------------------------------------------------- /embedded/build.bat: -------------------------------------------------------------------------------- 1 | cd %~dp0 2 | cmd.exe /c npm install 3 | cmd.exe /c gulp package 4 | cmd.exe /c bin2c -o nofile.h -m tool.html.gz 5 | cat header.txt > out.h 6 | cat nofile.h >> out.h 7 | cat footer.txt >> out.h 8 | sed -i "s/tool_html_gz_size/PAGE_NOFILES_SIZE/g" ./out.h 9 | sed -i "s/const unsigned char tool_html_gz/const char PAGE_NOFILES/g" ./out.h 10 | sed -i "s/] = {/] PROGMEM = {/g" ./out.h 11 | cat out.h > nofile.h 12 | cat out.h > ../esp3d/nofile.h 13 | rm -f out.h 14 | pause 15 | -------------------------------------------------------------------------------- /embedded/footer.txt: -------------------------------------------------------------------------------- 1 | #endif //__nofile_h 2 | -------------------------------------------------------------------------------- /embedded/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'), 2 | jshint = require('gulp-jshint'), 3 | gulpif = require('gulp-if'), 4 | concat = require('gulp-concat'), 5 | uglify = require('gulp-uglify'), 6 | cleanCSS = require('gulp-clean-css'), 7 | removeCode = require('gulp-remove-code'), 8 | merge = require('merge-stream'), 9 | del = require('del'), 10 | zip = require('gulp-zip'), 11 | gzip = require('gulp-gzip'), 12 | htmlmin = require('gulp-htmlmin'), 13 | replace = require('gulp-replace'), 14 | fs = require('fs'), 15 | smoosher = require('gulp-smoosher'); 16 | 17 | var demoMode = false; 18 | var testMode = false; 19 | 20 | function clean() { 21 | return del(['dist']); 22 | } 23 | 24 | function clean2() { 25 | return del(['dist/js', 'dist/css']); 26 | } 27 | function lint() { 28 | return gulp.src('www/js/**/script.js') 29 | .pipe(jshint()) 30 | .pipe(jshint.reporter('default')); 31 | } 32 | 33 | function Copytest() { 34 | return merge( 35 | gulp.src(['www/tool.html']) 36 | .pipe(removeCode({production: false})) 37 | .pipe(gulp.dest('dist')), 38 | gulp.src(['www/images/**/*.*']) 39 | .pipe(gulp.dest('dist/images')) 40 | ) 41 | } 42 | 43 | function Copy() { 44 | return merge( 45 | gulp.src(['www/tool.html']) 46 | .pipe(removeCode({production: true})) 47 | .pipe(gulp.dest('dist')), 48 | gulp.src(['www/images/**/*.*']) 49 | .pipe(gulp.dest('dist/images')) 50 | ) 51 | } 52 | 53 | function concatApptest() { 54 | return merge( 55 | gulp.src([ 'www/js/**/*.js']) 56 | .pipe(concat('script.js')) 57 | .pipe(removeCode({production: false})) 58 | .pipe(gulp.dest('./dist/js')), 59 | 60 | gulp.src([ 'www/css/**/*.css']) 61 | .pipe(concat('style.css')) 62 | .pipe(gulp.dest('./dist/css/')) 63 | ) 64 | } 65 | 66 | function concatApp() { 67 | return merge( 68 | gulp.src([ 'www/js/**/*.js']) 69 | .pipe(concat('script.js')) 70 | .pipe(removeCode({production: true})) 71 | .pipe(gulp.dest('./dist/js')), 72 | 73 | gulp.src([ 'www/css/**/*.css']) 74 | .pipe(concat('style.css')) 75 | .pipe(gulp.dest('./dist/css/')) 76 | ) 77 | } 78 | 79 | function minifyApp() { 80 | return merge( 81 | gulp.src(['dist/js/script.js']) 82 | .pipe(uglify({mangle: true})) 83 | .pipe(gulp.dest('./dist/js/')), 84 | 85 | gulp.src('dist/css/style.css') 86 | .pipe(cleanCSS({debug: true}, function(details) { 87 | console.log(details.name + ': ' + details.stats.originalSize); 88 | console.log(details.name + ': ' + details.stats.minifiedSize); 89 | })) 90 | .pipe(gulp.dest('./dist/css/')), 91 | 92 | gulp.src('dist/tool.html') 93 | .pipe(htmlmin({collapseWhitespace: true, minifyCSS: true})) 94 | .pipe(gulp.dest('dist')) 95 | ) 96 | } 97 | 98 | function smoosh() { 99 | return gulp.src('dist/tool.html') 100 | .pipe(smoosher()) 101 | .pipe(gulp.dest('dist')) 102 | } 103 | 104 | function compress() { 105 | return gulp.src('dist/tool.html') 106 | .pipe(gzip()) 107 | .pipe(gulp.dest('.')); 108 | } 109 | 110 | gulp.task(clean); 111 | gulp.task(lint); 112 | gulp.task(Copy); 113 | gulp.task(Copytest); 114 | gulp.task(concatApp); 115 | gulp.task(concatApptest); 116 | gulp.task(minifyApp); 117 | gulp.task(smoosh); 118 | gulp.task(clean2); 119 | 120 | var defaultSeries = gulp.series(clean, lint, Copy, concatApp, smoosh); 121 | var packageSeries = gulp.series(clean, lint, Copy, concatApp,minifyApp, smoosh, compress, clean2); 122 | 123 | gulp.task('default', defaultSeries); 124 | gulp.task('package', packageSeries); 125 | 126 | -------------------------------------------------------------------------------- /embedded/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | nofile.h - ESP3D data file 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | //data generated by https://github.com/AraHaan/bin2c 22 | //bin2c Conversion Tool v0.14.0 - Windows - [FINAL]. 23 | #ifndef __nofile_h 24 | #define __nofile_h 25 | -------------------------------------------------------------------------------- /embedded/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "embedded4ESP3D", 3 | "description": "Embedded files for ESP3D", 4 | "devDependencies": { 5 | "del": "latest", 6 | "deprecated": "latest", 7 | "fs": "latest", 8 | "gulp": "^4.0.0", 9 | "gulp-bytediff": "latest", 10 | "gulp-cdnizer": "latest", 11 | "gulp-clean-css": "latest", 12 | "gulp-concat": "latest", 13 | "gulp-gzip": "latest", 14 | "gulp-htmlmin": "latest", 15 | "gulp-if": "latest", 16 | "gulp-jshint": "latest", 17 | "gulp-ng-annotate": "latest", 18 | "gulp-remove-code": "latest", 19 | "gulp-replace": "latest", 20 | "gulp-smoosher": "latest", 21 | "gulp-uglify": "latest", 22 | "gulp-zip": "latest", 23 | "jshint": "latest", 24 | "merge-stream": "latest" 25 | }, 26 | "repository": "https://github.com/luc-github/ESP3D", 27 | "author": "Luc LEBOSSE", 28 | "license": "(ISC OR GPL-3.0)" 29 | } 30 | -------------------------------------------------------------------------------- /embedded/tool.html.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/embedded/tool.html.gz -------------------------------------------------------------------------------- /esp3d/asyncwebserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | asyncwebserver.h - ESP3D sync functions file 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef ASYNCWEBSERVER_H 22 | #define ASYNCWEBSERVER_H 23 | #include "config.h" 24 | class AsyncWebServerRequest; 25 | 26 | extern bool filterOnRoot (AsyncWebServerRequest *request); 27 | extern void handle_login(AsyncWebServerRequest *request); 28 | extern void SPIFFSFileupload (AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final); 29 | extern void handleFileList (AsyncWebServerRequest *request); 30 | extern void handle_not_found (AsyncWebServerRequest *request); 31 | extern void handle_web_command (AsyncWebServerRequest *request); 32 | extern void handle_web_command_silent (AsyncWebServerRequest *request); 33 | extern void handle_serial_SDFileList (AsyncWebServerRequest *request); 34 | extern void SDFile_serial_upload (AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final); 35 | extern void handle_Websocket_Event(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len); 36 | extern void handle_onevent_connect(AsyncEventSourceClient *client); 37 | extern bool can_process_serial; 38 | 39 | #ifdef SSDP_FEATURE 40 | extern void handle_SSDP (AsyncWebServerRequest *request); 41 | #endif 42 | 43 | #ifdef WEB_UPDATE_FEATURE 44 | extern void handleUpdate (AsyncWebServerRequest *request); 45 | extern void WebUpdateUpload (AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final); 46 | #endif 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /esp3d/command.h: -------------------------------------------------------------------------------- 1 | /* 2 | command.h - ESP3D configuration class 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef COMMAND_h 22 | #define COMMAND_h 23 | #include 24 | #include "espcom.h" 25 | 26 | 27 | class COMMAND 28 | { 29 | public: 30 | static String buffer_serial; 31 | static String buffer_tcp; 32 | static void read_buffer_serial (uint8_t *b, size_t len); 33 | static void read_buffer_serial (uint8_t b); 34 | #ifdef TCP_IP_DATA_FEATURE 35 | static void read_buffer_tcp (uint8_t b); 36 | #endif 37 | static bool check_command (String buffer, tpipe output, bool handlelockserial = true, bool executecmd = true); 38 | static bool execute_command (int cmd, String cmd_params, tpipe output, level_authenticate_type auth_level = LEVEL_GUEST, ESPResponseStream *espresponse = NULL); 39 | static String get_param (String & cmd_params, const char * id, bool withspace = false); 40 | static bool isadmin (String & cmd_params); 41 | static bool isuser (String & cmd_params); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /esp3d/data/404.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 404 page 4 | 5 | 6 |
7 |

8 | 9 | 10 | 11 | 12 | 404 Error, unknown page!

13 |

What are you doing here ?

14 | You are not supposed to find this location... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /esp3d/data/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/esp3d/data/favicon.ico -------------------------------------------------------------------------------- /esp3d/data/index.html.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/esp3d/data/index.html.gz -------------------------------------------------------------------------------- /esp3d/esp3d.h: -------------------------------------------------------------------------------- 1 | /* 2 | esp3d.h - esp3d class 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef ESP3D_H 22 | #define ESP3D_H 23 | //be sure correct IDE and settings are used for ESP8266 or ESP32 24 | #if !(defined( ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)) 25 | #error Oops! Make sure you have 'ESP8266 or ESP32' compatible board selected from the 'Tools -> Boards' menu. 26 | #endif 27 | 28 | #include "Arduino.h" 29 | class Esp3D 30 | { 31 | public: 32 | Esp3D(); 33 | void begin(uint16_t startdelayms = 8000, uint16_t recoverydelayms = 8000); 34 | void process(); 35 | }; 36 | #endif 37 | -------------------------------------------------------------------------------- /esp3d/esp3d.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ESP3D 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | //library include 21 | #include "esp3d.h" 22 | 23 | //global variable 24 | Esp3D myesp3d; 25 | 26 | //Setup 27 | void setup() 28 | { 29 | myesp3d.begin(); 30 | } 31 | 32 | //main loop 33 | void loop() 34 | { 35 | myesp3d.process(); 36 | } 37 | -------------------------------------------------------------------------------- /esp3d/esp_oled.h: -------------------------------------------------------------------------------- 1 | /* 2 | esp_oled.h - ESP3D oled class 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef ESP_OLED_H 22 | #define ESP_OLED_H 23 | #include "config.h" 24 | #ifdef ESP_OLED_FEATURE 25 | class OLED_DISPLAY 26 | { 27 | public: 28 | static void begin(); 29 | static void setCursor(int col, int row = -1); 30 | static void print(String & s); 31 | static void print(const char * s); 32 | static void display_signal( int value, int x=86, int y=0); 33 | static void display_text(const char * txt, int x=0, int y=48, int max=128); 34 | static void display_progress(int value, int x=0, int y=48); 35 | static void display_mini_progress(int value, int x = 14, int y=61, int w=100); 36 | static void update_lcd(); 37 | static void clear_lcd(); 38 | static void splash(); 39 | static String L0; 40 | static String L1; 41 | static String L2; 42 | static String L3; 43 | static int L0_size; 44 | static int L1_size; 45 | static int L2_size; 46 | static int L3_size; 47 | private: 48 | static int col; 49 | static int row; 50 | 51 | 52 | }; 53 | #endif 54 | #endif 55 | -------------------------------------------------------------------------------- /esp3d/espcom.h: -------------------------------------------------------------------------------- 1 | /* 2 | espcom.h - esp3d communication serial/tcp/etc... class 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef ESPCOM_H 22 | #define ESPCOM_H 23 | #include 24 | #include "config.h" 25 | #ifdef TCP_IP_DATA_FEATURE 26 | extern WiFiServer * data_server; 27 | #endif 28 | 29 | class ESPCOM 30 | { 31 | public: 32 | static size_t write(tpipe output, uint8_t d); 33 | static long readBytes (tpipe output, uint8_t * sbuf, size_t len); 34 | static long baudRate(tpipe output); 35 | static size_t available(tpipe output); 36 | static void flush(tpipe output, ESPResponseStream *espresponse = NULL); 37 | static void bridge(bool async = false); 38 | static bool processFromSerial (bool async = false); 39 | static void print (const __FlashStringHelper *data, tpipe output, ESPResponseStream *espresponse = NULL); 40 | static void print (String & data, tpipe output, ESPResponseStream *espresponse = NULL); 41 | static void print (const char * data, tpipe output, ESPResponseStream *espresponse = NULL); 42 | static void println (const __FlashStringHelper *data, tpipe output, ESPResponseStream *espresponse = NULL); 43 | static void println (String & data, tpipe output, ESPResponseStream *espresponse = NULL); 44 | static void println (const char * data, tpipe output, ESPResponseStream *espresponse = NULL); 45 | static uint8_t current_socket_id; 46 | #ifdef TCP_IP_DATA_FEATURE 47 | static void processFromTCP2Serial(); 48 | static void send2TCP (const __FlashStringHelper *data, bool async = false); 49 | static void send2TCP (String data, bool async = false); 50 | static void send2TCP (const char * data, bool async = false); 51 | #endif 52 | static bool block_2_printer; 53 | #ifdef ESP_OLED_FEATURE 54 | static bool block_2_oled; 55 | #endif 56 | }; 57 | #endif 58 | -------------------------------------------------------------------------------- /esp3d/notifications_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | notifications_service.h - notifications service functions class 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | 22 | 23 | #ifndef _NOTIFICATIONS_SERVICE_H 24 | #define _NOTIFICATIONS_SERVICE_H 25 | 26 | 27 | class NotificationsService 28 | { 29 | public: 30 | NotificationsService(); 31 | ~NotificationsService(); 32 | bool begin(); 33 | void end(); 34 | void handle(); 35 | bool sendMSG(const char * title, const char * message); 36 | const char * getTypeString(); 37 | bool started(); 38 | bool isAutonotification() { return _autonotification;}; 39 | void setAutonotification(bool value) { _autonotification = value;}; 40 | bool sendAutoNotification(const char * msg); 41 | private: 42 | bool _started; 43 | uint8_t _notificationType; 44 | bool _autonotification; 45 | String _token1; 46 | String _token2; 47 | String _settings; 48 | String _serveraddress; 49 | uint16_t _port; 50 | bool sendPushoverMSG(const char * title, const char * message); 51 | bool sendEmailMSG(const char * title, const char * message); 52 | bool sendLineMSG(const char * title, const char * message); 53 | bool sendIFTTTMSG(const char * title, const char * message); 54 | bool getPortFromSettings(); 55 | bool getServerAddressFromSettings(); 56 | bool getEmailFromSettings(); 57 | }; 58 | 59 | extern NotificationsService notificationsservice; 60 | 61 | #endif //_NOTIFICATIONS_SERVICE_H 62 | 63 | -------------------------------------------------------------------------------- /esp3d/syncwebserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | syncwebserver.h - ESP3D sync functions file 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SYNCWEBSERVER_H 22 | #define SYNCWEBSERVER_H 23 | #include "config.h" 24 | #define NODEBUG_WEBSOCKETS 25 | #include 26 | 27 | extern void handle_web_interface_root(); 28 | extern void handle_login(); 29 | extern void handleFileList(); 30 | extern void SPIFFSFileupload(); 31 | extern void handle_not_found(); 32 | extern void handle_web_command(); 33 | extern void handle_web_command_silent(); 34 | extern void handle_serial_SDFileList(); 35 | extern void SDFile_serial_upload(); 36 | extern WebSocketsServer * socket_server; 37 | extern void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length); 38 | 39 | #ifdef SSDP_FEATURE 40 | extern void handle_SSDP (); 41 | #endif 42 | 43 | #ifdef WEB_UPDATE_FEATURE 44 | extern void handleUpdate (); 45 | extern void WebUpdateUpload (); 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /esp3d/webinterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | webinterface.h - ESP3D configuration class 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef WEBINTERFACE_h 22 | #define WEBINTERFACE_h 23 | #include 24 | #include 25 | #include 26 | #ifndef FS_NO_GLOBALS 27 | #define FS_NO_GLOBALS 28 | #endif 29 | #include 30 | #if defined(ASYNCWEBSERVER) 31 | #include 32 | #endif 33 | #ifdef ARDUINO_ARCH_ESP8266 34 | #if defined(ASYNCWEBSERVER) 35 | #include 36 | #else 37 | #include 38 | #endif 39 | #else //ESP32 40 | #if defined(ASYNCWEBSERVER) 41 | #include 42 | #else 43 | #include 44 | #endif 45 | #endif 46 | 47 | 48 | struct auth_ip { 49 | IPAddress ip; 50 | level_authenticate_type level; 51 | char userID[17]; 52 | char sessionID[17]; 53 | uint32_t last_time; 54 | auth_ip * _next; 55 | }; 56 | 57 | class WEBINTERFACE_CLASS 58 | { 59 | public: 60 | WEBINTERFACE_CLASS (int port = 80); 61 | ~WEBINTERFACE_CLASS(); 62 | #if defined(ASYNCWEBSERVER) 63 | AsyncWebServer web_server; 64 | AsyncEventSource web_events; 65 | #else 66 | #ifdef ARDUINO_ARCH_ESP8266 67 | ESP8266WebServer web_server; 68 | #else 69 | WebServer web_server; 70 | #endif 71 | #endif 72 | #ifdef WS_DATA_FEATURE 73 | #if defined(ASYNCWEBSERVER) 74 | AsyncWebSocket web_socket; 75 | #endif 76 | #endif 77 | bool restartmodule; 78 | String getContentType (String filename); 79 | level_authenticate_type is_authenticated(); 80 | bool AddAuthIP (auth_ip * item); 81 | bool blockserial; 82 | #ifdef AUTHENTICATION_FEATURE 83 | level_authenticate_type ResetAuthIP (IPAddress ip, const char * sessionID); 84 | auth_ip * GetAuth (IPAddress ip, const char * sessionID); 85 | bool ClearAuthIP (IPAddress ip, const char * sessionID); 86 | char * create_session_ID(); 87 | #endif 88 | uint8_t _upload_status; 89 | 90 | private: 91 | auth_ip * _head; 92 | uint8_t _nb_ip; 93 | }; 94 | 95 | extern WEBINTERFACE_CLASS * web_interface; 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /esp3d/wificonf.h: -------------------------------------------------------------------------------- 1 | /* 2 | wificonf.h - ESP3D configuration class 3 | 4 | Copyright (c) 2014 Luc Lebosse. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef WIFICONF_H 22 | #define WIFICONF_H 23 | #include 24 | #include "config.h" 25 | #include "IPAddress.h" 26 | #ifdef ARDUINO_ARCH_ESP8266 27 | #include "ESP8266WiFi.h" 28 | #ifdef MDNS_FEATURE 29 | #include 30 | #endif 31 | #else 32 | #include 33 | #ifdef MDNS_FEATURE 34 | #include 35 | #endif 36 | #endif 37 | 38 | class WIFI_CONFIG 39 | { 40 | public: 41 | // multicast DNS responder feature 42 | #ifdef MDNS_FEATURE 43 | MDNSResponder mdns; 44 | #endif 45 | bool WiFi_on; 46 | WIFI_CONFIG(); 47 | int iweb_port; 48 | int idata_port; 49 | long baud_rate; 50 | int sleep_mode; 51 | int32_t getSignal (int32_t RSSI); 52 | bool Setup (bool force_ap = false); 53 | void Safe_Setup(); 54 | bool Enable_servers(); 55 | bool Disable_servers(); 56 | const char * get_default_hostname(); 57 | const char * get_hostname(); 58 | private: 59 | char _hostname[33]; 60 | }; 61 | 62 | extern WIFI_CONFIG wifi_config; 63 | #endif 64 | -------------------------------------------------------------------------------- /extra-files/Files/404.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 404 page 4 | 5 | 6 |
7 |

8 | 9 | 10 | 11 | 12 | 404 Error, unknown page!

13 |

What are you doing here ?

14 | You are not supposed to find this location... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /extra-files/Files/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/extra-files/Files/favicon.ico -------------------------------------------------------------------------------- /extra-files/Readme.txt: -------------------------------------------------------------------------------- 1 | Commands.txt list all ESP commands 2 | wconfig.txt list all parameters for SD file config 3 | flash.docx explain how to flash 4 | Files directory contain all files needed by ESP3D 5 | - index.html.gz // main ui file (mandatory) 6 | - 404.htm // custom 404 page (optional) 7 | - favicon.ico //custom browser esp3D icon (optional) 8 | - macrocfg.json //macro command file (optional) 9 | -------------------------------------------------------------------------------- /images/ESP3D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/ESP3D.png -------------------------------------------------------------------------------- /images/ESP3D72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/ESP3D72x72.png -------------------------------------------------------------------------------- /images/ESP3D_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/ESP3D_logo.png -------------------------------------------------------------------------------- /images/ESP3D_logo.xbm: -------------------------------------------------------------------------------- 1 | #define 24492_08e7f436e954e7f1ed7eff63a870aa37567172e29246c9e6fe97e69381c68eb6_width 60 2 | #define 24492_08e7f436e954e7f1ed7eff63a870aa37567172e29246c9e6fe97e69381c68eb6_height 45 3 | static char 24492_08e7f436e954e7f1ed7eff63a870aa37567172e29246c9e6fe97e69381c68eb6_bits[] = { 4 | 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 5 | 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 7 | 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 8 | 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x28, 0x49, 9 | 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0B, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 11 | 0x3F, 0x00, 0x78, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x80, 0x00, 12 | 0xF8, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x01, 0xFC, 0xFF, 0xFF, 0xFF, 13 | 0x01, 0x00, 0x00, 0x02, 0xFE, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x04, 14 | 0xFE, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x04, 0x07, 0x1C, 0x1C, 0xF0, 15 | 0xF0, 0xC3, 0x0F, 0x08, 0x03, 0x8C, 0x18, 0x60, 0xF8, 0xE3, 0x3F, 0x08, 16 | 0xE3, 0xCF, 0x1F, 0x67, 0x00, 0xC7, 0x70, 0x08, 0xE7, 0xC7, 0x9F, 0xC7, 17 | 0x00, 0xE7, 0x70, 0x08, 0xE7, 0x0F, 0x1F, 0x47, 0x80, 0xE3, 0xE0, 0x08, 18 | 0x03, 0x0E, 0x1E, 0xE3, 0xF0, 0xC3, 0xE0, 0x08, 0x07, 0x3E, 0x18, 0x60, 19 | 0xF0, 0xE3, 0xE0, 0x08, 0xE3, 0xFF, 0x18, 0xF8, 0x00, 0xC7, 0xE0, 0x08, 20 | 0xE3, 0xFF, 0x39, 0x7F, 0x00, 0xC7, 0xE0, 0x08, 0xE7, 0xFF, 0x18, 0xFF, 21 | 0x00, 0xE7, 0x70, 0x08, 0x87, 0x46, 0x18, 0x7F, 0x98, 0xE7, 0x7E, 0x08, 22 | 0x03, 0x0C, 0x1C, 0x7F, 0xF8, 0xC3, 0x1F, 0x08, 0x7F, 0xBF, 0xFF, 0x7F, 23 | 0xE0, 0x40, 0x05, 0x08, 0xFE, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x04, 24 | 0xFE, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x04, 0xFC, 0xFF, 0xFF, 0x1F, 25 | 0x00, 0x00, 0x00, 0x02, 0xF8, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x03, 26 | 0xF0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x80, 0x00, 0xE0, 0xFF, 0xFF, 0x01, 27 | 0x00, 0x00, 0x70, 0x00, 0x00, 0xE7, 0x7F, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x41, 0x44, 29 | 0x44, 0x02, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 30 | 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 31 | 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x03, 0x00, 0x00, 32 | 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 33 | 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0x00, 34 | }; 35 | -------------------------------------------------------------------------------- /images/ESP3D_logo2.xbm: -------------------------------------------------------------------------------- 1 | #define ed73b8558cdc4f29ad54ffaa5f71fc67_width 62 2 | #define ed73b8558cdc4f29ad54ffaa5f71fc67_height 45 3 | static char ed73b8558cdc4f29ad54ffaa5f71fc67_bits[] = { 4 | 0x00, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 5 | 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x01, 0x00, 0x00, 6 | 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 7 | 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 8 | 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 9 | 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 11 | 0xFF, 0x00, 0xE0, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x80, 0x01, 12 | 0xF0, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 13 | 0x07, 0x00, 0x00, 0x06, 0xFC, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x0C, 14 | 0x0C, 0x7C, 0x78, 0xC0, 0xC1, 0xC1, 0x0F, 0x18, 0x06, 0x38, 0x60, 0x80, 15 | 0xE1, 0xC3, 0x3F, 0x10, 0xC6, 0x19, 0x67, 0x1C, 0xF1, 0xC7, 0x7F, 0x10, 16 | 0xC6, 0x1F, 0x7F, 0x3C, 0x31, 0xCF, 0xF1, 0x10, 0xC7, 0x1F, 0x7F, 0x3C, 17 | 0x01, 0xCE, 0xE1, 0x20, 0xC7, 0x3F, 0x7E, 0x1C, 0x01, 0xC7, 0xC1, 0x21, 18 | 0x07, 0x3C, 0x78, 0x80, 0xE1, 0xC3, 0xC1, 0x21, 0x07, 0xFC, 0x70, 0xC0, 19 | 0xE1, 0xC7, 0xC1, 0x21, 0xC7, 0xFF, 0x63, 0xFC, 0x01, 0xCF, 0xC1, 0x21, 20 | 0xC7, 0xFF, 0x63, 0xFC, 0x01, 0xCE, 0xC1, 0x21, 0xC7, 0xDF, 0x63, 0xFC, 21 | 0x01, 0xCE, 0xE1, 0x20, 0xC6, 0x99, 0x73, 0xFC, 0x31, 0xCF, 0x7F, 0x10, 22 | 0x06, 0x18, 0x70, 0xFC, 0xF0, 0xC7, 0x3F, 0x10, 0x0E, 0x78, 0x78, 0xFC, 23 | 0xE0, 0xC3, 0x0F, 0x10, 0xFC, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x18, 24 | 0xFC, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x0C, 0xF8, 0xFF, 0xFF, 0x3F, 25 | 0x00, 0x00, 0x00, 0x06, 0xF0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x03, 26 | 0xE0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x80, 0x01, 0xC0, 0xFF, 0xFF, 0x03, 27 | 0x00, 0x00, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 29 | 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 30 | 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 31 | 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x07, 0x00, 0x00, 32 | 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 33 | 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0x00, 34 | }; 35 | -------------------------------------------------------------------------------- /images/ESP3D_social.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/ESP3D_social.png -------------------------------------------------------------------------------- /images/UI/Page1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page1.png -------------------------------------------------------------------------------- /images/UI/Page2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page2.png -------------------------------------------------------------------------------- /images/UI/Page3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page3.png -------------------------------------------------------------------------------- /images/UI/Page4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page4.png -------------------------------------------------------------------------------- /images/UI/Page5-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page5-2.png -------------------------------------------------------------------------------- /images/UI/Page6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page6.png -------------------------------------------------------------------------------- /images/UI/Page7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page7.png -------------------------------------------------------------------------------- /images/UI/Page8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/Page8.png -------------------------------------------------------------------------------- /images/UI/files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/files.png -------------------------------------------------------------------------------- /images/UI/page5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/UI/page5.png -------------------------------------------------------------------------------- /images/docs/embedded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/docs/embedded.png -------------------------------------------------------------------------------- /images/sponsors-supporters/FYSETC/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/sponsors-supporters/FYSETC/LOGO.png -------------------------------------------------------------------------------- /images/sponsors-supporters/PanucattDevices/Panucatt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/sponsors-supporters/PanucattDevices/Panucatt.jpg -------------------------------------------------------------------------------- /images/sponsors-supporters/patrickS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/sponsors-supporters/patrickS.png -------------------------------------------------------------------------------- /images/sponsors-supporters/sponsor.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/images/sponsors-supporters/sponsor.PNG -------------------------------------------------------------------------------- /libraries/AsyncTCP/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: bash 3 | os: 4 | - linux 5 | 6 | script: 7 | - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 8 | - sleep 3 9 | - export DISPLAY=:1.0 10 | - wget http://downloads.arduino.cc/arduino-1.6.5-linux64.tar.xz 11 | - tar xf arduino-1.6.5-linux64.tar.xz 12 | - mv arduino-1.6.5 $HOME/arduino_ide 13 | - export PATH="$HOME/arduino_ide:$PATH" 14 | - which arduino 15 | - mkdir -p $HOME/Arduino/libraries 16 | - cp -r $TRAVIS_BUILD_DIR $HOME/Arduino/libraries/ESPAsyncTCP 17 | - cd $HOME/arduino_ide/hardware 18 | - mkdir esp8266com 19 | - cd esp8266com 20 | - git clone https://github.com/esp8266/Arduino.git esp8266 21 | - cd esp8266/tools 22 | - python get.py 23 | - source $TRAVIS_BUILD_DIR/travis/common.sh 24 | - arduino --board esp8266com:esp8266:generic --save-prefs 25 | - arduino --get-pref sketchbook.path 26 | - build_sketches arduino $HOME/Arduino/libraries/ESPAsyncTCP esp8266 27 | 28 | notifications: 29 | email: 30 | on_success: change 31 | on_failure: change 32 | webhooks: 33 | urls: 34 | - https://webhooks.gitter.im/e/60e65d0c78ea0a920347 35 | on_success: change # options: [always|never|change] default: always 36 | on_failure: always # options: [always|never|change] default: always 37 | on_start: false # default: false 38 | -------------------------------------------------------------------------------- /libraries/AsyncTCP/README.md: -------------------------------------------------------------------------------- 1 | # AsyncTCP 2 | Async TCP Library for ESP32 Arduino 3 | 4 | [![Join the chat at https://gitter.im/me-no-dev/ESPAsyncWebServer](https://badges.gitter.im/me-no-dev/ESPAsyncWebServer.svg)](https://gitter.im/me-no-dev/ESPAsyncWebServer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | 6 | This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP32 MCUs. 7 | 8 | This library is the base for [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) 9 | 10 | ## AsyncClient and AsyncServer 11 | The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use. 12 | -------------------------------------------------------------------------------- /libraries/AsyncTCP/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := src 2 | COMPONENT_SRCDIRS := src 3 | CXXFLAGS += -fno-rtti 4 | -------------------------------------------------------------------------------- /libraries/AsyncTCP/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"AsyncTCP", 3 | "description":"Asynchronous TCP Library for ESP32", 4 | "keywords":"async,tcp", 5 | "authors": 6 | { 7 | "name": "Hristo Gochkov", 8 | "maintainer": true 9 | }, 10 | "repository": 11 | { 12 | "type": "git", 13 | "url": "https://github.com/me-no-dev/AsyncTCP.git" 14 | }, 15 | "version": "1.0.3", 16 | "license": "LGPL-3.0", 17 | "frameworks": "arduino", 18 | "platforms": "espressif32", 19 | "build": { 20 | "libCompatMode": 2 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /libraries/AsyncTCP/library.properties: -------------------------------------------------------------------------------- 1 | name=AsyncTCP 2 | version=1.0.3 3 | author=Me-No-Dev 4 | maintainer=Me-No-Dev 5 | sentence=Async TCP Library for ESP32 6 | paragraph=Async TCP Library for ESP32 7 | category=Other 8 | url=https://github.com/me-no-dev/AsyncTCP 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/AsyncTCP/travis/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function build_sketches() 4 | { 5 | local arduino=$1 6 | local srcpath=$2 7 | local platform=$3 8 | local sketches=$(find $srcpath -name *.ino) 9 | for sketch in $sketches; do 10 | local sketchdir=$(dirname $sketch) 11 | if [[ -f "$sketchdir/.$platform.skip" ]]; then 12 | echo -e "\n\n ------------ Skipping $sketch ------------ \n\n"; 13 | continue 14 | fi 15 | echo -e "\n\n ------------ Building $sketch ------------ \n\n"; 16 | $arduino --verify $sketch; 17 | local result=$? 18 | if [ $result -ne 0 ]; then 19 | echo "Build failed ($1)" 20 | return $result 21 | fi 22 | done 23 | } 24 | -------------------------------------------------------------------------------- /libraries/DHT_sensor_library_for_ESPx/examples/DHT_Multi/DHT_Multi.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "ESP32Ticker.h" 4 | #include "DHTesp.h" 5 | 6 | /** Initialize DHT sensor 1 */ 7 | DHTesp dhtSensor1; 8 | /** Initialize DHT sensor 2 */ 9 | DHTesp dhtSensor2; 10 | /** Initialize DHT sensor 3 */ 11 | DHTesp dhtSensor3; 12 | /** Task handle for the light value read task */ 13 | TaskHandle_t tempTaskHandle = NULL; 14 | /** Pin number for DHT11 1 data pin */ 15 | int dhtPin1 = 17; 16 | /** Pin number for DHT11 2 data pin */ 17 | int dhtPin2 = 16; 18 | /** Pin number for DHT11 3 data pin */ 19 | int dhtPin3 = 27; 20 | /** Ticker for temperature reading */ 21 | Ticker tempTicker; 22 | /** Flags for temperature readings finished */ 23 | bool gotNewTemperature = false; 24 | /** Data from sensor 1 */ 25 | TempAndHumidity sensor1Data; 26 | /** Data from sensor 2 */ 27 | TempAndHumidity sensor2Data; 28 | /** Data from sensor 3 */ 29 | TempAndHumidity sensor3Data; 30 | 31 | /* Flag if main loop is running */ 32 | bool tasksEnabled = false; 33 | 34 | /** 35 | 36 | /** 37 | * Task to reads temperature from DHT11 sensor 38 | * @param pvParameters 39 | * pointer to task parameters 40 | */ 41 | void tempTask(void *pvParameters) { 42 | Serial.println("tempTask loop started"); 43 | while (1) // tempTask loop 44 | { 45 | if (tasksEnabled && !gotNewTemperature) { // Read temperature only if old data was processed already 46 | // Reading temperature for humidity takes about 250 milliseconds! 47 | // Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor) 48 | sensor1Data = dhtSensor1.getTempAndHumidity(); // Read values from sensor 1 49 | sensor2Data = dhtSensor2.getTempAndHumidity(); // Read values from sensor 1 50 | sensor3Data = dhtSensor3.getTempAndHumidity(); // Read values from sensor 1 51 | gotNewTemperature = true; 52 | } 53 | vTaskSuspend(NULL); 54 | } 55 | } 56 | 57 | /** 58 | * triggerGetTemp 59 | * Sets flag dhtUpdated to true for handling in loop() 60 | * called by Ticker tempTicker 61 | */ 62 | void triggerGetTemp() { 63 | if (tempTaskHandle != NULL) { 64 | xTaskResumeFromISR(tempTaskHandle); 65 | } 66 | } 67 | 68 | /** 69 | * Arduino setup function (called once after boot/reboot) 70 | */ 71 | void setup() { 72 | Serial.begin(115200); 73 | Serial.println("Example for 3 DHT11/22 sensors"); 74 | 75 | // Initialize temperature sensor 1 76 | dhtSensor1.setup(dhtPin1, DHTesp::DHT11); 77 | // Initialize temperature sensor 2 78 | dhtSensor2.setup(dhtPin2, DHTesp::DHT11); 79 | // Initialize temperature sensor 3 80 | dhtSensor3.setup(dhtPin3, DHTesp::DHT11); 81 | 82 | // Start task to get temperature 83 | xTaskCreatePinnedToCore( 84 | tempTask, /* Function to implement the task */ 85 | "tempTask ", /* Name of the task */ 86 | 4000, /* Stack size in words */ 87 | NULL, /* Task input parameter */ 88 | 5, /* Priority of the task */ 89 | &tempTaskHandle, /* Task handle. */ 90 | 1); /* Core where the task should run */ 91 | 92 | if (tempTaskHandle == NULL) { 93 | Serial.println("[ERROR] Failed to start task for temperature update"); 94 | } else { 95 | // Start update of environment data every 30 seconds 96 | tempTicker.attach(30, triggerGetTemp); 97 | } 98 | 99 | // Signal end of setup() to tasks 100 | tasksEnabled = true; 101 | } // End of setup. 102 | 103 | 104 | /** 105 | * loop 106 | * Arduino loop function, called once 'setup' is complete (your own code 107 | * should go here) 108 | */ 109 | void loop() { 110 | if (gotNewTemperature) { 111 | Serial.println("Sensor 1 data:"); 112 | Serial.println("Temp: " + String(sensor1Data.temperature,2) + "'C Humidity: " + String(sensor1Data.humidity,1) + "%"); 113 | Serial.println("Sensor 2 data:"); 114 | Serial.println("Temp: " + String(sensor2Data.temperature,2) + "'C Humidity: " + String(sensor2Data.humidity,1) + "%"); 115 | Serial.println("Sensor 3 data:"); 116 | Serial.println("Temp: " + String(sensor3Data.temperature,2) + "'C Humidity: " + String(sensor3Data.humidity,1) + "%"); 117 | gotNewTemperature = false; 118 | } 119 | } // End of loop 120 | -------------------------------------------------------------------------------- /libraries/DHT_sensor_library_for_ESPx/examples/DHT_Test/DHT_Test.ino: -------------------------------------------------------------------------------- 1 | #include "DHTesp.h" 2 | 3 | DHTesp dht; 4 | 5 | void setup() 6 | { 7 | Serial.begin(115200); 8 | Serial.println(); 9 | Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)\tHeatIndex (C)\t(F)"); 10 | 11 | dht.setup(22); // Connect DHT sensor to GPIO 17 12 | } 13 | 14 | void loop() 15 | { 16 | 17 | //delay(dht.getMinimumSamplingPeriod()*1.2); 18 | static uint32_t last_dht_update= 0; 19 | uint32_t now_dht = millis(); 20 | if (now_dht - last_dht_update > dht.getMinimumSamplingPeriod() *1.2) { 21 | last_dht_update = now_dht; 22 | float humidity = dht.getHumidity(); 23 | float temperature = dht.getTemperature(); 24 | 25 | Serial.print(dht.getStatusString()); 26 | Serial.print("\t H:"); 27 | Serial.print(humidity, 1); 28 | Serial.print("%\t\T :"); 29 | Serial.print(temperature, 1); 30 | Serial.println("C\t\t"); 31 | //Serial.print(dht.toFahrenheit(temperature), 1); 32 | //Serial.print("\t\t"); 33 | //Serial.print(dht.computeHeatIndex(temperature, humidity, false), 1); 34 | //Serial.print("\t\t"); 35 | //Serial.println(dht.computeHeatIndex(dht.toFahrenheit(temperature), humidity, true), 1); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /libraries/DHT_sensor_library_for_ESPx/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For DHTesp 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | DHTesp KEYWORD1 10 | TempAndHumidity KEYWORD1 11 | 12 | ####################################### 13 | # Methods and Functions (KEYWORD2) 14 | ####################################### 15 | 16 | setup KEYWORD2 17 | getTemperature KEYWORD2 18 | getHumidity KEYWORD2 19 | getTempAndHumidity KEYWORD2 20 | getStatus KEYWORD2 21 | getStatusString KEYWORD2 22 | getModel KEYWORD2 23 | getMinimumSamplingPeriod KEYWORD2 24 | toFahrenheit KEYWORD2 25 | toCelsius KEYWORD2 26 | computeHeatIndex KEYWORD2 27 | computeDewPoint KEYWORD2 28 | getComfortRatio KEYWORD2 29 | getNumberOfDecimalsTemperature KEYWORD2 30 | getLowerBoundTemperature KEYWORD2 31 | getUpperBoundTemperature KEYWORD2 32 | getNumberOfDecimalsHumidity KEYWORD2 33 | getLowerBoundHumidity KEYWORD2 34 | getUpperBoundHumidity KEYWORD2 35 | getComfortProfile KEYWORD2 36 | setComfortProfile KEYWORD2 37 | isTooHot KEYWORD2 38 | isTooHumid KEYWORD2 39 | isTooCold KEYWORD2 40 | isTooDry KEYWORD2 41 | computePerception KEYWORD2 42 | 43 | ####################################### 44 | # Instances (KEYWORD2) 45 | ####################################### 46 | 47 | 48 | ####################################### 49 | # Constants (LITERAL1) 50 | ####################################### 51 | 52 | AUTO_DETECT LITERAL1 53 | DHT11 LITERAL1 54 | DHT22 LITERAL1 55 | AM2302 LITERAL1 56 | RHT03 LITERAL1 57 | 58 | ERROR_NONE LITERAL1 59 | ERROR_TIMEOUT LITERAL1 60 | ERROR_CHECKSUM LITERAL1 61 | 62 | Comfort_OK LITERAL1 63 | Comfort_TooHot LITERAL1 64 | Comfort_TooCold LITERAL1 65 | Comfort_TooDry LITERAL1 66 | Comfort_TooHumid LITERAL1 67 | Comfort_HotAndHumid LITERAL1 68 | Comfort_HotAndDry LITERAL1 69 | Comfort_ColdAndHumid LITERAL1 70 | Comfort_ColdAndDry LITERAL1 71 | 72 | Perception_Dry LITERAL1 73 | Perception_VeryComfy LITERAL1 74 | Perception_Comfy LITERAL1 75 | Perception_Ok LITERAL1 76 | Perception_UnComfy LITERAL1 77 | Perception_QuiteUnComfy LITERAL1 78 | Perception_UnComfy LITERAL1 79 | Perception_VeryUncomfy LITERAL1 80 | -------------------------------------------------------------------------------- /libraries/DHT_sensor_library_for_ESPx/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DHT sensor library for ESPx", 3 | "keywords": "onewire, 1-wire, bus, sensor, temperature", 4 | "description": "Arduino ESP library for DHT11, DHT22, etc Temp & Humidity Sensors. Last changes: Updated example.", 5 | "repository": 6 | { 7 | "type": "git", 8 | "url": "https://github.com/beegee-tokyo/DHTesp.git" 9 | }, 10 | "version": "1.0.6", 11 | "frameworks": "arduino", 12 | "platforms": "*", 13 | "license": "GPL-3.0-only", 14 | "homepage": "http://desire.giesecke.tk/index.php/2018/01/30/esp32-dht11/" 15 | } 16 | -------------------------------------------------------------------------------- /libraries/DHT_sensor_library_for_ESPx/library.properties: -------------------------------------------------------------------------------- 1 | name=DHT sensor library for ESPx 2 | version=1.0.6 3 | author=beegee_tokyo 4 | maintainer=beegee_tokyo 5 | sentence=Arduino ESP library for DHT11, DHT22, etc Temp & Humidity Sensors 6 | paragraph=Optimized libray to match ESP32 requirements. Last changes: Updated example. 7 | category=Sensors 8 | url=http://desire.giesecke.tk/index.php/2018/01/30/esp32-dht11/ 9 | architectures=esp8266,esp32,arduino-esp32 10 | includes=DHTesp.h 11 | -------------------------------------------------------------------------------- /libraries/ESP32NETBIOS/ESP32NetBIOS.h: -------------------------------------------------------------------------------- 1 | // 2 | #ifndef __ESPNBNS_h__ 3 | #define __ESPNBNS_h__ 4 | 5 | #include 6 | #include 7 | 8 | #define NBNS_PORT 137 9 | /** 10 | * @def NBNS_MAX_HOSTNAME_LEN 11 | * @brief maximalni delka NBNS jmena zarizeni 12 | * @remarks 13 | * Jmeno zarizeni musi byt uvedeno VELKYMI pismenami a nesmi obsahovat mezery (whitespaces). 14 | */ 15 | #define NBNS_MAX_HOSTNAME_LEN 16 16 | 17 | struct udp_pcb; 18 | struct pbuf; 19 | 20 | class ESP32NetBIOS 21 | { 22 | protected: 23 | udp_pcb* _pcb; 24 | char _name[NBNS_MAX_HOSTNAME_LEN + 1]; 25 | void _getnbname(char *nbname, char *name, uint8_t maxlen); 26 | void _makenbname(char *name, char *nbname, uint8_t outlen); 27 | 28 | void _recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t port); 29 | static void _s_recv(void *arg, udp_pcb *upcb, pbuf *p, const ip_addr_t *addr, uint16_t port); 30 | public: 31 | ESP32NetBIOS(); 32 | ~ESP32NetBIOS(); 33 | bool begin(const char *name); 34 | void end(); 35 | }; 36 | 37 | #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_NETBIOS) 38 | extern ESP32NetBIOS NBNS; 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libraries/ESP32NETBIOS/examples/ESP_NBNST/ESP_NBNST.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | const char* ssid = "............"; 6 | const char* password = ".............."; 7 | 8 | WebServer wwwserver(80); 9 | String content; 10 | 11 | static void handleRoot(void) 12 | { 13 | content = F("\nHello world from ESP32"); 14 | content += F("

"); 15 | content += F(""); 16 | 17 | wwwserver.send(200, F("text/html"), content); 18 | } 19 | 20 | void setup() 21 | { 22 | Serial.begin(115200); 23 | 24 | // Connect to WiFi network 25 | WiFi.mode(WIFI_STA); 26 | WiFi.begin(ssid, password); 27 | Serial.println(""); 28 | 29 | // Wait for connection 30 | while (WiFi.status() != WL_CONNECTED) { 31 | delay(500); 32 | Serial.print("."); 33 | } 34 | Serial.println(""); 35 | Serial.print("Connected to "); 36 | Serial.println(ssid); 37 | Serial.print("IP address: "); 38 | Serial.println(WiFi.localIP()); 39 | 40 | 41 | wwwserver.on("/", handleRoot); 42 | wwwserver.begin(); 43 | 44 | NBNS.begin("ESP"); 45 | } 46 | 47 | void loop() 48 | { 49 | wwwserver.handleClient(); 50 | } 51 | -------------------------------------------------------------------------------- /libraries/ESP32NETBIOS/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For ESPNBNS 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | NBNS KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | 17 | ####################################### 18 | # Instances (KEYWORD2) 19 | ####################################### 20 | 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | -------------------------------------------------------------------------------- /libraries/ESP32NETBIOS/library.properties: -------------------------------------------------------------------------------- 1 | name=ESP32NetBIOS 2 | version=1.0 3 | author=Pablo@xpablo.cz 4 | maintainer=Hristo Gochkov 5 | sentence=Enables NBNS (NetBIOS) name resolution. 6 | paragraph=With this library you can connect to your ESP from Windows using a short name 7 | category=Communication 8 | url=http://www.xpablo.cz/?p=751#more-751 9 | architectures=esp32 10 | -------------------------------------------------------------------------------- /libraries/ESP32SSDP/README.rst: -------------------------------------------------------------------------------- 1 | ESP32 Simple Service Discovery Copyright (c) 2015 Hristo Gochkov 2 | Original (Arduino) version by Filippo Sallemi, July 23, 2014. Can be 3 | found at: https://github.com/nomadnt/uSSDP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /libraries/ESP32SSDP/examples/SSDP/SSDP.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | const char* ssid = "********"; 6 | const char* password = "********"; 7 | 8 | WebServer HTTP(80); 9 | 10 | void setup() { 11 | Serial.begin(115200); 12 | Serial.println(); 13 | Serial.println("Starting WiFi..."); 14 | 15 | WiFi.mode(WIFI_STA); 16 | WiFi.begin(ssid, password); 17 | if(WiFi.waitForConnectResult() == WL_CONNECTED){ 18 | 19 | Serial.printf("Starting HTTP...\n"); 20 | HTTP.on("/index.html", HTTP_GET, [](){ 21 | HTTP.send(200, "text/plain", "Hello World!"); 22 | }); 23 | HTTP.on("/description.xml", HTTP_GET, [](){ 24 | SSDP.schema(HTTP.client()); 25 | }); 26 | HTTP.begin(); 27 | 28 | Serial.printf("Starting SSDP...\n"); 29 | SSDP.setSchemaURL("description.xml"); 30 | SSDP.setHTTPPort(80); 31 | SSDP.setName("Philips hue clone"); 32 | SSDP.setSerialNumber("001788102201"); 33 | SSDP.setURL("index.html"); 34 | SSDP.setModelName("Philips hue bridge 2012"); 35 | SSDP.setModelNumber("929000226503"); 36 | SSDP.setModelURL("http://www.meethue.com"); 37 | SSDP.setManufacturer("Royal Philips Electronics"); 38 | SSDP.setManufacturerURL("http://www.philips.com"); 39 | SSDP.setDeviceType("upnp:rootdevice"); //to appear as root device 40 | SSDP.begin(); 41 | 42 | Serial.printf("Ready!\n"); 43 | } else { 44 | Serial.printf("WiFi Failed\n"); 45 | while(1) delay(100); 46 | } 47 | } 48 | 49 | void loop() { 50 | HTTP.handleClient(); 51 | delay(1); 52 | } 53 | -------------------------------------------------------------------------------- /libraries/ESP32SSDP/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Ultrasound 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ESP8266SSDP KEYWORD1 10 | SSDP KEYWORD1 11 | 12 | ####################################### 13 | # Methods and Functions (KEYWORD2) 14 | ####################################### 15 | 16 | begin KEYWORD2 17 | schema KEYWORD2 18 | setName KEYWORD2 19 | setURL KEYWORD2 20 | setHTTPPort KEYWORD2 21 | setSchemaURL KEYWORD2 22 | setSerialNumber KEYWORD2 23 | setModelName KEYWORD2 24 | setModelNumber KEYWORD2 25 | setModelURL KEYWORD2 26 | setManufacturer KEYWORD2 27 | setManufacturerURL KEYWORD2 28 | 29 | ####################################### 30 | # Constants (LITERAL1) 31 | ####################################### 32 | SSDP_INTERVAL LITERAL1 33 | SSDP_PORT LITERAL1 34 | SSDP_METHOD_SIZE LITERAL1 35 | SSDP_URI_SIZE LITERAL1 36 | SSDP_BUFFER_SIZE LITERAL1 37 | SSDP_BASE_SIZE LITERAL1 38 | SSDP_FRIENDLY_NAME_SIZE LITERAL1 39 | SSDP_SERIAL_NUMBER_SIZE LITERAL1 40 | SSDP_PRESENTATION_URL_SIZE LITERAL1 41 | SSDP_MODEL_NAME_SIZE LITERAL1 42 | SSDP_MODEL_URL_SIZE LITERAL1 43 | SSDP_MODEL_VERSION_SIZE LITERAL1 44 | SSDP_MANUFACTURER_SIZE LITERAL1 45 | SSDP_MANUFACTURER_URL_SIZE LITERAL1 46 | SEARCH LITERAL1 47 | NOTIFY LITERAL1 48 | BASIC LITERAL1 49 | MANAGEABLE LITERAL1 50 | SOLARPROTECTIONBLIND LITERAL1 51 | DIGITALSECURITYCAMERA LITERAL1 52 | HVAC LITERAL1 53 | LIGHTINGCONTROL LITERAL1 54 | -------------------------------------------------------------------------------- /libraries/ESP32SSDP/library.properties: -------------------------------------------------------------------------------- 1 | name=ESP32SSDP 2 | version=1.0 3 | author=Me-No-Dev 4 | maintainer=Me-No-Dev 5 | sentence=Simple SSDP library for ESP32 6 | paragraph=Only for ESP32 7 | category=Communication 8 | url= 9 | architectures=esp32 10 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: bash 3 | os: 4 | - linux 5 | 6 | script: 7 | - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 8 | - sleep 3 9 | - export DISPLAY=:1.0 10 | - wget http://downloads.arduino.cc/arduino-1.6.5-linux64.tar.xz 11 | - tar xf arduino-1.6.5-linux64.tar.xz 12 | - mv arduino-1.6.5 $HOME/arduino_ide 13 | - export PATH="$HOME/arduino_ide:$PATH" 14 | - which arduino 15 | - mkdir -p $HOME/Arduino/libraries 16 | - cp -r $TRAVIS_BUILD_DIR $HOME/Arduino/libraries/ESPAsyncTCP 17 | - cd $HOME/arduino_ide/hardware 18 | - mkdir esp8266com 19 | - cd esp8266com 20 | - git clone https://github.com/esp8266/Arduino.git esp8266 21 | - cd esp8266/tools 22 | - python get.py 23 | - source $TRAVIS_BUILD_DIR/travis/common.sh 24 | - arduino --board esp8266com:esp8266:generic --save-prefs 25 | - arduino --get-pref sketchbook.path 26 | - build_sketches arduino $HOME/Arduino/libraries/ESPAsyncTCP esp8266 27 | 28 | notifications: 29 | email: 30 | on_success: change 31 | on_failure: change 32 | webhooks: 33 | urls: 34 | - https://webhooks.gitter.im/e/60e65d0c78ea0a920347 35 | on_success: change # options: [always|never|change] default: always 36 | on_failure: always # options: [always|never|change] default: always 37 | on_start: false # default: false 38 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/README.md: -------------------------------------------------------------------------------- 1 | # ESPAsyncTCP [![Build Status](https://travis-ci.org/me-no-dev/ESPAsyncTCP.svg?branch=master)](https://travis-ci.org/me-no-dev/ESPAsyncTCP) 2 | Async TCP Library for ESP8266 Arduino 3 | 4 | For ESP32 look [HERE](https://github.com/me-no-dev/AsyncTCP) 5 | 6 | [![Join the chat at https://gitter.im/me-no-dev/ESPAsyncWebServer](https://badges.gitter.im/me-no-dev/ESPAsyncWebServer.svg)](https://gitter.im/me-no-dev/ESPAsyncWebServer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 7 | 8 | This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP8266 MCUs. 9 | 10 | This library is the base for [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) 11 | 12 | ## AsyncClient and AsyncServer 13 | The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use. 14 | 15 | ## AsyncPrinter 16 | This class can be used to send data like any other ```Print``` interface (```Serial``` for example). 17 | The object then can be used outside of the Async callbacks (the loop) and receive asynchronously data using ```onData```. The object can be checked if the underlying ```AsyncClient```is connected, or hook to the ```onDisconnect``` callback. 18 | 19 | ## AsyncTCPbuffer 20 | This class is really similar to the ```AsyncPrinter```, but it differs in the fact that it can buffer some of the incoming data. 21 | 22 | ## SyncClient 23 | It is exactly what it sounds like. This is a standard, blocking TCP Client, similar to the one included in ```ESP8266WiFi``` 24 | 25 | ## Libraries and projects that use AsyncTCP 26 | - [ESP Async Web Server](https://github.com/me-no-dev/ESPAsyncWebServer) 27 | - [Async MQTT client](https://github.com/marvinroger/async-mqtt-client) 28 | - [arduinoWebSockets](https://github.com/Links2004/arduinoWebSockets) 29 | - [ESP8266 Smart Home](https://github.com/baruch/esp8266_smart_home) 30 | - [KBox Firmware](https://github.com/sarfata/kbox-firmware) 31 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/examples/SyncClient/.esp31b.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncTCP/examples/SyncClient/.esp31b.skip -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/examples/SyncClient/SyncClient.ino: -------------------------------------------------------------------------------- 1 | #ifdef ESP8266 2 | #include 3 | #include 4 | #include 5 | #else 6 | #include 7 | #endif 8 | #include "ESPAsyncTCP.h" 9 | #include "SyncClient.h" 10 | 11 | const char* ssid = "**********"; 12 | const char* password = "************"; 13 | 14 | void setup(){ 15 | Serial.begin(115200); 16 | WiFi.begin(ssid, password); 17 | if (WiFi.waitForConnectResult() != WL_CONNECTED) { 18 | Serial.printf("WiFi Failed!\n"); 19 | return; 20 | } 21 | Serial.printf("WiFi Connected!\n"); 22 | Serial.println(WiFi.localIP()); 23 | #ifdef ESP8266 24 | ArduinoOTA.begin(); 25 | #endif 26 | 27 | SyncClient client; 28 | if(!client.connect("www.google.com", 80)){ 29 | Serial.println("Connect Failed"); 30 | return; 31 | } 32 | client.setTimeout(2); 33 | if(client.printf("GET / HTTP/1.1\r\nHost: www.google.com\r\nConnection: close\r\n\r\n") > 0){ 34 | while(client.connected() && client.available() == 0){ 35 | delay(1); 36 | } 37 | while(client.available()){ 38 | Serial.write(client.read()); 39 | } 40 | if(client.connected()){ 41 | client.stop(); 42 | } 43 | } else { 44 | client.stop(); 45 | Serial.println("Send Failed"); 46 | while(client.connected()) delay(0); 47 | } 48 | } 49 | 50 | void loop(){ 51 | #ifdef ESP8266 52 | ArduinoOTA.handle(); 53 | #endif 54 | } 55 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"ESPAsyncTCP", 3 | "description":"Asynchronous TCP Library for ESP8266", 4 | "keywords":"async,tcp", 5 | "authors": 6 | { 7 | "name": "Hristo Gochkov", 8 | "maintainer": true 9 | }, 10 | "repository": 11 | { 12 | "type": "git", 13 | "url": "https://github.com/me-no-dev/ESPAsyncTCP.git" 14 | }, 15 | "version": "1.1.1", 16 | "license": "LGPL-3.0", 17 | "frameworks": "arduino", 18 | "platforms":"espressif8266" 19 | } 20 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/library.properties: -------------------------------------------------------------------------------- 1 | name=ESP AsyncTCP 2 | version=1.1.0 3 | author=Me-No-Dev 4 | maintainer=Me-No-Dev 5 | sentence=Async TCP Library for ESP8266 and ESP31B 6 | paragraph=Async TCP Library for ESP8266 and ESP31B 7 | category=Other 8 | url=https://github.com/me-no-dev/ESPAsyncTCP 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/src/AsyncPrinter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Asynchronous TCP library for Espressif MCUs 3 | 4 | Copyright (c) 2016 Hristo Gochkov. All rights reserved. 5 | This file is part of the esp8266 core for Arduino environment. 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef ASYNCPRINTER_H_ 23 | #define ASYNCPRINTER_H_ 24 | 25 | #include "Arduino.h" 26 | #include "ESPAsyncTCP.h" 27 | #include "cbuf.h" 28 | 29 | class AsyncPrinter; 30 | 31 | typedef std::function ApDataHandler; 32 | typedef std::function ApCloseHandler; 33 | 34 | class AsyncPrinter: public Print { 35 | private: 36 | AsyncClient *_client; 37 | ApDataHandler _data_cb; 38 | void *_data_arg; 39 | ApCloseHandler _close_cb; 40 | void *_close_arg; 41 | cbuf *_tx_buffer; 42 | size_t _tx_buffer_size; 43 | 44 | void _onConnect(AsyncClient *c); 45 | public: 46 | AsyncPrinter *next; 47 | 48 | AsyncPrinter(); 49 | AsyncPrinter(AsyncClient *client, size_t txBufLen = 1460); 50 | virtual ~AsyncPrinter(); 51 | 52 | int connect(IPAddress ip, uint16_t port); 53 | int connect(const char *host, uint16_t port); 54 | 55 | void onData(ApDataHandler cb, void *arg); 56 | void onClose(ApCloseHandler cb, void *arg); 57 | 58 | operator bool(); 59 | AsyncPrinter & operator=(const AsyncPrinter &other); 60 | 61 | size_t write(uint8_t data); 62 | size_t write(const uint8_t *data, size_t len); 63 | 64 | bool connected(); 65 | void close(); 66 | 67 | size_t _sendBuffer(); 68 | void _onData(void *data, size_t len); 69 | void _on_close(); 70 | void _attachCallbacks(); 71 | }; 72 | 73 | #endif /* ASYNCPRINTER_H_ */ 74 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/src/ESPAsyncTCPbuffer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ESPAsyncTCPbuffer.h 3 | * @date 22.01.2016 4 | * @author Markus Sattler 5 | * 6 | * Copyright (c) 2015 Markus Sattler. All rights reserved. 7 | * This file is part of the Asynv TCP for ESP. 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2.1 of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #ifndef ESPASYNCTCPBUFFER_H_ 26 | #define ESPASYNCTCPBUFFER_H_ 27 | 28 | //#define DEBUG_ASYNC_TCP(...) while(((U0S >> USTXC) & 0x7F) != 0x00); os_printf( __VA_ARGS__ ); while(((U0S >> USTXC) & 0x7F) != 0x00) 29 | 30 | #ifndef DEBUG_ASYNC_TCP 31 | #define DEBUG_ASYNC_TCP(...) 32 | #endif 33 | 34 | #include 35 | #include 36 | 37 | #include "ESPAsyncTCP.h" 38 | 39 | 40 | 41 | typedef enum { 42 | ATB_RX_MODE_NONE, 43 | ATB_RX_MODE_FREE, 44 | ATB_RX_MODE_READ_BYTES, 45 | ATB_RX_MODE_TERMINATOR, 46 | ATB_RX_MODE_TERMINATOR_STRING 47 | } atbRxMode_t; 48 | 49 | class AsyncTCPbuffer: public Print { 50 | 51 | public: 52 | 53 | typedef std::function AsyncTCPbufferDataCb; 54 | typedef std::function AsyncTCPbufferDoneCb; 55 | typedef std::function AsyncTCPbufferDisconnectCb; 56 | 57 | AsyncTCPbuffer(AsyncClient* c); 58 | virtual ~AsyncTCPbuffer(); 59 | 60 | size_t write(String & data); 61 | size_t write(uint8_t data); 62 | size_t write(const char* data); 63 | size_t write(const char *data, size_t len); 64 | size_t write(const uint8_t *data, size_t len); 65 | 66 | void flush(); 67 | 68 | void noCallback(); 69 | 70 | void readStringUntil(char terminator, String * str, AsyncTCPbufferDoneCb done); 71 | 72 | // TODO implement read terminator non string 73 | //void readBytesUntil(char terminator, char *buffer, size_t length, AsyncTCPbufferDoneCb done); 74 | //void readBytesUntil(char terminator, uint8_t *buffer, size_t length, AsyncTCPbufferDoneCb done); 75 | 76 | void readBytes(char *buffer, size_t length, AsyncTCPbufferDoneCb done); 77 | void readBytes(uint8_t *buffer, size_t length, AsyncTCPbufferDoneCb done); 78 | 79 | // TODO implement 80 | // void setTimeout(size_t timeout); 81 | 82 | void onData(AsyncTCPbufferDataCb cb); 83 | void onDisconnect(AsyncTCPbufferDisconnectCb cb); 84 | 85 | IPAddress remoteIP(); 86 | uint16_t remotePort(); 87 | IPAddress localIP(); 88 | uint16_t localPort(); 89 | 90 | bool connected(); 91 | 92 | void stop(); 93 | void close(); 94 | 95 | protected: 96 | AsyncClient* _client; 97 | cbuf * _TXbufferRead; 98 | cbuf * _TXbufferWrite; 99 | cbuf * _RXbuffer; 100 | atbRxMode_t _RXmode; 101 | size_t _rxSize; 102 | char _rxTerminator; 103 | uint8_t * _rxReadBytesPtr; 104 | String * _rxReadStringPtr; 105 | 106 | AsyncTCPbufferDataCb _cbRX; 107 | AsyncTCPbufferDoneCb _cbDone; 108 | AsyncTCPbufferDisconnectCb _cbDisconnect; 109 | 110 | void _attachCallbacks(); 111 | void _sendBuffer(); 112 | void _on_close(); 113 | void _rxData(uint8_t *buf, size_t len); 114 | size_t _handleRxBuffer(uint8_t *buf, size_t len); 115 | 116 | }; 117 | 118 | #endif /* ESPASYNCTCPBUFFER_H_ */ 119 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/src/SyncClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | Asynchronous TCP library for Espressif MCUs 3 | 4 | Copyright (c) 2016 Hristo Gochkov. All rights reserved. 5 | This file is part of the esp8266 core for Arduino environment. 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef SYNCCLIENT_H_ 23 | #define SYNCCLIENT_H_ 24 | 25 | #include "Client.h" 26 | #include 27 | class cbuf; 28 | class AsyncClient; 29 | 30 | class SyncClient: public Client { 31 | private: 32 | AsyncClient *_client; 33 | cbuf *_tx_buffer; 34 | size_t _tx_buffer_size; 35 | cbuf *_rx_buffer; 36 | 37 | size_t _sendBuffer(); 38 | void _onData(void *data, size_t len); 39 | void _onConnect(AsyncClient *c); 40 | void _onDisconnect(); 41 | void _attachCallbacks(); 42 | void _attachCallbacks_Disconnect(); 43 | void _attachCallbacks_AfterConnected(); 44 | 45 | public: 46 | SyncClient(size_t txBufLen = 1460); 47 | SyncClient(AsyncClient *client, size_t txBufLen = 1460); 48 | virtual ~SyncClient(); 49 | 50 | operator bool(){ return connected(); } 51 | SyncClient & operator=(const SyncClient &other); 52 | 53 | #if ASYNC_TCP_SSL_ENABLED 54 | int connect(IPAddress ip, uint16_t port, bool secure); 55 | int connect(const char *host, uint16_t port, bool secure); 56 | int connect(IPAddress ip, uint16_t port){ 57 | return connect(ip, port, false); 58 | } 59 | int connect(const char *host, uint16_t port){ 60 | return connect(host, port, false); 61 | } 62 | #else 63 | int connect(IPAddress ip, uint16_t port); 64 | int connect(const char *host, uint16_t port); 65 | #endif 66 | void setTimeout(uint32_t seconds); 67 | 68 | uint8_t status(); 69 | uint8_t connected(); 70 | void stop(); 71 | 72 | size_t write(uint8_t data); 73 | size_t write(const uint8_t *data, size_t len); 74 | 75 | int available(); 76 | int peek(); 77 | int read(); 78 | int read(uint8_t *data, size_t len); 79 | void flush(); 80 | }; 81 | 82 | #endif /* SYNCCLIENT_H_ */ 83 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/src/async_config.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBRARIES_ESPASYNCTCP_SRC_ASYNC_CONFIG_H_ 2 | #define LIBRARIES_ESPASYNCTCP_SRC_ASYNC_CONFIG_H_ 3 | 4 | #ifndef ASYNC_TCP_SSL_ENABLED 5 | #define ASYNC_TCP_SSL_ENABLED 0 6 | #endif 7 | 8 | #define ASYNC_TCP_DEBUG(...) //ets_printf(__VA_ARGS__) 9 | #define TCP_SSL_DEBUG(...) //ets_printf(__VA_ARGS__) 10 | 11 | #endif /* LIBRARIES_ESPASYNCTCP_SRC_ASYNC_CONFIG_H_ */ 12 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/src/tcp_axtls.h: -------------------------------------------------------------------------------- 1 | /* 2 | Asynchronous TCP library for Espressif MCUs 3 | 4 | Copyright (c) 2016 Hristo Gochkov. All rights reserved. 5 | This file is part of the esp8266 core for Arduino environment. 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | /* 22 | * Compatibility for AxTLS with LWIP raw tcp mode (http://lwip.wikia.com/wiki/Raw/TCP) 23 | * Original Code and Inspiration: Slavey Karadzhov 24 | */ 25 | 26 | #ifndef LWIPR_COMPAT_H 27 | #define LWIPR_COMPAT_H 28 | 29 | #include 30 | 31 | #if ASYNC_TCP_SSL_ENABLED 32 | 33 | #include "lwipopts.h" 34 | /* 35 | * All those functions will run only if LWIP tcp raw mode is used 36 | */ 37 | #if LWIP_RAW==1 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | #include "include/ssl.h" 44 | 45 | #define ERR_TCP_SSL_INVALID_SSL -101 46 | #define ERR_TCP_SSL_INVALID_TCP -102 47 | #define ERR_TCP_SSL_INVALID_CLIENTFD -103 48 | #define ERR_TCP_SSL_INVALID_CLIENTFD_DATA -104 49 | #define ERR_TCP_SSL_INVALID_DATA -105 50 | 51 | #define TCP_SSL_TYPE_CLIENT 0 52 | #define TCP_SSL_TYPE_SERVER 1 53 | 54 | #define tcp_ssl_ssl_write(A, B, C) tcp_ssl_write(A, B, C) 55 | #define tcp_ssl_ssl_read(A, B) tcp_ssl_read(A, B) 56 | 57 | typedef void (* tcp_ssl_data_cb_t)(void *arg, struct tcp_pcb *tcp, uint8_t * data, size_t len); 58 | typedef void (* tcp_ssl_handshake_cb_t)(void *arg, struct tcp_pcb *tcp, SSL *ssl); 59 | typedef void (* tcp_ssl_error_cb_t)(void *arg, struct tcp_pcb *tcp, int8_t error); 60 | typedef int (* tcp_ssl_file_cb_t)(void *arg, const char *filename, uint8_t **buf); 61 | 62 | uint8_t tcp_ssl_has_client(); 63 | 64 | int tcp_ssl_new_client(struct tcp_pcb *tcp); 65 | 66 | SSL_CTX * tcp_ssl_new_server_ctx(const char *cert, const char *private_key_file, const char *password); 67 | int tcp_ssl_new_server(struct tcp_pcb *tcp, SSL_CTX* ssl_ctx); 68 | int tcp_ssl_is_server(struct tcp_pcb *tcp); 69 | 70 | int tcp_ssl_free(struct tcp_pcb *tcp); 71 | int tcp_ssl_read(struct tcp_pcb *tcp, struct pbuf *p); 72 | 73 | #ifdef AXTLS_2_0_0_SNDBUF 74 | int tcp_ssl_sndbuf(struct tcp_pcb *tcp); 75 | #endif 76 | 77 | int tcp_ssl_write(struct tcp_pcb *tcp, uint8_t *data, size_t len); 78 | 79 | void tcp_ssl_file(tcp_ssl_file_cb_t cb, void * arg); 80 | 81 | void tcp_ssl_arg(struct tcp_pcb *tcp, void * arg); 82 | void tcp_ssl_data(struct tcp_pcb *tcp, tcp_ssl_data_cb_t arg); 83 | void tcp_ssl_handshake(struct tcp_pcb *tcp, tcp_ssl_handshake_cb_t arg); 84 | void tcp_ssl_err(struct tcp_pcb *tcp, tcp_ssl_error_cb_t arg); 85 | 86 | SSL * tcp_ssl_get_ssl(struct tcp_pcb *tcp); 87 | bool tcp_ssl_has(struct tcp_pcb *tcp); 88 | 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | 93 | #endif /* LWIP_RAW==1 */ 94 | 95 | #endif /* ASYNC_TCP_SSL_ENABLED */ 96 | 97 | #endif /* LWIPR_COMPAT_H */ 98 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/ssl/gen_server_cert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat > ca_cert.conf << EOF 4 | [ req ] 5 | distinguished_name = req_distinguished_name 6 | prompt = no 7 | 8 | [ req_distinguished_name ] 9 | O = Espressif Systems 10 | EOF 11 | 12 | openssl genrsa -out axTLS.ca_key.pem 2048 13 | openssl req -new -config ./ca_cert.conf -key axTLS.ca_key.pem -out axTLS.ca_x509.req 14 | openssl x509 -req -sha1 -days 5000 -signkey axTLS.ca_key.pem -CAkey axTLS.ca_key.pem -in axTLS.ca_x509.req -out axTLS.ca_x509.pem 15 | 16 | cat > certs.conf << EOF 17 | [ req ] 18 | distinguished_name = req_distinguished_name 19 | prompt = no 20 | 21 | [ req_distinguished_name ] 22 | O = axTLS on ESP8266 23 | CN = esp8266.local 24 | EOF 25 | 26 | openssl genrsa -out axTLS.key_1024.pem 1024 27 | openssl req -new -config ./certs.conf -key axTLS.key_1024.pem -out axTLS.x509_1024.req 28 | openssl x509 -req -sha1 -CAcreateserial -days 5000 -CA axTLS.ca_x509.pem -CAkey axTLS.ca_key.pem -in axTLS.x509_1024.req -out axTLS.x509_1024.pem 29 | 30 | openssl rsa -outform DER -in axTLS.key_1024.pem -out axTLS.key_1024 31 | openssl x509 -outform DER -in axTLS.x509_1024.pem -out axTLS.x509_1024.cer 32 | 33 | cat axTLS.key_1024 > server.key 34 | cat axTLS.x509_1024.cer > server.cer 35 | 36 | rm axTLS.* ca_cert.conf certs.conf 37 | -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/ssl/server.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncTCP/ssl/server.cer -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/ssl/server.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncTCP/ssl/server.key -------------------------------------------------------------------------------- /libraries/ESPAsyncTCP/travis/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function build_sketches() 4 | { 5 | local arduino=$1 6 | local srcpath=$2 7 | local platform=$3 8 | local sketches=$(find $srcpath -name *.ino) 9 | for sketch in $sketches; do 10 | local sketchdir=$(dirname $sketch) 11 | if [[ -f "$sketchdir/.$platform.skip" ]]; then 12 | echo -e "\n\n ------------ Skipping $sketch ------------ \n\n"; 13 | continue 14 | fi 15 | echo -e "\n\n ------------ Building $sketch ------------ \n\n"; 16 | $arduino --verify $sketch; 17 | local result=$? 18 | if [ $result -ne 0 ]; then 19 | echo "Build failed ($1)" 20 | return $result 21 | fi 22 | done 23 | } 24 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: bash 3 | os: 4 | - linux 5 | 6 | script: 7 | - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 8 | - sleep 3 9 | - export DISPLAY=:1.0 10 | - wget http://downloads.arduino.cc/arduino-1.6.5-linux64.tar.xz 11 | - tar xf arduino-1.6.5-linux64.tar.xz 12 | - mv arduino-1.6.5 $HOME/arduino_ide 13 | - export PATH="$HOME/arduino_ide:$PATH" 14 | - which arduino 15 | - mkdir -p $HOME/Arduino/libraries 16 | - cp -r $TRAVIS_BUILD_DIR $HOME/Arduino/libraries/ESPAsyncWebServer 17 | - git clone https://github.com/bblanchon/ArduinoJson $HOME/Arduino/libraries/ArduinoJson 18 | - git clone https://github.com/me-no-dev/ESPAsyncTCP $HOME/Arduino/libraries/ESPAsyncTCP 19 | - cd $HOME/arduino_ide/hardware 20 | - mkdir esp8266com 21 | - cd esp8266com 22 | - git clone https://github.com/esp8266/Arduino.git esp8266 23 | - cd esp8266/tools 24 | - python get.py 25 | - source $TRAVIS_BUILD_DIR/travis/common.sh 26 | - arduino --board esp8266com:esp8266:generic --save-prefs 27 | - arduino --get-pref sketchbook.path 28 | - build_sketches arduino $HOME/Arduino/libraries/ESPAsyncWebServer esp8266 29 | 30 | notifications: 31 | email: 32 | on_success: change 33 | on_failure: change 34 | webhooks: 35 | urls: 36 | - https://webhooks.gitter.im/e/60e65d0c78ea0a920347 37 | on_success: change # options: [always|never|change] default: always 38 | on_failure: always # options: [always|never|change] default: always 39 | on_start: false # default: false 40 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := src 2 | COMPONENT_SRCDIRS := src 3 | CXXFLAGS += -fno-rtti 4 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/.esp31b.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/.esp31b.skip -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/.exclude.files: -------------------------------------------------------------------------------- 1 | /*.js.gz 2 | /.exclude.files 3 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/ace.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/ace.js.gz -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/ext-searchbox.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/ext-searchbox.js.gz -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/favicon.ico -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/index.htm: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | WebSocketTester 23 | 52 | 124 | 125 | 126 |


127 |     
128 | $ 129 |
130 | 131 | 132 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/mode-css.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/mode-css.js.gz -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/mode-html.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/mode-html.js.gz -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/mode-javascript.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/mode-javascript.js.gz -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/worker-html.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/ESPAsyncWebServer/examples/ESP_AsyncFSBrowser/data/worker-html.js.gz -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/examples/simple_server/simple_server.ino: -------------------------------------------------------------------------------- 1 | // 2 | // A simple server implementation showing how to: 3 | // * serve static messages 4 | // * read GET and POST parameters 5 | // * handle missing pages / 404s 6 | // 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | AsyncWebServer server(80); 15 | 16 | const char* ssid = "YOUR_SSID"; 17 | const char* password = "YOUR_PASSWORD"; 18 | 19 | const char* PARAM_MESSAGE = "message"; 20 | 21 | void notFound(AsyncWebServerRequest *request) { 22 | request->send(404, "text/plain", "Not found"); 23 | } 24 | 25 | void setup() { 26 | 27 | Serial.begin(115200); 28 | WiFi.mode(WIFI_STA); 29 | WiFi.begin(ssid, password); 30 | if (WiFi.waitForConnectResult() != WL_CONNECTED) { 31 | Serial.printf("WiFi Failed!\n"); 32 | return; 33 | } 34 | 35 | Serial.print("IP Address: "); 36 | Serial.println(WiFi.localIP()); 37 | Serial.print("Hostname: "); 38 | Serial.println(WiFi.hostname()); 39 | 40 | server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ 41 | request->send(200, "text/plain", "Hello, world"); 42 | }); 43 | 44 | // Send a GET request to /get?message= 45 | server.on("/get", HTTP_GET, [] (AsyncWebServerRequest *request) { 46 | String message; 47 | if (request->hasParam(PARAM_MESSAGE)) { 48 | message = request->getParam(PARAM_MESSAGE)->value(); 49 | } else { 50 | message = "No message sent"; 51 | } 52 | request->send(200, "text/plain", "Hello, GET: " + message); 53 | }); 54 | 55 | // Send a POST request to /post with a form field message set to 56 | server.on("/post", HTTP_POST, [](AsyncWebServerRequest *request){ 57 | String message; 58 | if (request->hasParam(PARAM_MESSAGE, true)) { 59 | message = request->getParam(PARAM_MESSAGE, true)->value(); 60 | } else { 61 | message = "No message sent"; 62 | } 63 | request->send(200, "text/plain", "Hello, POST: " + message); 64 | }); 65 | 66 | server.onNotFound(notFound); 67 | 68 | server.begin(); 69 | } 70 | 71 | void loop() { 72 | } -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/keywords.txt: -------------------------------------------------------------------------------- 1 | JsonArray KEYWORD1 2 | add KEYWORD2 3 | createArray KEYWORD3 4 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"ESP Async WebServer", 3 | "description":"Asynchronous HTTP and WebSocket Server Library for ESP8266 and ESP32", 4 | "keywords":"http,async,websocket,webserver", 5 | "authors": 6 | { 7 | "name": "Hristo Gochkov", 8 | "maintainer": true 9 | }, 10 | "repository": 11 | { 12 | "type": "git", 13 | "url": "https://github.com/me-no-dev/ESPAsyncWebServer.git" 14 | }, 15 | "version": "1.2.0", 16 | "license": "LGPL-3.0", 17 | "frameworks": "arduino", 18 | "platforms": ["espressif8266", "espressif32"], 19 | "dependencies": [ 20 | { 21 | "name": "ESPAsyncTCP", 22 | "platforms": "espressif8266" 23 | }, 24 | { 25 | "name": "AsyncTCP", 26 | "platforms": "espressif32" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/library.properties: -------------------------------------------------------------------------------- 1 | name=ESP Async WebServer 2 | version=1.2.0 3 | author=Me-No-Dev 4 | maintainer=Me-No-Dev 5 | sentence=Async Web Server for ESP8266 and ESP31B 6 | paragraph=Async Web Server for ESP8266 and ESP31B 7 | category=Other 8 | url=https://github.com/me-no-dev/ESPAsyncWebServer 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/src/AsyncEventSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Asynchronous WebServer library for Espressif MCUs 3 | 4 | Copyright (c) 2016 Hristo Gochkov. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | #ifndef ASYNCEVENTSOURCE_H_ 21 | #define ASYNCEVENTSOURCE_H_ 22 | 23 | #include 24 | #ifdef ESP32 25 | #include 26 | #else 27 | #include 28 | #endif 29 | #include 30 | 31 | class AsyncEventSource; 32 | class AsyncEventSourceResponse; 33 | class AsyncEventSourceClient; 34 | typedef std::function ArEventHandlerFunction; 35 | 36 | class AsyncEventSourceMessage { 37 | private: 38 | uint8_t * _data; 39 | size_t _len; 40 | size_t _sent; 41 | //size_t _ack; 42 | size_t _acked; 43 | public: 44 | AsyncEventSourceMessage(const char * data, size_t len); 45 | ~AsyncEventSourceMessage(); 46 | size_t ack(size_t len, uint32_t time __attribute__((unused))); 47 | size_t send(AsyncClient *client); 48 | bool finished(){ return _acked == _len; } 49 | bool sent() { return _sent == _len; } 50 | }; 51 | 52 | class AsyncEventSourceClient { 53 | private: 54 | AsyncClient *_client; 55 | AsyncEventSource *_server; 56 | uint32_t _lastId; 57 | LinkedList _messageQueue; 58 | void _queueMessage(AsyncEventSourceMessage *dataMessage); 59 | void _runQueue(); 60 | 61 | public: 62 | 63 | AsyncEventSourceClient(AsyncWebServerRequest *request, AsyncEventSource *server); 64 | ~AsyncEventSourceClient(); 65 | 66 | AsyncClient* client(){ return _client; } 67 | void close(); 68 | void write(const char * message, size_t len); 69 | void send(const char *message, const char *event=NULL, uint32_t id=0, uint32_t reconnect=0); 70 | bool connected() const { return (_client != NULL) && _client->connected(); } 71 | uint32_t lastId() const { return _lastId; } 72 | 73 | //system callbacks (do not call) 74 | void _onAck(size_t len, uint32_t time); 75 | void _onPoll(); 76 | void _onTimeout(uint32_t time); 77 | void _onDisconnect(); 78 | }; 79 | 80 | class AsyncEventSource: public AsyncWebHandler { 81 | private: 82 | String _url; 83 | LinkedList _clients; 84 | ArEventHandlerFunction _connectcb; 85 | public: 86 | AsyncEventSource(const String& url); 87 | ~AsyncEventSource(); 88 | 89 | const char * url() const { return _url.c_str(); } 90 | void close(); 91 | void onConnect(ArEventHandlerFunction cb); 92 | void send(const char *message, const char *event=NULL, uint32_t id=0, uint32_t reconnect=0); 93 | size_t count() const; //number clinets connected 94 | 95 | //system callbacks (do not call) 96 | void _addClient(AsyncEventSourceClient * client); 97 | void _handleDisconnect(AsyncEventSourceClient * client); 98 | virtual bool canHandle(AsyncWebServerRequest *request) override final; 99 | virtual void handleRequest(AsyncWebServerRequest *request) override final; 100 | }; 101 | 102 | class AsyncEventSourceResponse: public AsyncWebServerResponse { 103 | private: 104 | String _content; 105 | AsyncEventSource *_server; 106 | public: 107 | AsyncEventSourceResponse(AsyncEventSource *server); 108 | void _respond(AsyncWebServerRequest *request); 109 | size_t _ack(AsyncWebServerRequest *request, size_t len, uint32_t time); 110 | bool _sourceValid() const { return true; } 111 | }; 112 | 113 | 114 | #endif /* ASYNCEVENTSOURCE_H_ */ 115 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/src/SPIFFSEditor.h: -------------------------------------------------------------------------------- 1 | #ifndef SPIFFSEditor_H_ 2 | #define SPIFFSEditor_H_ 3 | #include 4 | 5 | class SPIFFSEditor: public AsyncWebHandler { 6 | private: 7 | fs::FS _fs; 8 | String _username; 9 | String _password; 10 | bool _authenticated; 11 | uint32_t _startTime; 12 | public: 13 | #ifdef ESP32 14 | SPIFFSEditor(const fs::FS& fs, const String& username=String(), const String& password=String()); 15 | #else 16 | SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS); 17 | #endif 18 | virtual bool canHandle(AsyncWebServerRequest *request) override final; 19 | virtual void handleRequest(AsyncWebServerRequest *request) override final; 20 | virtual void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) override final; 21 | virtual bool isRequestHandlerTrivial() override final {return false;} 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/src/WebAuthentication.h: -------------------------------------------------------------------------------- 1 | /* 2 | Asynchronous WebServer library for Espressif MCUs 3 | 4 | Copyright (c) 2016 Hristo Gochkov. All rights reserved. 5 | This file is part of the esp8266 core for Arduino environment. 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef WEB_AUTHENTICATION_H_ 23 | #define WEB_AUTHENTICATION_H_ 24 | 25 | #include "Arduino.h" 26 | 27 | bool checkBasicAuthentication(const char * header, const char * username, const char * password); 28 | String requestDigestAuthentication(const char * realm); 29 | bool checkDigestAuthentication(const char * header, const char * method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri); 30 | 31 | //for storing hashed versions on the device that can be authenticated against 32 | String generateDigestHash(const char * username, const char * password, const char * realm); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libraries/ESPAsyncWebServer/travis/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function build_sketches() 4 | { 5 | local arduino=$1 6 | local srcpath=$2 7 | local platform=$3 8 | local sketches=$(find $srcpath -name *.ino) 9 | for sketch in $sketches; do 10 | local sketchdir=$(dirname $sketch) 11 | if [[ -f "$sketchdir/.$platform.skip" ]]; then 12 | echo -e "\n\n ------------ Skipping $sketch ------------ \n\n"; 13 | continue 14 | fi 15 | echo -e "\n\n ------------ Building $sketch ------------ \n\n"; 16 | $arduino --verify $sketch; 17 | local result=$? 18 | if [ $result -ne 0 ]; then 19 | echo "Build failed ($1)" 20 | return $result 21 | fi 22 | done 23 | } 24 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | /tests/webSocketServer/node_modules 30 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: bash 3 | os: 4 | - linux 5 | env: 6 | matrix: 7 | - CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80" IDE_VERSION=1.6.5 8 | - CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80,FlashSize=1M0,FlashMode=qio,FlashFreq=80" IDE_VERSION=1.8.5 9 | - CPU="esp8266" BOARD="esp8266com:esp8266:generic:CpuFrequency=80,Debug=Serial1" IDE_VERSION=1.6.5 10 | - CPU="esp32" BOARD="espressif:esp32:esp32:FlashFreq=80" IDE_VERSION=1.6.5 11 | - CPU="esp32" BOARD="espressif:esp32:esp32:FlashFreq=80" IDE_VERSION=1.8.5 12 | 13 | script: 14 | - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 15 | - sleep 3 16 | - export DISPLAY=:1.0 17 | - wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz 18 | - tar xf arduino-$IDE_VERSION-linux64.tar.xz 19 | - mv arduino-$IDE_VERSION $HOME/arduino_ide 20 | - export PATH="$HOME/arduino_ide:$PATH" 21 | - which arduino 22 | - mkdir -p $HOME/Arduino/libraries 23 | - cp -r $TRAVIS_BUILD_DIR $HOME/Arduino/libraries/arduinoWebSockets 24 | - source $TRAVIS_BUILD_DIR/travis/common.sh 25 | - get_core $CPU 26 | - cd $TRAVIS_BUILD_DIR 27 | - arduino --board $BOARD --save-prefs 28 | - arduino --get-pref sketchbook.path 29 | - build_sketches arduino $HOME/Arduino/libraries/arduinoWebSockets/examples/$CPU $CPU 30 | 31 | notifications: 32 | email: 33 | on_success: change 34 | on_failure: change 35 | webhooks: 36 | urls: 37 | - https://webhooks.gitter.im/e/1aa78fbe15080b0c2e37 38 | on_success: change # options: [always|never|change] default: always 39 | on_failure: always # options: [always|never|change] default: always 40 | on_start: false # default: false 41 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/README.md: -------------------------------------------------------------------------------- 1 | WebSocket Server and Client for Arduino [![Build Status](https://travis-ci.org/Links2004/arduinoWebSockets.svg?branch=master)](https://travis-ci.org/Links2004/arduinoWebSockets) 2 | =========================================== 3 | 4 | a WebSocket Server and Client for Arduino based on RFC6455. 5 | 6 | 7 | ##### Supported features of RFC6455 ##### 8 | - text frame 9 | - binary frame 10 | - connection close 11 | - ping 12 | - pong 13 | - continuation frame 14 | 15 | ##### Limitations ##### 16 | - max input length is limited to the ram size and the ```WEBSOCKETS_MAX_DATA_SIZE``` define 17 | - max output length has no limit (the hardware is the limit) 18 | - Client send big frames with mask 0x00000000 (on AVR all frames) 19 | - continuation frame reassembly need to be handled in the application code 20 | 21 | ##### Limitations for Async ##### 22 | - Functions called from within the context of the websocket event might not honor `yield()` and/or `delay()`. See [this issue](https://github.com/Links2004/arduinoWebSockets/issues/58#issuecomment-192376395) for more info and a potential workaround. 23 | - wss / SSL is not possible. 24 | 25 | ##### Supported Hardware ##### 26 | - ESP8266 [Arduino for ESP8266](https://github.com/esp8266/Arduino/) 27 | - ESP32 [Arduino for ESP32](https://github.com/espressif/arduino-esp32) 28 | - ESP31B 29 | - Particle with STM32 ARM Cortex M3 30 | - ATmega328 with Ethernet Shield (ATmega branch) 31 | - ATmega328 with enc28j60 (ATmega branch) 32 | - ATmega2560 with Ethernet Shield (ATmega branch) 33 | - ATmega2560 with enc28j60 (ATmega branch) 34 | 35 | ###### Note: ###### 36 | 37 | version 2.0 and up is not compatible with AVR/ATmega, check ATmega branch. 38 | 39 | Arduino for AVR not supports std namespace of c++. 40 | 41 | ### wss / SSL ### 42 | supported for: 43 | - wss client on the ESP8266 44 | - wss / SSL is not natively supported in WebSocketsServer however it is possible to achieve secure websockets 45 | by running the device behind an SSL proxy. See [Nginx](examples/Nginx/esp8266.ssl.reverse.proxy.conf) for a 46 | sample Nginx server configuration file to enable this. 47 | 48 | ### ESP Async TCP ### 49 | 50 | This libary can run in Async TCP mode on the ESP. 51 | 52 | The mode can be activated in the ```WebSockets.h``` (see WEBSOCKETS_NETWORK_TYPE define). 53 | 54 | [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP) libary is required. 55 | 56 | 57 | ### High Level Client API ### 58 | 59 | - `begin` : Initiate connection sequence to the websocket host. 60 | ``` 61 | void begin(const char *host, uint16_t port, const char * url = "/", const char * protocol = "arduino"); 62 | void begin(String host, uint16_t port, String url = "/", String protocol = "arduino"); 63 | ``` 64 | - `onEvent`: Callback to handle for websocket events 65 | 66 | ``` 67 | void onEvent(WebSocketClientEvent cbEvent); 68 | ``` 69 | 70 | - `WebSocketClientEvent`: Handler for websocket events 71 | ``` 72 | void (*WebSocketClientEvent)(WStype_t type, uint8_t * payload, size_t length) 73 | ``` 74 | Where `WStype_t type` is defined as: 75 | ``` 76 | typedef enum { 77 | WStype_ERROR, 78 | WStype_DISCONNECTED, 79 | WStype_CONNECTED, 80 | WStype_TEXT, 81 | WStype_BIN, 82 | WStype_FRAGMENT_TEXT_START, 83 | WStype_FRAGMENT_BIN_START, 84 | WStype_FRAGMENT, 85 | WStype_FRAGMENT_FIN, 86 | } WStype_t; 87 | ``` 88 | 89 | ### Issues ### 90 | Submit issues to: https://github.com/Links2004/arduinoWebSockets/issues 91 | 92 | [![Join the chat at https://gitter.im/Links2004/arduinoWebSockets](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Links2004/arduinoWebSockets?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 93 | 94 | ### License and credits ### 95 | 96 | The library is licensed under [LGPLv2.1](https://github.com/Links2004/arduinoWebSockets/blob/master/LICENSE) 97 | 98 | [libb64](http://libb64.sourceforge.net/) written by Chris Venter. It is distributed under Public Domain see [LICENSE](https://github.com/Links2004/arduinoWebSockets/blob/master/src/libb64/LICENSE). 99 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/Nginx/esp8266.ssl.reverse.proxy.conf: -------------------------------------------------------------------------------- 1 | # ESP8266 nginx SSL reverse proxy configuration file (tested and working on nginx v1.10.0) 2 | 3 | # proxy cache location 4 | proxy_cache_path /opt/etc/nginx/cache levels=1:2 keys_zone=ESP8266_cache:10m max_size=10g inactive=5m use_temp_path=off; 5 | 6 | # webserver proxy 7 | server { 8 | 9 | # general server parameters 10 | listen 50080; 11 | server_name myDomain.net; 12 | access_log /opt/var/log/nginx/myDomain.net.access.log; 13 | 14 | # SSL configuration 15 | ssl on; 16 | ssl_certificate /usr/builtin/etc/certificate/lets-encrypt/myDomain.net/fullchain.pem; 17 | ssl_certificate_key /usr/builtin/etc/certificate/lets-encrypt/myDomain.net/privkey.pem; 18 | ssl_session_cache builtin:1000 shared:SSL:10m; 19 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 20 | ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; 21 | ssl_prefer_server_ciphers on; 22 | 23 | location / { 24 | 25 | # proxy caching configuration 26 | proxy_cache ESP8266_cache; 27 | proxy_cache_revalidate on; 28 | proxy_cache_min_uses 1; 29 | proxy_cache_use_stale off; 30 | proxy_cache_lock on; 31 | # proxy_cache_bypass $http_cache_control; 32 | # include the sessionId cookie value as part of the cache key - keeps the cache per user 33 | # proxy_cache_key $proxy_host$request_uri$cookie_sessionId; 34 | 35 | # header pass through configuration 36 | proxy_set_header Host $host; 37 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 38 | proxy_set_header X-Forwarded-Proto $scheme; 39 | 40 | # ESP8266 custom headers which identify to the device that it's running through an SSL proxy 41 | proxy_set_header X-SSL On; 42 | proxy_set_header X-SSL-WebserverPort 50080; 43 | proxy_set_header X-SSL-WebsocketPort 50081; 44 | 45 | # extra debug headers 46 | add_header X-Proxy-Cache $upstream_cache_status; 47 | add_header X-Forwarded-For $proxy_add_x_forwarded_for; 48 | 49 | # actual proxying configuration 50 | proxy_ssl_session_reuse on; 51 | # target the IP address of the device with proxy_pass 52 | proxy_pass http://192.168.0.20; 53 | proxy_read_timeout 90; 54 | } 55 | } 56 | 57 | # websocket proxy 58 | server { 59 | 60 | # general server parameters 61 | listen 50081; 62 | server_name myDomain.net; 63 | access_log /opt/var/log/nginx/myDomain.net.wss.access.log; 64 | 65 | # SSL configuration 66 | ssl on; 67 | ssl_certificate /usr/builtin/etc/certificate/lets-encrypt/myDomain.net/fullchain.pem; 68 | ssl_certificate_key /usr/builtin/etc/certificate/lets-encrypt/myDomain.net/privkey.pem; 69 | ssl_session_cache builtin:1000 shared:SSL:10m; 70 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 71 | ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; 72 | ssl_prefer_server_ciphers on; 73 | 74 | location / { 75 | 76 | # websocket upgrade tunnel configuration 77 | proxy_pass http://192.168.0.20:81; 78 | proxy_http_version 1.1; 79 | proxy_set_header Upgrade $http_upgrade; 80 | proxy_set_header Connection "Upgrade"; 81 | proxy_read_timeout 86400; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/avr/WebSocketClientAVR/WebSocketClientAVR.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketClientAVR.ino 3 | * 4 | * Created on: 10.12.2015 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | 16 | 17 | // Enter a MAC address for your controller below. 18 | // Newer Ethernet shields have a MAC address printed on a sticker on the shield 19 | byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; 20 | 21 | // Set the static IP address to use if the DHCP fails to assign 22 | IPAddress ip(192, 168, 0, 177); 23 | 24 | WebSocketsClient webSocket; 25 | 26 | 27 | 28 | void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { 29 | 30 | 31 | switch(type) { 32 | case WStype_DISCONNECTED: 33 | Serial.println("[WSc] Disconnected!\n"); 34 | break; 35 | case WStype_CONNECTED: 36 | { 37 | Serial.print("[WSc] Connected to url: "); 38 | Serial.println((char *)payload); 39 | // send message to server when Connected 40 | webSocket.sendTXT("Connected"); 41 | } 42 | break; 43 | case WStype_TEXT: 44 | Serial.print("[WSc] get text: "); 45 | Serial.println((char *)payload); 46 | // send message to server 47 | // webSocket.sendTXT("message here"); 48 | break; 49 | case WStype_BIN: 50 | Serial.print("[WSc] get binary length: "); 51 | Serial.println(length); 52 | // hexdump(payload, length); 53 | 54 | // send data to server 55 | // webSocket.sendBIN(payload, length); 56 | break; 57 | } 58 | 59 | } 60 | 61 | void setup() 62 | { 63 | // Open serial communications and wait for port to open: 64 | Serial.begin(115200); 65 | while (!Serial) {} 66 | 67 | // start the Ethernet connection: 68 | if (Ethernet.begin(mac) == 0) { 69 | Serial.println("Failed to configure Ethernet using DHCP"); 70 | // no point in carrying on, so do nothing forevermore: 71 | // try to congifure using IP address instead of DHCP: 72 | Ethernet.begin(mac, ip); 73 | } 74 | 75 | webSocket.begin("192.168.0.123", 8011); 76 | webSocket.onEvent(webSocketEvent); 77 | 78 | } 79 | 80 | 81 | void loop() 82 | { 83 | webSocket.loop(); 84 | } 85 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp32/WebSocketClient/WebSocketClient.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketClient.ino 3 | * 4 | * Created on: 24.05.2015 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | 17 | WiFiMulti WiFiMulti; 18 | WebSocketsClient webSocket; 19 | 20 | HardwareSerial Serial1(2); 21 | 22 | #define USE_SERIAL Serial1 23 | 24 | void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) { 25 | const uint8_t* src = (const uint8_t*) mem; 26 | USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len); 27 | for(uint32_t i = 0; i < len; i++) { 28 | if(i % cols == 0) { 29 | USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i); 30 | } 31 | USE_SERIAL.printf("%02X ", *src); 32 | src++; 33 | } 34 | USE_SERIAL.printf("\n"); 35 | } 36 | 37 | void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { 38 | 39 | switch(type) { 40 | case WStype_DISCONNECTED: 41 | USE_SERIAL.printf("[WSc] Disconnected!\n"); 42 | break; 43 | case WStype_CONNECTED: 44 | USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload); 45 | 46 | // send message to server when Connected 47 | webSocket.sendTXT("Connected"); 48 | break; 49 | case WStype_TEXT: 50 | USE_SERIAL.printf("[WSc] get text: %s\n", payload); 51 | 52 | // send message to server 53 | // webSocket.sendTXT("message here"); 54 | break; 55 | case WStype_BIN: 56 | USE_SERIAL.printf("[WSc] get binary length: %u\n", length); 57 | hexdump(payload, length); 58 | 59 | // send data to server 60 | // webSocket.sendBIN(payload, length); 61 | break; 62 | } 63 | 64 | } 65 | 66 | void setup() { 67 | // USE_SERIAL.begin(921600); 68 | USE_SERIAL.begin(115200); 69 | 70 | //Serial.setDebugOutput(true); 71 | USE_SERIAL.setDebugOutput(true); 72 | 73 | USE_SERIAL.println(); 74 | USE_SERIAL.println(); 75 | USE_SERIAL.println(); 76 | 77 | for(uint8_t t = 4; t > 0; t--) { 78 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 79 | USE_SERIAL.flush(); 80 | delay(1000); 81 | } 82 | 83 | WiFiMulti.addAP("SSID", "passpasspass"); 84 | 85 | //WiFi.disconnect(); 86 | while(WiFiMulti.run() != WL_CONNECTED) { 87 | delay(100); 88 | } 89 | 90 | // server address, port and URL 91 | webSocket.begin("192.168.0.123", 81, "/"); 92 | 93 | // event handler 94 | webSocket.onEvent(webSocketEvent); 95 | 96 | // use HTTP Basic Authorization this is optional remove if not needed 97 | webSocket.setAuthorization("user", "Password"); 98 | 99 | // try ever 5000 again if connection has failed 100 | webSocket.setReconnectInterval(5000); 101 | 102 | } 103 | 104 | void loop() { 105 | webSocket.loop(); 106 | } 107 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp32/WebSocketClientSSL/WebSocketClientSSL.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketClientSSL.ino 3 | * 4 | * Created on: 10.12.2015 5 | * 6 | * note SSL is only possible with the ESP8266 7 | * 8 | */ 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | 19 | WiFiMulti WiFiMulti; 20 | WebSocketsClient webSocket; 21 | 22 | HardwareSerial Serial1(2); 23 | 24 | #define USE_SERIAL Serial1 25 | 26 | void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) { 27 | const uint8_t* src = (const uint8_t*) mem; 28 | USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len); 29 | for(uint32_t i = 0; i < len; i++) { 30 | if(i % cols == 0) { 31 | USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i); 32 | } 33 | USE_SERIAL.printf("%02X ", *src); 34 | src++; 35 | } 36 | USE_SERIAL.printf("\n"); 37 | } 38 | 39 | void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { 40 | 41 | 42 | switch(type) { 43 | case WStype_DISCONNECTED: 44 | USE_SERIAL.printf("[WSc] Disconnected!\n"); 45 | break; 46 | case WStype_CONNECTED: 47 | { 48 | USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload); 49 | 50 | // send message to server when Connected 51 | webSocket.sendTXT("Connected"); 52 | } 53 | break; 54 | case WStype_TEXT: 55 | USE_SERIAL.printf("[WSc] get text: %s\n", payload); 56 | 57 | // send message to server 58 | // webSocket.sendTXT("message here"); 59 | break; 60 | case WStype_BIN: 61 | USE_SERIAL.printf("[WSc] get binary length: %u\n", length); 62 | hexdump(payload, length); 63 | 64 | // send data to server 65 | // webSocket.sendBIN(payload, length); 66 | break; 67 | } 68 | 69 | } 70 | 71 | void setup() { 72 | // USE_SERIAL.begin(921600); 73 | USE_SERIAL.begin(115200); 74 | 75 | //Serial.setDebugOutput(true); 76 | USE_SERIAL.setDebugOutput(true); 77 | 78 | USE_SERIAL.println(); 79 | USE_SERIAL.println(); 80 | USE_SERIAL.println(); 81 | 82 | for(uint8_t t = 4; t > 0; t--) { 83 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 84 | USE_SERIAL.flush(); 85 | delay(1000); 86 | } 87 | 88 | WiFiMulti.addAP("SSID", "passpasspass"); 89 | 90 | //WiFi.disconnect(); 91 | while(WiFiMulti.run() != WL_CONNECTED) { 92 | delay(100); 93 | } 94 | 95 | webSocket.beginSSL("192.168.0.123", 81); 96 | webSocket.onEvent(webSocketEvent); 97 | 98 | } 99 | 100 | void loop() { 101 | webSocket.loop(); 102 | } 103 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp32/WebSocketServer/WebSocketServer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketServer.ino 3 | * 4 | * Created on: 22.05.2015 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | WiFiMulti WiFiMulti; 17 | WebSocketsServer webSocket = WebSocketsServer(81); 18 | 19 | HardwareSerial Serial1(2); 20 | 21 | #define USE_SERIAL Serial1 22 | 23 | void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) { 24 | const uint8_t* src = (const uint8_t*) mem; 25 | USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len); 26 | for(uint32_t i = 0; i < len; i++) { 27 | if(i % cols == 0) { 28 | USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i); 29 | } 30 | USE_SERIAL.printf("%02X ", *src); 31 | src++; 32 | } 33 | USE_SERIAL.printf("\n"); 34 | } 35 | 36 | void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) { 37 | 38 | switch(type) { 39 | case WStype_DISCONNECTED: 40 | USE_SERIAL.printf("[%u] Disconnected!\n", num); 41 | break; 42 | case WStype_CONNECTED: 43 | { 44 | IPAddress ip = webSocket.remoteIP(num); 45 | USE_SERIAL.printf("[%u] Connected from %d.%d.%d.%d url: %s\n", num, ip[0], ip[1], ip[2], ip[3], payload); 46 | 47 | // send message to client 48 | webSocket.sendTXT(num, "Connected"); 49 | } 50 | break; 51 | case WStype_TEXT: 52 | USE_SERIAL.printf("[%u] get Text: %s\n", num, payload); 53 | 54 | // send message to client 55 | // webSocket.sendTXT(num, "message here"); 56 | 57 | // send data to all connected clients 58 | // webSocket.broadcastTXT("message here"); 59 | break; 60 | case WStype_BIN: 61 | USE_SERIAL.printf("[%u] get binary length: %u\n", num, length); 62 | hexdump(payload, length); 63 | 64 | // send message to client 65 | // webSocket.sendBIN(num, payload, length); 66 | break; 67 | } 68 | 69 | } 70 | 71 | void setup() { 72 | // USE_SERIAL.begin(921600); 73 | USE_SERIAL.begin(115200); 74 | 75 | //Serial.setDebugOutput(true); 76 | USE_SERIAL.setDebugOutput(true); 77 | 78 | USE_SERIAL.println(); 79 | USE_SERIAL.println(); 80 | USE_SERIAL.println(); 81 | 82 | for(uint8_t t = 4; t > 0; t--) { 83 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 84 | USE_SERIAL.flush(); 85 | delay(1000); 86 | } 87 | 88 | WiFiMulti.addAP("SSID", "passpasspass"); 89 | 90 | while(WiFiMulti.run() != WL_CONNECTED) { 91 | delay(100); 92 | } 93 | 94 | webSocket.begin(); 95 | webSocket.onEvent(webSocketEvent); 96 | } 97 | 98 | void loop() { 99 | webSocket.loop(); 100 | } 101 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp8266/WebSocketClient/WebSocketClient.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketClient.ino 3 | * 4 | * Created on: 24.05.2015 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | ESP8266WiFiMulti WiFiMulti; 18 | WebSocketsClient webSocket; 19 | 20 | #define USE_SERIAL Serial1 21 | 22 | void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { 23 | 24 | switch(type) { 25 | case WStype_DISCONNECTED: 26 | USE_SERIAL.printf("[WSc] Disconnected!\n"); 27 | break; 28 | case WStype_CONNECTED: { 29 | USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload); 30 | 31 | // send message to server when Connected 32 | webSocket.sendTXT("Connected"); 33 | } 34 | break; 35 | case WStype_TEXT: 36 | USE_SERIAL.printf("[WSc] get text: %s\n", payload); 37 | 38 | // send message to server 39 | // webSocket.sendTXT("message here"); 40 | break; 41 | case WStype_BIN: 42 | USE_SERIAL.printf("[WSc] get binary length: %u\n", length); 43 | hexdump(payload, length); 44 | 45 | // send data to server 46 | // webSocket.sendBIN(payload, length); 47 | break; 48 | } 49 | 50 | } 51 | 52 | void setup() { 53 | // USE_SERIAL.begin(921600); 54 | USE_SERIAL.begin(115200); 55 | 56 | //Serial.setDebugOutput(true); 57 | USE_SERIAL.setDebugOutput(true); 58 | 59 | USE_SERIAL.println(); 60 | USE_SERIAL.println(); 61 | USE_SERIAL.println(); 62 | 63 | for(uint8_t t = 4; t > 0; t--) { 64 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 65 | USE_SERIAL.flush(); 66 | delay(1000); 67 | } 68 | 69 | WiFiMulti.addAP("SSID", "passpasspass"); 70 | 71 | //WiFi.disconnect(); 72 | while(WiFiMulti.run() != WL_CONNECTED) { 73 | delay(100); 74 | } 75 | 76 | // server address, port and URL 77 | webSocket.begin("192.168.0.123", 81, "/"); 78 | 79 | // event handler 80 | webSocket.onEvent(webSocketEvent); 81 | 82 | // use HTTP Basic Authorization this is optional remove if not needed 83 | webSocket.setAuthorization("user", "Password"); 84 | 85 | // try ever 5000 again if connection has failed 86 | webSocket.setReconnectInterval(5000); 87 | 88 | } 89 | 90 | void loop() { 91 | webSocket.loop(); 92 | } 93 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp8266/WebSocketClientSSL/WebSocketClientSSL.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketClientSSL.ino 3 | * 4 | * Created on: 10.12.2015 5 | * 6 | * note SSL is only possible with the ESP8266 7 | * 8 | */ 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include 18 | 19 | ESP8266WiFiMulti WiFiMulti; 20 | WebSocketsClient webSocket; 21 | 22 | 23 | #define USE_SERIAL Serial1 24 | 25 | void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { 26 | 27 | 28 | switch(type) { 29 | case WStype_DISCONNECTED: 30 | USE_SERIAL.printf("[WSc] Disconnected!\n"); 31 | break; 32 | case WStype_CONNECTED: 33 | { 34 | USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload); 35 | 36 | // send message to server when Connected 37 | webSocket.sendTXT("Connected"); 38 | } 39 | break; 40 | case WStype_TEXT: 41 | USE_SERIAL.printf("[WSc] get text: %s\n", payload); 42 | 43 | // send message to server 44 | // webSocket.sendTXT("message here"); 45 | break; 46 | case WStype_BIN: 47 | USE_SERIAL.printf("[WSc] get binary length: %u\n", length); 48 | hexdump(payload, length); 49 | 50 | // send data to server 51 | // webSocket.sendBIN(payload, length); 52 | break; 53 | } 54 | 55 | } 56 | 57 | void setup() { 58 | // USE_SERIAL.begin(921600); 59 | USE_SERIAL.begin(115200); 60 | 61 | //Serial.setDebugOutput(true); 62 | USE_SERIAL.setDebugOutput(true); 63 | 64 | USE_SERIAL.println(); 65 | USE_SERIAL.println(); 66 | USE_SERIAL.println(); 67 | 68 | for(uint8_t t = 4; t > 0; t--) { 69 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 70 | USE_SERIAL.flush(); 71 | delay(1000); 72 | } 73 | 74 | WiFiMulti.addAP("SSID", "passpasspass"); 75 | 76 | //WiFi.disconnect(); 77 | while(WiFiMulti.run() != WL_CONNECTED) { 78 | delay(100); 79 | } 80 | 81 | webSocket.beginSSL("192.168.0.123", 81); 82 | webSocket.onEvent(webSocketEvent); 83 | 84 | } 85 | 86 | void loop() { 87 | webSocket.loop(); 88 | } 89 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp8266/WebSocketClientSocketIO/WebSocketClientSocketIO.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketClientSocketIO.ino 3 | * 4 | * Created on: 06.06.2016 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | ESP8266WiFiMulti WiFiMulti; 18 | WebSocketsClient webSocket; 19 | 20 | 21 | #define USE_SERIAL Serial1 22 | 23 | #define MESSAGE_INTERVAL 30000 24 | #define HEARTBEAT_INTERVAL 25000 25 | 26 | uint64_t messageTimestamp = 0; 27 | uint64_t heartbeatTimestamp = 0; 28 | bool isConnected = false; 29 | 30 | void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) { 31 | 32 | 33 | switch(type) { 34 | case WStype_DISCONNECTED: 35 | USE_SERIAL.printf("[WSc] Disconnected!\n"); 36 | isConnected = false; 37 | break; 38 | case WStype_CONNECTED: 39 | { 40 | USE_SERIAL.printf("[WSc] Connected to url: %s\n", payload); 41 | isConnected = true; 42 | 43 | // send message to server when Connected 44 | // socket.io upgrade confirmation message (required) 45 | webSocket.sendTXT("5"); 46 | } 47 | break; 48 | case WStype_TEXT: 49 | USE_SERIAL.printf("[WSc] get text: %s\n", payload); 50 | 51 | // send message to server 52 | // webSocket.sendTXT("message here"); 53 | break; 54 | case WStype_BIN: 55 | USE_SERIAL.printf("[WSc] get binary length: %u\n", length); 56 | hexdump(payload, length); 57 | 58 | // send data to server 59 | // webSocket.sendBIN(payload, length); 60 | break; 61 | } 62 | 63 | } 64 | 65 | void setup() { 66 | // USE_SERIAL.begin(921600); 67 | USE_SERIAL.begin(115200); 68 | 69 | //Serial.setDebugOutput(true); 70 | USE_SERIAL.setDebugOutput(true); 71 | 72 | USE_SERIAL.println(); 73 | USE_SERIAL.println(); 74 | USE_SERIAL.println(); 75 | 76 | for(uint8_t t = 4; t > 0; t--) { 77 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 78 | USE_SERIAL.flush(); 79 | delay(1000); 80 | } 81 | 82 | WiFiMulti.addAP("SSID", "passpasspass"); 83 | 84 | //WiFi.disconnect(); 85 | while(WiFiMulti.run() != WL_CONNECTED) { 86 | delay(100); 87 | } 88 | 89 | webSocket.beginSocketIO("192.168.0.123", 81); 90 | //webSocket.setAuthorization("user", "Password"); // HTTP Basic Authorization 91 | webSocket.onEvent(webSocketEvent); 92 | 93 | } 94 | 95 | void loop() { 96 | webSocket.loop(); 97 | 98 | if(isConnected) { 99 | 100 | uint64_t now = millis(); 101 | 102 | if(now - messageTimestamp > MESSAGE_INTERVAL) { 103 | messageTimestamp = now; 104 | // example socket.io message with type "messageType" and JSON payload 105 | webSocket.sendTXT("42[\"messageType\",{\"greeting\":\"hello\"}]"); 106 | } 107 | if((now - heartbeatTimestamp) > HEARTBEAT_INTERVAL) { 108 | heartbeatTimestamp = now; 109 | // socket.io heartbeat message 110 | webSocket.sendTXT("2"); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp8266/WebSocketServer/WebSocketServer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketServer.ino 3 | * 4 | * Created on: 22.05.2015 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | ESP8266WiFiMulti WiFiMulti; 16 | 17 | WebSocketsServer webSocket = WebSocketsServer(81); 18 | 19 | #define USE_SERIAL Serial1 20 | 21 | void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) { 22 | 23 | switch(type) { 24 | case WStype_DISCONNECTED: 25 | USE_SERIAL.printf("[%u] Disconnected!\n", num); 26 | break; 27 | case WStype_CONNECTED: 28 | { 29 | IPAddress ip = webSocket.remoteIP(num); 30 | USE_SERIAL.printf("[%u] Connected from %d.%d.%d.%d url: %s\n", num, ip[0], ip[1], ip[2], ip[3], payload); 31 | 32 | // send message to client 33 | webSocket.sendTXT(num, "Connected"); 34 | } 35 | break; 36 | case WStype_TEXT: 37 | USE_SERIAL.printf("[%u] get Text: %s\n", num, payload); 38 | 39 | // send message to client 40 | // webSocket.sendTXT(num, "message here"); 41 | 42 | // send data to all connected clients 43 | // webSocket.broadcastTXT("message here"); 44 | break; 45 | case WStype_BIN: 46 | USE_SERIAL.printf("[%u] get binary length: %u\n", num, length); 47 | hexdump(payload, length); 48 | 49 | // send message to client 50 | // webSocket.sendBIN(num, payload, length); 51 | break; 52 | } 53 | 54 | } 55 | 56 | void setup() { 57 | // USE_SERIAL.begin(921600); 58 | USE_SERIAL.begin(115200); 59 | 60 | //Serial.setDebugOutput(true); 61 | USE_SERIAL.setDebugOutput(true); 62 | 63 | USE_SERIAL.println(); 64 | USE_SERIAL.println(); 65 | USE_SERIAL.println(); 66 | 67 | for(uint8_t t = 4; t > 0; t--) { 68 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 69 | USE_SERIAL.flush(); 70 | delay(1000); 71 | } 72 | 73 | WiFiMulti.addAP("SSID", "passpasspass"); 74 | 75 | while(WiFiMulti.run() != WL_CONNECTED) { 76 | delay(100); 77 | } 78 | 79 | webSocket.begin(); 80 | webSocket.onEvent(webSocketEvent); 81 | } 82 | 83 | void loop() { 84 | webSocket.loop(); 85 | } 86 | 87 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp8266/WebSocketServerFragmentation/WebSocketServerFragmentation.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketServer.ino 3 | * 4 | * Created on: 22.05.2015 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | ESP8266WiFiMulti WiFiMulti; 16 | 17 | WebSocketsServer webSocket = WebSocketsServer(81); 18 | 19 | #define USE_SERIAL Serial 20 | 21 | String fragmentBuffer = ""; 22 | 23 | void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) { 24 | 25 | switch(type) { 26 | case WStype_DISCONNECTED: 27 | USE_SERIAL.printf("[%u] Disconnected!\n", num); 28 | break; 29 | case WStype_CONNECTED: { 30 | IPAddress ip = webSocket.remoteIP(num); 31 | USE_SERIAL.printf("[%u] Connected from %d.%d.%d.%d url: %s\n", num, ip[0], ip[1], ip[2], ip[3], payload); 32 | 33 | // send message to client 34 | webSocket.sendTXT(num, "Connected"); 35 | } 36 | break; 37 | case WStype_TEXT: 38 | USE_SERIAL.printf("[%u] get Text: %s\n", num, payload); 39 | break; 40 | case WStype_BIN: 41 | USE_SERIAL.printf("[%u] get binary length: %u\n", num, length); 42 | hexdump(payload, length); 43 | break; 44 | 45 | // Fragmentation / continuation opcode handling 46 | // case WStype_FRAGMENT_BIN_START: 47 | case WStype_FRAGMENT_TEXT_START: 48 | fragmentBuffer = (char*)payload; 49 | USE_SERIAL.printf("[%u] get start start of Textfragment: %s\n", num, payload); 50 | break; 51 | case WStype_FRAGMENT: 52 | fragmentBuffer += (char*)payload; 53 | USE_SERIAL.printf("[%u] get Textfragment : %s\n", num, payload); 54 | break; 55 | case WStype_FRAGMENT_FIN: 56 | fragmentBuffer += (char*)payload; 57 | USE_SERIAL.printf("[%u] get end of Textfragment: %s\n", num, payload); 58 | USE_SERIAL.printf("[%u] full frame: %s\n", num, fragmentBuffer.c_str()); 59 | break; 60 | } 61 | 62 | } 63 | 64 | void setup() { 65 | // USE_SERIAL.begin(921600); 66 | USE_SERIAL.begin(115200); 67 | 68 | //Serial.setDebugOutput(true); 69 | USE_SERIAL.setDebugOutput(true); 70 | 71 | USE_SERIAL.println(); 72 | USE_SERIAL.println(); 73 | USE_SERIAL.println(); 74 | 75 | for(uint8_t t = 4; t > 0; t--) { 76 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 77 | USE_SERIAL.flush(); 78 | delay(1000); 79 | } 80 | 81 | WiFiMulti.addAP("SSID", "passpasspass"); 82 | 83 | while(WiFiMulti.run() != WL_CONNECTED) { 84 | delay(100); 85 | } 86 | 87 | webSocket.begin(); 88 | webSocket.onEvent(webSocketEvent); 89 | } 90 | 91 | void loop() { 92 | webSocket.loop(); 93 | } 94 | 95 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp8266/WebSocketServerHttpHeaderValidation/WebSocketServerHttpHeaderValidation.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketServerHttpHeaderValidation.ino 3 | * 4 | * Created on: 08.06.2016 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | ESP8266WiFiMulti WiFiMulti; 16 | 17 | WebSocketsServer webSocket = WebSocketsServer(81); 18 | 19 | #define USE_SERIAL Serial1 20 | 21 | const unsigned long int validSessionId = 12345; //some arbitrary value to act as a valid sessionId 22 | 23 | /* 24 | * Returns a bool value as an indicator to describe whether a user is allowed to initiate a websocket upgrade 25 | * based on the value of a cookie. This function expects the rawCookieHeaderValue to look like this "sessionId=|" 26 | */ 27 | bool isCookieValid(String rawCookieHeaderValue) { 28 | 29 | if (rawCookieHeaderValue.indexOf("sessionId") != -1) { 30 | String sessionIdStr = rawCookieHeaderValue.substring(rawCookieHeaderValue.indexOf("sessionId=") + 10, rawCookieHeaderValue.indexOf("|")); 31 | unsigned long int sessionId = strtoul(sessionIdStr.c_str(), NULL, 10); 32 | return sessionId == validSessionId; 33 | } 34 | return false; 35 | } 36 | 37 | /* 38 | * The WebSocketServerHttpHeaderValFunc delegate passed to webSocket.onValidateHttpHeader 39 | */ 40 | bool validateHttpHeader(String headerName, String headerValue) { 41 | 42 | //assume a true response for any headers not handled by this validator 43 | bool valid = true; 44 | 45 | if(headerName.equalsIgnoreCase("Cookie")) { 46 | //if the header passed is the Cookie header, validate it according to the rules in 'isCookieValid' function 47 | valid = isCookieValid(headerValue); 48 | } 49 | 50 | return valid; 51 | } 52 | 53 | void setup() { 54 | // USE_SERIAL.begin(921600); 55 | USE_SERIAL.begin(115200); 56 | 57 | //Serial.setDebugOutput(true); 58 | USE_SERIAL.setDebugOutput(true); 59 | 60 | USE_SERIAL.println(); 61 | USE_SERIAL.println(); 62 | USE_SERIAL.println(); 63 | 64 | for(uint8_t t = 4; t > 0; t--) { 65 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 66 | USE_SERIAL.flush(); 67 | delay(1000); 68 | } 69 | 70 | WiFiMulti.addAP("SSID", "passpasspass"); 71 | 72 | while(WiFiMulti.run() != WL_CONNECTED) { 73 | delay(100); 74 | } 75 | 76 | //connecting clients must supply a valid session cookie at websocket upgrade handshake negotiation time 77 | const char * headerkeys[] = { "Cookie" }; 78 | size_t headerKeyCount = sizeof(headerkeys) / sizeof(char*); 79 | webSocket.onValidateHttpHeader(validateHttpHeader, headerkeys, headerKeyCount); 80 | webSocket.begin(); 81 | } 82 | 83 | void loop() { 84 | webSocket.loop(); 85 | } 86 | 87 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/esp8266/WebSocketServer_LEDcontrol/WebSocketServer_LEDcontrol.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WebSocketServer_LEDcontrol.ino 3 | * 4 | * Created on: 26.11.2015 5 | * 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #define LED_RED 15 18 | #define LED_GREEN 12 19 | #define LED_BLUE 13 20 | 21 | #define USE_SERIAL Serial 22 | 23 | 24 | ESP8266WiFiMulti WiFiMulti; 25 | 26 | ESP8266WebServer server(80); 27 | WebSocketsServer webSocket = WebSocketsServer(81); 28 | 29 | void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) { 30 | 31 | switch(type) { 32 | case WStype_DISCONNECTED: 33 | USE_SERIAL.printf("[%u] Disconnected!\n", num); 34 | break; 35 | case WStype_CONNECTED: { 36 | IPAddress ip = webSocket.remoteIP(num); 37 | USE_SERIAL.printf("[%u] Connected from %d.%d.%d.%d url: %s\n", num, ip[0], ip[1], ip[2], ip[3], payload); 38 | 39 | // send message to client 40 | webSocket.sendTXT(num, "Connected"); 41 | } 42 | break; 43 | case WStype_TEXT: 44 | USE_SERIAL.printf("[%u] get Text: %s\n", num, payload); 45 | 46 | if(payload[0] == '#') { 47 | // we get RGB data 48 | 49 | // decode rgb data 50 | uint32_t rgb = (uint32_t) strtol((const char *) &payload[1], NULL, 16); 51 | 52 | analogWrite(LED_RED, ((rgb >> 16) & 0xFF)); 53 | analogWrite(LED_GREEN, ((rgb >> 8) & 0xFF)); 54 | analogWrite(LED_BLUE, ((rgb >> 0) & 0xFF)); 55 | } 56 | 57 | break; 58 | } 59 | 60 | } 61 | 62 | void setup() { 63 | //USE_SERIAL.begin(921600); 64 | USE_SERIAL.begin(115200); 65 | 66 | //USE_SERIAL.setDebugOutput(true); 67 | 68 | USE_SERIAL.println(); 69 | USE_SERIAL.println(); 70 | USE_SERIAL.println(); 71 | 72 | for(uint8_t t = 4; t > 0; t--) { 73 | USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); 74 | USE_SERIAL.flush(); 75 | delay(1000); 76 | } 77 | 78 | pinMode(LED_RED, OUTPUT); 79 | pinMode(LED_GREEN, OUTPUT); 80 | pinMode(LED_BLUE, OUTPUT); 81 | 82 | digitalWrite(LED_RED, 1); 83 | digitalWrite(LED_GREEN, 1); 84 | digitalWrite(LED_BLUE, 1); 85 | 86 | WiFiMulti.addAP("SSID", "passpasspass"); 87 | 88 | while(WiFiMulti.run() != WL_CONNECTED) { 89 | delay(100); 90 | } 91 | 92 | // start webSocket server 93 | webSocket.begin(); 94 | webSocket.onEvent(webSocketEvent); 95 | 96 | if(MDNS.begin("esp8266")) { 97 | USE_SERIAL.println("MDNS responder started"); 98 | } 99 | 100 | // handle index 101 | server.on("/", []() { 102 | // send index.html 103 | server.send(200, "text/html", "LED Control:

R:
G:
B:
"); 104 | }); 105 | 106 | server.begin(); 107 | 108 | // Add service to MDNS 109 | MDNS.addService("http", "tcp", 80); 110 | MDNS.addService("ws", "tcp", 81); 111 | 112 | digitalWrite(LED_RED, 0); 113 | digitalWrite(LED_GREEN, 0); 114 | digitalWrite(LED_BLUE, 0); 115 | 116 | } 117 | 118 | void loop() { 119 | webSocket.loop(); 120 | server.handleClient(); 121 | } 122 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/examples/particle/ParticleWebSocketClient/application.cpp: -------------------------------------------------------------------------------- 1 | /* To compile using make CLI, create a folder under \firmware\user\applications and copy application.cpp there. 2 | * Then, copy src files under particleWebSocket folder. 3 | */ 4 | 5 | #include "application.h" 6 | #include "particleWebSocket/WebSocketsClient.h" 7 | 8 | WebSocketsClient webSocket; 9 | 10 | void webSocketEvent(WStype_t type, uint8_t* payload, size_t length) 11 | { 12 | switch (type) 13 | { 14 | case WStype_DISCONNECTED: 15 | Serial.printlnf("[WSc] Disconnected!"); 16 | break; 17 | case WStype_CONNECTED: 18 | Serial.printlnf("[WSc] Connected to URL: %s", payload); 19 | webSocket.sendTXT("Connected\r\n"); 20 | break; 21 | case WStype_TEXT: 22 | Serial.printlnf("[WSc] get text: %s", payload); 23 | break; 24 | case WStype_BIN: 25 | Serial.printlnf("[WSc] get binary length: %u", length); 26 | break; 27 | } 28 | } 29 | 30 | void setup() 31 | { 32 | Serial.begin(9600); 33 | 34 | WiFi.setCredentials("[SSID]", "[PASSWORD]", WPA2, WLAN_CIPHER_AES_TKIP); 35 | WiFi.connect(); 36 | 37 | webSocket.begin("192.168.1.153", 85, "/ClientService/?variable=Test1212"); 38 | webSocket.onEvent(webSocketEvent); 39 | } 40 | 41 | void loop() 42 | { 43 | webSocket.sendTXT("Hello world!"); 44 | delay(500); 45 | webSocket.loop(); 46 | } 47 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WebSockets", 3 | "description": "WebSocket Server and Client for Arduino based on RFC6455", 4 | "keywords": "wifi, http, web, server, client, websocket", 5 | "authors": [ 6 | { 7 | "name": "Markus Sattler", 8 | "url": "https://github.com/Links2004", 9 | "maintainer": true 10 | } 11 | ], 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/Links2004/arduinoWebSockets.git" 15 | }, 16 | "version": "2.1.0", 17 | "license": "LGPL-2.1", 18 | "export": { 19 | "exclude": [ 20 | "tests" 21 | ] 22 | }, 23 | "frameworks": "arduino", 24 | "platforms": "atmelavr, espressif8266, espressif32" 25 | } 26 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/library.properties: -------------------------------------------------------------------------------- 1 | name=WebSockets 2 | version=2.1.0 3 | author=Markus Sattler 4 | maintainer=Markus Sattler 5 | sentence=WebSockets for Arduino (Server + Client) 6 | paragraph=use 2.x.x for ESP and 1.3 for AVR 7 | category=Communication 8 | url=https://github.com/Links2004/arduinoWebSockets 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/src/libb64/AUTHORS: -------------------------------------------------------------------------------- 1 | libb64: Base64 Encoding/Decoding Routines 2 | ====================================== 3 | 4 | Authors: 5 | ------- 6 | 7 | Chris Venter chris.venter@gmail.com http://rocketpod.blogspot.com 8 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/src/libb64/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright-Only Dedication (based on United States law) 2 | or Public Domain Certification 3 | 4 | The person or persons who have associated work with this document (the 5 | "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of 6 | his knowledge, the work of authorship identified is in the public domain of the 7 | country from which the work is published, or (b) hereby dedicates whatever 8 | copyright the dedicators holds in the work of authorship identified below (the 9 | "Work") to the public domain. A certifier, moreover, dedicates any copyright 10 | interest he may have in the associated work, and for these purposes, is 11 | described as a "dedicator" below. 12 | 13 | A certifier has taken reasonable steps to verify the copyright status of this 14 | work. Certifier recognizes that his good faith efforts may not shield him from 15 | liability if in fact the work certified is not in the public domain. 16 | 17 | Dedicator makes this dedication for the benefit of the public at large and to 18 | the detriment of the Dedicator's heirs and successors. Dedicator intends this 19 | dedication to be an overt act of relinquishment in perpetuity of all present 20 | and future rights under copyright law, whether vested or contingent, in the 21 | Work. Dedicator understands that such relinquishment of all rights includes 22 | the relinquishment of all rights to enforce (by lawsuit or otherwise) those 23 | copyrights in the Work. 24 | 25 | Dedicator recognizes that, once placed in the public domain, the Work may be 26 | freely reproduced, distributed, transmitted, used, modified, built upon, or 27 | otherwise exploited by anyone for any purpose, commercial or non-commercial, 28 | and in any way, including by methods that have not yet been invented or 29 | conceived. -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/src/libb64/cdecode.c: -------------------------------------------------------------------------------- 1 | /* 2 | cdecoder.c - c source to a base64 decoding algorithm implementation 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifdef ESP8266 9 | #include 10 | #endif 11 | 12 | #if defined(ESP32) 13 | #define CORE_HAS_LIBB64 14 | #endif 15 | 16 | #ifndef CORE_HAS_LIBB64 17 | #include "cdecode_inc.h" 18 | 19 | int base64_decode_value(char value_in) 20 | { 21 | static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; 22 | static const char decoding_size = sizeof(decoding); 23 | value_in -= 43; 24 | if (value_in < 0 || value_in > decoding_size) return -1; 25 | return decoding[(int)value_in]; 26 | } 27 | 28 | void base64_init_decodestate(base64_decodestate* state_in) 29 | { 30 | state_in->step = step_a; 31 | state_in->plainchar = 0; 32 | } 33 | 34 | int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in) 35 | { 36 | const char* codechar = code_in; 37 | char* plainchar = plaintext_out; 38 | char fragment; 39 | 40 | *plainchar = state_in->plainchar; 41 | 42 | switch (state_in->step) 43 | { 44 | while (1) 45 | { 46 | case step_a: 47 | do { 48 | if (codechar == code_in+length_in) 49 | { 50 | state_in->step = step_a; 51 | state_in->plainchar = *plainchar; 52 | return plainchar - plaintext_out; 53 | } 54 | fragment = (char)base64_decode_value(*codechar++); 55 | } while (fragment < 0); 56 | *plainchar = (fragment & 0x03f) << 2; 57 | case step_b: 58 | do { 59 | if (codechar == code_in+length_in) 60 | { 61 | state_in->step = step_b; 62 | state_in->plainchar = *plainchar; 63 | return plainchar - plaintext_out; 64 | } 65 | fragment = (char)base64_decode_value(*codechar++); 66 | } while (fragment < 0); 67 | *plainchar++ |= (fragment & 0x030) >> 4; 68 | *plainchar = (fragment & 0x00f) << 4; 69 | case step_c: 70 | do { 71 | if (codechar == code_in+length_in) 72 | { 73 | state_in->step = step_c; 74 | state_in->plainchar = *plainchar; 75 | return plainchar - plaintext_out; 76 | } 77 | fragment = (char)base64_decode_value(*codechar++); 78 | } while (fragment < 0); 79 | *plainchar++ |= (fragment & 0x03c) >> 2; 80 | *plainchar = (fragment & 0x003) << 6; 81 | case step_d: 82 | do { 83 | if (codechar == code_in+length_in) 84 | { 85 | state_in->step = step_d; 86 | state_in->plainchar = *plainchar; 87 | return plainchar - plaintext_out; 88 | } 89 | fragment = (char)base64_decode_value(*codechar++); 90 | } while (fragment < 0); 91 | *plainchar++ |= (fragment & 0x03f); 92 | } 93 | } 94 | /* control should not reach here */ 95 | return plainchar - plaintext_out; 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/src/libb64/cdecode_inc.h: -------------------------------------------------------------------------------- 1 | /* 2 | cdecode.h - c header for a base64 decoding algorithm 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifndef BASE64_CDECODE_H 9 | #define BASE64_CDECODE_H 10 | 11 | typedef enum 12 | { 13 | step_a, step_b, step_c, step_d 14 | } base64_decodestep; 15 | 16 | typedef struct 17 | { 18 | base64_decodestep step; 19 | char plainchar; 20 | } base64_decodestate; 21 | 22 | void base64_init_decodestate(base64_decodestate* state_in); 23 | 24 | int base64_decode_value(char value_in); 25 | 26 | int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); 27 | 28 | #endif /* BASE64_CDECODE_H */ 29 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/src/libb64/cencode.c: -------------------------------------------------------------------------------- 1 | /* 2 | cencoder.c - c source to a base64 encoding algorithm implementation 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifdef ESP8266 9 | #include 10 | #endif 11 | 12 | #if defined(ESP32) 13 | #define CORE_HAS_LIBB64 14 | #endif 15 | 16 | #ifndef CORE_HAS_LIBB64 17 | #include "cencode_inc.h" 18 | 19 | const int CHARS_PER_LINE = 72; 20 | 21 | void base64_init_encodestate(base64_encodestate* state_in) 22 | { 23 | state_in->step = step_A; 24 | state_in->result = 0; 25 | state_in->stepcount = 0; 26 | } 27 | 28 | char base64_encode_value(char value_in) 29 | { 30 | static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 31 | if (value_in > 63) return '='; 32 | return encoding[(int)value_in]; 33 | } 34 | 35 | int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in) 36 | { 37 | const char* plainchar = plaintext_in; 38 | const char* const plaintextend = plaintext_in + length_in; 39 | char* codechar = code_out; 40 | char result; 41 | char fragment; 42 | 43 | result = state_in->result; 44 | 45 | switch (state_in->step) 46 | { 47 | while (1) 48 | { 49 | case step_A: 50 | if (plainchar == plaintextend) 51 | { 52 | state_in->result = result; 53 | state_in->step = step_A; 54 | return codechar - code_out; 55 | } 56 | fragment = *plainchar++; 57 | result = (fragment & 0x0fc) >> 2; 58 | *codechar++ = base64_encode_value(result); 59 | result = (fragment & 0x003) << 4; 60 | case step_B: 61 | if (plainchar == plaintextend) 62 | { 63 | state_in->result = result; 64 | state_in->step = step_B; 65 | return codechar - code_out; 66 | } 67 | fragment = *plainchar++; 68 | result |= (fragment & 0x0f0) >> 4; 69 | *codechar++ = base64_encode_value(result); 70 | result = (fragment & 0x00f) << 2; 71 | case step_C: 72 | if (plainchar == plaintextend) 73 | { 74 | state_in->result = result; 75 | state_in->step = step_C; 76 | return codechar - code_out; 77 | } 78 | fragment = *plainchar++; 79 | result |= (fragment & 0x0c0) >> 6; 80 | *codechar++ = base64_encode_value(result); 81 | result = (fragment & 0x03f) >> 0; 82 | *codechar++ = base64_encode_value(result); 83 | 84 | ++(state_in->stepcount); 85 | if (state_in->stepcount == CHARS_PER_LINE/4) 86 | { 87 | *codechar++ = '\n'; 88 | state_in->stepcount = 0; 89 | } 90 | } 91 | } 92 | /* control should not reach here */ 93 | return codechar - code_out; 94 | } 95 | 96 | int base64_encode_blockend(char* code_out, base64_encodestate* state_in) 97 | { 98 | char* codechar = code_out; 99 | 100 | switch (state_in->step) 101 | { 102 | case step_B: 103 | *codechar++ = base64_encode_value(state_in->result); 104 | *codechar++ = '='; 105 | *codechar++ = '='; 106 | break; 107 | case step_C: 108 | *codechar++ = base64_encode_value(state_in->result); 109 | *codechar++ = '='; 110 | break; 111 | case step_A: 112 | break; 113 | } 114 | *codechar++ = 0x00; 115 | 116 | return codechar - code_out; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/src/libb64/cencode_inc.h: -------------------------------------------------------------------------------- 1 | /* 2 | cencode.h - c header for a base64 encoding algorithm 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifndef BASE64_CENCODE_H 9 | #define BASE64_CENCODE_H 10 | 11 | typedef enum 12 | { 13 | step_A, step_B, step_C 14 | } base64_encodestep; 15 | 16 | typedef struct 17 | { 18 | base64_encodestep step; 19 | char result; 20 | int stepcount; 21 | } base64_encodestate; 22 | 23 | void base64_init_encodestate(base64_encodestate* state_in); 24 | 25 | char base64_encode_value(char value_in); 26 | 27 | int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); 28 | 29 | int base64_encode_blockend(char* code_out, base64_encodestate* state_in); 30 | 31 | #endif /* BASE64_CENCODE_H */ 32 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/src/libsha1/libsha1.h: -------------------------------------------------------------------------------- 1 | /* ================ sha1.h ================ */ 2 | /* 3 | SHA-1 in C 4 | By Steve Reid 5 | 100% Public Domain 6 | */ 7 | 8 | #if !defined(ESP8266) && !defined(ESP32) 9 | 10 | typedef struct { 11 | uint32_t state[5]; 12 | uint32_t count[2]; 13 | unsigned char buffer[64]; 14 | } SHA1_CTX; 15 | 16 | void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); 17 | void SHA1Init(SHA1_CTX* context); 18 | void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len); 19 | void SHA1Final(unsigned char digest[20], SHA1_CTX* context); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/tests/webSocket.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 40 | 41 | 42 | 43 | LED Control:
44 |
45 | R:
46 | G:
47 | B:
48 | 49 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/tests/webSocketServer/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var WebSocketServer = require('websocket').server; 3 | var http = require('http'); 4 | 5 | var server = http.createServer(function(request, response) { 6 | console.log((new Date()) + ' Received request for ' + request.url); 7 | response.writeHead(404); 8 | response.end(); 9 | }); 10 | server.listen(8011, function() { 11 | console.log((new Date()) + ' Server is listening on port 8011'); 12 | }); 13 | 14 | wsServer = new WebSocketServer({ 15 | httpServer: server, 16 | // You should not use autoAcceptConnections for production 17 | // applications, as it defeats all standard cross-origin protection 18 | // facilities built into the protocol and the browser. You should 19 | // *always* verify the connection's origin and decide whether or not 20 | // to accept it. 21 | autoAcceptConnections: false 22 | }); 23 | 24 | function originIsAllowed(origin) { 25 | // put logic here to detect whether the specified origin is allowed. 26 | return true; 27 | } 28 | 29 | wsServer.on('request', function(request) { 30 | 31 | if (!originIsAllowed(request.origin)) { 32 | // Make sure we only accept requests from an allowed origin 33 | request.reject(); 34 | console.log((new Date()) + ' Connection from origin ' + request.origin + ' rejected.'); 35 | return; 36 | } 37 | 38 | var connection = request.accept('arduino', request.origin); 39 | console.log((new Date()) + ' Connection accepted.'); 40 | 41 | connection.on('message', function(message) { 42 | if (message.type === 'utf8') { 43 | console.log('Received Message: ' + message.utf8Data); 44 | // connection.sendUTF(message.utf8Data); 45 | } 46 | else if (message.type === 'binary') { 47 | console.log('Received Binary Message of ' + message.binaryData.length + ' bytes'); 48 | //connection.sendBytes(message.binaryData); 49 | } 50 | }); 51 | 52 | connection.on('close', function(reasonCode, description) { 53 | console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.'); 54 | }); 55 | 56 | connection.sendUTF("Hallo Client!"); 57 | }); 58 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/tests/webSocketServer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webSocketServer", 3 | "version": "1.0.0", 4 | "description": "WebSocketServer for testing", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/Links2004/arduinoWebSockets" 12 | }, 13 | "keywords": [ 14 | "esp8266", 15 | "websocket", 16 | "arduino" 17 | ], 18 | "author": "Markus Sattler", 19 | "license": "LGPLv2", 20 | "bugs": { 21 | "url": "https://github.com/Links2004/arduinoWebSockets/issues" 22 | }, 23 | "homepage": "https://github.com/Links2004/arduinoWebSockets", 24 | "dependencies": { 25 | "websocket": "^1.0.18" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /libraries/arduinoWebSockets/travis/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function build_sketches() 4 | { 5 | local arduino=$1 6 | local srcpath=$2 7 | local platform=$3 8 | local sketches=$(find $srcpath -name *.ino) 9 | for sketch in $sketches; do 10 | local sketchdir=$(dirname $sketch) 11 | if [[ -f "$sketchdir/.$platform.skip" ]]; then 12 | echo -e "\n\n ------------ Skipping $sketch ------------ \n\n"; 13 | continue 14 | fi 15 | echo -e "\n\n ------------ Building $sketch ------------ \n\n"; 16 | $arduino --verify $sketch; 17 | local result=$? 18 | if [ $result -ne 0 ]; then 19 | echo "Build failed ($sketch) build verbose..." 20 | $arduino --verify --verbose --preserve-temp-files $sketch 21 | result=$? 22 | fi 23 | if [ $result -ne 0 ]; then 24 | echo "Build failed ($1) $sketch" 25 | return $result 26 | fi 27 | done 28 | } 29 | 30 | 31 | function get_core() 32 | { 33 | echo Setup core for $1 34 | 35 | cd $HOME/arduino_ide/hardware 36 | 37 | if [ "$1" = "esp8266" ] ; then 38 | mkdir esp8266com 39 | cd esp8266com 40 | git clone https://github.com/esp8266/Arduino.git esp8266 41 | cd esp8266/tools 42 | python get.py 43 | fi 44 | 45 | if [ "$1" = "esp32" ] ; then 46 | mkdir espressif 47 | cd espressif 48 | git clone https://github.com/espressif/arduino-esp32.git esp32 49 | cd esp32/tools 50 | python get.py 51 | fi 52 | 53 | } 54 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.7" 4 | 5 | # Cache PlatformIO packages using Travis CI container-based infrastructure 6 | sudo: false 7 | cache: 8 | directories: 9 | - "~/.platformio" 10 | 11 | env: 12 | - PLATFORMIO_CI_SRC=examples/SSD1306UiDemo 13 | - PLATFORMIO_CI_SRC=examples/SSD1306SimpleDemo 14 | - PLATFORMIO_CI_SRC=examples/SSD1306DrawingDemo 15 | - PLATFORMIO_CI_SRC=examples/SSD1306OTADemo 16 | - PLATFORMIO_CI_SRC=examples/SSD1306ClockDemo 17 | 18 | 19 | install: 20 | - pip install -U platformio 21 | - platformio lib install 44 22 | 23 | script: 24 | - platformio ci --lib="." --board=nodemcuv2 25 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/SH1106.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 by Daniel Eichhorn 5 | * Copyright (c) 2016 by Fabrice Weinberg 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Credits for parts of this code go to Mike Rankin. Thank you so much for sharing! 26 | */ 27 | 28 | #ifndef SH1106_h 29 | #define SH1106_h 30 | #include "SH1106Wire.h" 31 | 32 | // For make SH1106 an alias for SH1106Wire 33 | typedef SH1106Wire SH1106; 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/SH1106Brzo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 by Daniel Eichhorn 5 | * Copyright (c) 2016 by Fabrice Weinberg 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Credits for parts of this code go to Mike Rankin. Thank you so much for sharing! 26 | */ 27 | 28 | #ifndef SH1106Brzo_h 29 | #define SH1106Brzo_h 30 | 31 | #include "OLEDDisplay.h" 32 | #include 33 | 34 | #if F_CPU == 160000000L 35 | #define BRZO_I2C_SPEED 1000 36 | #else 37 | #define BRZO_I2C_SPEED 800 38 | #endif 39 | 40 | class SH1106Brzo : public OLEDDisplay { 41 | private: 42 | uint8_t _address; 43 | uint8_t _sda; 44 | uint8_t _scl; 45 | 46 | public: 47 | SH1106Brzo(uint8_t _address, uint8_t _sda, uint8_t _scl) { 48 | this->_address = _address; 49 | this->_sda = _sda; 50 | this->_scl = _scl; 51 | } 52 | 53 | bool connect(){ 54 | brzo_i2c_setup(_sda, _scl, 0); 55 | return true; 56 | } 57 | 58 | void display(void) { 59 | #ifdef OLEDDISPLAY_DOUBLE_BUFFER 60 | uint8_t minBoundY = ~0; 61 | uint8_t maxBoundY = 0; 62 | 63 | uint8_t minBoundX = ~0; 64 | uint8_t maxBoundX = 0; 65 | uint8_t x, y; 66 | 67 | // Calculate the Y bounding box of changes 68 | // and copy buffer[pos] to buffer_back[pos]; 69 | for (y = 0; y < (DISPLAY_HEIGHT / 8); y++) { 70 | for (x = 0; x < DISPLAY_WIDTH; x++) { 71 | uint16_t pos = x + y * DISPLAY_WIDTH; 72 | if (buffer[pos] != buffer_back[pos]) { 73 | minBoundY = _min(minBoundY, y); 74 | maxBoundY = _max(maxBoundY, y); 75 | minBoundX = _min(minBoundX, x); 76 | maxBoundX = _max(maxBoundX, x); 77 | } 78 | buffer_back[pos] = buffer[pos]; 79 | } 80 | optimistic_yield(10000); 81 | } 82 | 83 | // If the minBoundY wasn't updated 84 | // we can savely assume that buffer_back[pos] == buffer[pos] 85 | // holdes true for all values of pos 86 | if (minBoundY == ~0) return; 87 | 88 | byte k = 0; 89 | uint8_t sendBuffer[17]; 90 | sendBuffer[0] = 0x40; 91 | 92 | // Calculate the colum offset 93 | uint8_t minBoundXp2H = (minBoundX + 2) & 0x0F; 94 | uint8_t minBoundXp2L = 0x10 | ((minBoundX + 2) >> 4 ); 95 | 96 | brzo_i2c_start_transaction(this->_address, BRZO_I2C_SPEED); 97 | 98 | for (y = minBoundY; y <= maxBoundY; y++) { 99 | sendCommand(0xB0 + y); 100 | sendCommand(minBoundXp2H); 101 | sendCommand(minBoundXp2L); 102 | for (x = minBoundX; x <= maxBoundX; x++) { 103 | k++; 104 | sendBuffer[k] = buffer[x + y * DISPLAY_WIDTH]; 105 | if (k == 16) { 106 | brzo_i2c_write(sendBuffer, 17, true); 107 | k = 0; 108 | } 109 | } 110 | if (k != 0) { 111 | brzo_i2c_write(sendBuffer, k + 1, true); 112 | k = 0; 113 | } 114 | optimistic_yield(10000); 115 | } 116 | if (k != 0) { 117 | brzo_i2c_write(sendBuffer, k + 1, true); 118 | } 119 | brzo_i2c_end_transaction(); 120 | #else 121 | #endif 122 | } 123 | 124 | private: 125 | inline void sendCommand(uint8_t com) __attribute__((always_inline)){ 126 | uint8_t command[2] = {0x80 /* command mode */, com}; 127 | brzo_i2c_start_transaction(_address, BRZO_I2C_SPEED); 128 | brzo_i2c_write(command, 2, true); 129 | brzo_i2c_end_transaction(); 130 | } 131 | }; 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/SH1106Spi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 by Daniel Eichhorn 5 | * Copyright (c) 2016 by Fabrice Weinberg 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Credits for parts of this code go to Mike Rankin. Thank you so much for sharing! 26 | */ 27 | 28 | #ifndef SH1106Spi_h 29 | #define SH1106Spi_h 30 | 31 | #include "OLEDDisplay.h" 32 | #include 33 | 34 | class SH1106Spi : public OLEDDisplay { 35 | private: 36 | uint8_t _rst; 37 | uint8_t _dc; 38 | 39 | public: 40 | 41 | SH1106Spi(uint8_t _rst, uint8_t _dc) { 42 | this->_rst = _rst; 43 | this->_dc = _dc; 44 | } 45 | 46 | bool connect(){ 47 | pinMode(_dc, OUTPUT); 48 | pinMode(_rst, OUTPUT); 49 | 50 | SPI.begin (); 51 | SPI.setClockDivider (SPI_CLOCK_DIV2); 52 | 53 | // Pulse Reset low for 10ms 54 | digitalWrite(_rst, HIGH); 55 | delay(1); 56 | digitalWrite(_rst, LOW); 57 | delay(10); 58 | digitalWrite(_rst, HIGH); 59 | return true; 60 | } 61 | 62 | void display(void) { 63 | #ifdef OLEDDISPLAY_DOUBLE_BUFFER 64 | uint8_t minBoundY = ~0; 65 | uint8_t maxBoundY = 0; 66 | 67 | uint8_t minBoundX = ~0; 68 | uint8_t maxBoundX = 0; 69 | 70 | uint8_t x, y; 71 | 72 | // Calculate the Y bounding box of changes 73 | // and copy buffer[pos] to buffer_back[pos]; 74 | for (y = 0; y < (DISPLAY_HEIGHT / 8); y++) { 75 | for (x = 0; x < DISPLAY_WIDTH; x++) { 76 | uint16_t pos = x + y * DISPLAY_WIDTH; 77 | if (buffer[pos] != buffer_back[pos]) { 78 | minBoundY = _min(minBoundY, y); 79 | maxBoundY = _max(maxBoundY, y); 80 | minBoundX = _min(minBoundX, x); 81 | maxBoundX = _max(maxBoundX, x); 82 | } 83 | buffer_back[pos] = buffer[pos]; 84 | } 85 | optimistic_yield(10000); 86 | } 87 | 88 | // If the minBoundY wasn't updated 89 | // we can savely assume that buffer_back[pos] == buffer[pos] 90 | // holdes true for all values of pos 91 | if (minBoundY == ~0) return; 92 | 93 | // Calculate the colum offset 94 | uint8_t minBoundXp2H = (minBoundX + 2) & 0x0F; 95 | uint8_t minBoundXp2L = 0x10 | ((minBoundX + 2) >> 4 ); 96 | 97 | for (y = minBoundY; y <= maxBoundY; y++) { 98 | sendCommand(0xB0 + y); 99 | sendCommand(minBoundXp2H); 100 | sendCommand(minBoundXp2L); 101 | digitalWrite(_dc, HIGH); // data mode 102 | for (x = minBoundX; x <= maxBoundX; x++) { 103 | SPI.transfer(buffer[x + y * DISPLAY_WIDTH]); 104 | } 105 | optimistic_yield(10000); 106 | } 107 | #else 108 | for (uint8_t y=0; y 29 | 30 | // OTA Includes 31 | #include 32 | #include 33 | 34 | const char *ssid = "[Your SSID]"; 35 | const char *password = "[Your Password]"; 36 | 37 | 38 | // Include the correct display library 39 | // For a connection via I2C using Wire include 40 | #include // Only needed for Arduino 1.6.5 and earlier 41 | #include "SSD1306.h" // alias for `#include "SSD1306Wire.h"` 42 | // or #include "SH1106.h" alis for `#include "SH1106Wire.h"` 43 | // For a connection via I2C using brzo_i2c (must be installed) include 44 | // #include // Only needed for Arduino 1.6.5 and earlier 45 | // #include "SSD1306Brzo.h" 46 | // #include "SH1106Brzo.h" 47 | // For a connection via SPI include 48 | // #include // Only needed for Arduino 1.6.5 and earlier 49 | // #include "SSD1306Spi.h" 50 | // #include "SH1106SPi.h" 51 | 52 | // Use the corresponding display class: 53 | 54 | // Initialize the OLED display using SPI 55 | // D5 -> CLK 56 | // D7 -> MOSI (DOUT) 57 | // D0 -> RES 58 | // D2 -> DC 59 | // D8 -> CS 60 | // SSD1306Spi display(D0, D2, D8); 61 | // or 62 | // SH1106Spi display(D0, D2); 63 | 64 | // Initialize the OLED display using brzo_i2c 65 | // D3 -> SDA 66 | // D5 -> SCL 67 | // SSD1306Brzo display(0x3c, D3, D5); 68 | // or 69 | // SH1106Brzo display(0x3c, D3, D5); 70 | 71 | // Initialize the OLED display using Wire library 72 | SSD1306 display(0x3c, D3, D5); 73 | // SH1106 display(0x3c, D3, D5); 74 | 75 | 76 | void setup() { 77 | WiFi.begin ( ssid, password ); 78 | 79 | // Wait for connection 80 | while ( WiFi.status() != WL_CONNECTED ) { 81 | delay ( 10 ); 82 | } 83 | 84 | display.init(); 85 | display.flipScreenVertically(); 86 | display.setContrast(255); 87 | 88 | ArduinoOTA.begin(); 89 | ArduinoOTA.onStart([]() { 90 | display.clear(); 91 | display.setFont(ArialMT_Plain_10); 92 | display.setTextAlignment(TEXT_ALIGN_CENTER_BOTH); 93 | display.drawString(DISPLAY_WIDTH/2, DISPLAY_HEIGHT/2 - 10, "OTA Update"); 94 | display.display(); 95 | }); 96 | 97 | ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { 98 | display.drawProgressBar(4, 32, 120, 8, progress / (total / 100) ); 99 | display.display(); 100 | }); 101 | 102 | ArduinoOTA.onEnd([]() { 103 | display.clear(); 104 | display.setFont(ArialMT_Plain_10); 105 | display.setTextAlignment(TEXT_ALIGN_CENTER_BOTH); 106 | display.drawString(DISPLAY_WIDTH/2, DISPLAY_HEIGHT/2, "Restart"); 107 | display.display(); 108 | }); 109 | 110 | // Align text vertical/horizontal center 111 | display.setTextAlignment(TEXT_ALIGN_CENTER_BOTH); 112 | display.setFont(ArialMT_Plain_10); 113 | display.drawString(DISPLAY_WIDTH/2, DISPLAY_HEIGHT/2, "Ready for OTA:\n" + WiFi.localIP().toString()); 114 | display.display(); 115 | } 116 | 117 | void loop() { 118 | ArduinoOTA.handle(); 119 | } 120 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/examples/SSD1306SimpleDemo/images.h: -------------------------------------------------------------------------------- 1 | #define WiFi_Logo_width 60 2 | #define WiFi_Logo_height 36 3 | const char WiFi_Logo_bits[] PROGMEM = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 7 | 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 9 | 0xFF, 0x03, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 10 | 0x00, 0xFF, 0xFF, 0xFF, 0x07, 0xC0, 0x83, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 11 | 0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00, 12 | 0xC0, 0xFF, 0xFF, 0x7C, 0x00, 0x60, 0x0C, 0x00, 0xC0, 0x31, 0x46, 0x7C, 13 | 0xFC, 0x77, 0x08, 0x00, 0xE0, 0x23, 0xC6, 0x3C, 0xFC, 0x67, 0x18, 0x00, 14 | 0xE0, 0x23, 0xE4, 0x3F, 0x1C, 0x00, 0x18, 0x00, 0xE0, 0x23, 0x60, 0x3C, 15 | 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x03, 0x60, 0x3C, 0x1C, 0x70, 0x18, 0x00, 16 | 0xE0, 0x07, 0x60, 0x3C, 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 17 | 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 18 | 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x8F, 0x71, 0x3C, 19 | 0x1C, 0x70, 0x18, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x08, 0x00, 20 | 0xC0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x0C, 0x00, 0x80, 0xFF, 0xFF, 0x1F, 21 | 0x00, 0x00, 0x06, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x07, 0x00, 22 | 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 23 | 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 24 | 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 25 | 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | }; 29 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/examples/SSD1306UiDemo/images.h: -------------------------------------------------------------------------------- 1 | #define WiFi_Logo_width 60 2 | #define WiFi_Logo_height 36 3 | const char WiFi_Logo_bits[] PROGMEM = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 7 | 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 9 | 0xFF, 0x03, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 10 | 0x00, 0xFF, 0xFF, 0xFF, 0x07, 0xC0, 0x83, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 11 | 0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00, 12 | 0xC0, 0xFF, 0xFF, 0x7C, 0x00, 0x60, 0x0C, 0x00, 0xC0, 0x31, 0x46, 0x7C, 13 | 0xFC, 0x77, 0x08, 0x00, 0xE0, 0x23, 0xC6, 0x3C, 0xFC, 0x67, 0x18, 0x00, 14 | 0xE0, 0x23, 0xE4, 0x3F, 0x1C, 0x00, 0x18, 0x00, 0xE0, 0x23, 0x60, 0x3C, 15 | 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x03, 0x60, 0x3C, 0x1C, 0x70, 0x18, 0x00, 16 | 0xE0, 0x07, 0x60, 0x3C, 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 17 | 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 18 | 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x8F, 0x71, 0x3C, 19 | 0x1C, 0x70, 0x18, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x08, 0x00, 20 | 0xC0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x0C, 0x00, 0x80, 0xFF, 0xFF, 0x1F, 21 | 0x00, 0x00, 0x06, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x07, 0x00, 22 | 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 23 | 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 24 | 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 25 | 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | }; 29 | 30 | const char activeSymbol[] PROGMEM = { 31 | B00000000, 32 | B00000000, 33 | B00011000, 34 | B00100100, 35 | B01000010, 36 | B01000010, 37 | B00100100, 38 | B00011000 39 | }; 40 | 41 | const char inactiveSymbol[] PROGMEM = { 42 | B00000000, 43 | B00000000, 44 | B00000000, 45 | B00000000, 46 | B00011000, 47 | B00011000, 48 | B00000000, 49 | B00000000 50 | }; 51 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ESP8266_SSD1306", 3 | "version": "3.2.7", 4 | "keywords": "ssd1306, oled, display, i2c", 5 | "description": "A I2C display driver for SSD1306 oled displays connected to an ESP8266 or ESP32", 6 | "repository": 7 | { 8 | "type": "git", 9 | "url": "https://github.com/squix78/esp8266-oled-ssd1306.git" 10 | }, 11 | "authors": 12 | [ 13 | { 14 | "name": "Daniel Eichhorn", 15 | "email": "squix78@gmail.com", 16 | "url": "http://blog.squix.ch" 17 | }, 18 | { 19 | "name": "Fabrice Weinberg", 20 | "email": "fabrice@weinberg.me" 21 | } 22 | ], 23 | "frameworks": "arduino", 24 | "platforms": [ 25 | "espressif8266", 26 | "espressif32" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/library.properties: -------------------------------------------------------------------------------- 1 | name=ESP8266 and ESP32 Oled Driver for SSD1306 display 2 | version=3.2.7 3 | author=Daniel Eichhorn, Fabrice Weinberg 4 | maintainer=Daniel Eichhorn 5 | sentence=A I2C display driver for SSD1306 oled displays connected to an ESP8266 or ESP32 6 | paragraph=A I2C display driver for SSD1306 oled displays connected to an ESP8266 or ESP32 7 | category=Display 8 | url=https://github.com/squix78/esp8266-oled-ssd1306 9 | architectures=esp8266,esp32 10 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 by Daniel Eichhorn 4 | Copyright (c) 2016 by Fabrice Weinberg 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | See more at http://blog.squix.ch 25 | -------------------------------------------------------------------------------- /libraries/oled-ssd1306/resources/DemoFrame1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/oled-ssd1306/resources/DemoFrame1.jpg -------------------------------------------------------------------------------- /libraries/oled-ssd1306/resources/DemoFrame2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/oled-ssd1306/resources/DemoFrame2.jpg -------------------------------------------------------------------------------- /libraries/oled-ssd1306/resources/DemoFrame3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/oled-ssd1306/resources/DemoFrame3.jpg -------------------------------------------------------------------------------- /libraries/oled-ssd1306/resources/DemoFrame4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/oled-ssd1306/resources/DemoFrame4.jpg -------------------------------------------------------------------------------- /libraries/oled-ssd1306/resources/FontTool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/oled-ssd1306/resources/FontTool.png -------------------------------------------------------------------------------- /libraries/oled-ssd1306/resources/SPI_version.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/oled-ssd1306/resources/SPI_version.jpg -------------------------------------------------------------------------------- /libraries/oled-ssd1306/resources/xbmPreview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luc-github/ESP3D/d7b3ab4bae72f986165b6cce5fc33dfcca5796a8/libraries/oled-ssd1306/resources/xbmPreview.png -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [platformio] 12 | src_dir = esp3d 13 | build_dir = .pioenvs 14 | lib_dir = libraries 15 | libdeps_dir = .piolibdeps 16 | data_dir = esp3d/data 17 | default_envs = esp8266 18 | 19 | [env:esp32dev] 20 | platform = espressif32@3.0.0 21 | ;theboard 22 | board = esp32dev 23 | framework = arduino 24 | monitor_speed = 115200 25 | monitor_echo = yes 26 | monitor_filters = send_on_enter, colorize, esp32_exception_decoder 27 | ; set frequency to 240MHz 28 | board_build.f_cpu = 240000000L 29 | ; set frequency to 80MHz 30 | board_build.f_flash = 80000000L 31 | board_build.flash_mode = qio 32 | ; None 33 | build_flags = -DCORE_DEBUG_LEVEL=0 34 | board_build.partitions = default.csv 35 | upload_speed = 921600 36 | lib_ignore = 37 | ESPAsyncTCP 38 | 39 | [env:esp8266] 40 | ;esp8266 core 2.5.2 41 | platform = espressif8266@2.2.0 42 | platform_packages = toolchain-xtensa@2.40802.200502 43 | board = esp12e 44 | framework = arduino 45 | monitor_speed = 115200 46 | monitor_echo = yes 47 | monitor_filters = send_on_enter, colorize, esp8266_exception_decoder 48 | ; set frequency to 160MHz 49 | board_build.f_cpu = 160000000L 50 | ; set frequency to 40MHz 51 | board_build.f_flash = 40000000L 52 | board_build.flash_mode = dout 53 | upload_resetmethod = nodemcu 54 | build_flags = 55 | -Wl,-Teagle.flash.4m2m.ld 56 | -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY 57 | -DNONOSDK221=1 58 | -DNDEBUG 59 | -DVTABLES_IN_FLASH 60 | upload_speed = 115200 61 | lib_ignore = 62 | AsyncTCP 63 | ESP32NetBIOS 64 | ESP32SSDP 65 | 66 | ;https://github.com/platformio/platform-espressif8266/releases 67 | [env:esp01s_160mhz_2_7_4] 68 | platform = espressif8266@2.6.2 69 | board = esp01_1m 70 | framework = arduino 71 | monitor_speed = 115200 72 | monitor_echo = yes 73 | monitor_filters = send_on_enter, colorize, esp8266_exception_decoder 74 | board_build.f_cpu = 160000000L 75 | board_build.f_flash = 40000000L 76 | board_build.flash_mode = dout 77 | board_build.ldscript = eagle.flash.1m256.ld 78 | upload_resetmethod = nodemcu 79 | build_flags = 80 | -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY 81 | -DNONOSDK221=1 82 | -DNDEBUG 83 | -DVTABLES_IN_FLASH 84 | upload_speed = 115200 85 | lib_ignore = 86 | AsyncTCP 87 | ESP32NetBIOS 88 | ESP32SSDP 89 | 90 | [env:esp01s_160mhz_2_5_2] 91 | platform = espressif8266@2.2.0 92 | platform_packages = toolchain-xtensa@2.40802.200502 93 | board = esp01_1m 94 | framework = arduino 95 | monitor_speed = 115200 96 | monitor_echo = yes 97 | monitor_filters = send_on_enter, colorize, esp8266_exception_decoder 98 | board_build.f_cpu = 160000000L 99 | board_build.f_flash = 40000000L 100 | board_build.flash_mode = dout 101 | board_build.ldscript = eagle.flash.1m256.ld 102 | upload_resetmethod = nodemcu 103 | build_flags = 104 | -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY 105 | -DNONOSDK221=1 106 | -DNDEBUG 107 | -DVTABLES_IN_FLASH 108 | upload_speed = 115200 109 | lib_ignore = 110 | AsyncTCP 111 | ESP32NetBIOS 112 | ESP32SSDP 113 | --------------------------------------------------------------------------------