├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .envrc ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug.yml │ ├── config.yml │ └── feature_request.md ├── stale.yml └── workflows │ ├── pages.yml │ └── wled-ci.yml ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .vscode ├── extensions.json └── tasks.json ├── Aircoookie_LICENSE ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Microphones.pdf ├── boards ├── esp32_16MB-poe.json └── esp32_16MB.json ├── images ├── Readme.md ├── macbook-pro-space-gray-on-the-wooden-table.jpg ├── walking-with-iphone-x.jpg ├── wled_logo_akemi.png └── wled_logo_old.png ├── include └── README ├── lib └── README ├── package-lock.json ├── package.json ├── pio-scripts ├── obj-dump.py ├── output_bins.py ├── set_version.py ├── strip-floats.py └── user_config_copy.py ├── platformio.ini ├── platformio_override.ini.sample ├── readme.md ├── requirements.in ├── requirements.txt ├── test └── README ├── tools ├── WLED_ESP32_16MB.csv ├── WLED_ESP32_16MB_9MB_FS.csv ├── WLED_ESP32_2MB_noOTA.csv ├── WLED_ESP32_4MB_1MB_FS.csv ├── WLED_ESP32_4MB_256KB_FS.csv ├── WLED_ESP32_8MB.csv ├── cdata.js ├── config_tool.py ├── fps_test.htm ├── json_test.htm ├── multi-update.cmd ├── multi-update.sh ├── partitions-4MB_spiffs-tinyuf2.csv └── plotter.py ├── usermods ├── Animated_Staircase │ ├── Animated_Staircase.h │ └── README.md ├── Artemis_reciever │ ├── readme.md │ └── usermod.cpp ├── BH1750_v2 │ ├── platformio_override.ini │ ├── readme.md │ ├── usermod_bh1750.h │ └── usermods_list.cpp ├── BME280_v2 │ ├── README.md │ └── usermod_bme280.h ├── Cronixie │ ├── readme.md │ └── usermod_cronixie.h ├── DHT │ ├── platformio_override.ini │ ├── readme.md │ └── usermod_dht.h ├── EXAMPLE_v2 │ ├── readme.md │ └── usermod_v2_example.h ├── EleksTube_IPS │ ├── ChipSelect.h │ ├── Hardware.h │ ├── TFTs.h │ ├── User_Setup.h │ ├── readme.md │ └── usermod_elekstube_ips.h ├── Enclosure_with_OLED_temp_ESP07 │ ├── assets │ │ ├── controller.jpg │ │ ├── pcb.png │ │ └── readme.md │ ├── readme.md │ ├── usermod.cpp │ └── usermod_bme280.cpp ├── Fix_unreachable_netservices_v2 │ ├── readme.md │ └── usermod_Fix_unreachable_netservices.h ├── JSON_IR_remote │ ├── 21-key_ir.json │ ├── 24-key_ir.json │ ├── 32-key_ir.json │ ├── 40-key-black_ir.json │ ├── 40-key-blue_ir.json │ ├── 44-key_ir.json │ ├── 6-key_ir.json │ ├── 9-key_ir.json │ ├── IR_Remote_Codes.xlsx │ ├── ir_json_maker.py │ └── readme.md ├── MY9291 │ ├── MY92xx.h │ └── usermode_MY9291.h ├── PIR_sensor_switch │ ├── PIR_Highlight_Standby │ ├── readme.md │ └── usermod_PIR_sensor_switch.h ├── PWM_fan │ ├── readme.md │ └── usermod_PWM_fan.h ├── QuinLED_Dig_Uno_Temp_MQTT │ ├── readme.md │ └── usermod.cpp ├── RTC │ ├── readme.md │ └── usermod_rtc.h ├── RelayBlinds │ ├── index.htm │ ├── presets.json │ ├── readme.md │ └── usermod.cpp ├── SN_Photoresistor │ ├── platformio_override.ini │ ├── readme.md │ ├── usermod_sn_photoresistor.h │ └── usermods_list.cpp ├── ST7789_display │ ├── README.md │ ├── ST7789_display.h │ ├── Setup_ST7789_Display.h │ └── images │ │ └── ST7789_Guide.jpg ├── Si7021_MQTT_HA │ ├── readme.md │ └── usermod_si7021_mqtt_ha.h ├── TTGO-T-Display │ ├── README.md │ ├── assets │ │ ├── ttgo-tdisplay-enclosure1a.png │ │ ├── ttgo-tdisplay-enclosure2a.png │ │ ├── ttgo-tdisplay-enclosure3a.png │ │ ├── ttgo-tdisplay-enclosure4a.png │ │ └── ttgo_hardware1.png │ ├── platformio_override.ini │ └── usermod.cpp ├── Temperature │ ├── platformio_override.ini │ ├── readme.md │ ├── usermod_temperature.h │ └── usermods_list.cpp ├── UserModv2_SunRiseAndSet │ ├── README.md │ └── UserMod_SunRiseAndSet.h ├── VL53L0X_gestures │ ├── readme.md │ └── usermod_vl53l0x_gestures.h ├── Wemos_D1_mini+Wemos32_mini_shield │ ├── readme.md │ ├── usermod.cpp │ └── usermod_bme280.cpp ├── artifx │ ├── arti.h │ ├── arti_wled.h │ ├── artifx.css │ ├── artifx.js │ └── usermod_v2_artifx.h ├── battery_keypad_controller │ ├── README.md │ ├── assets │ │ ├── bat-key-ctrl-1.jpg │ │ ├── bat-key-ctrl-2.jpg │ │ └── bat-key-ctrl-3.jpg │ └── wled06_usermod.ino ├── battery_status_basic │ ├── assets │ │ ├── battery_connection_schematic_01.png │ │ ├── battery_connection_schematic_02.png │ │ └── battery_info_screen.png │ ├── readme.md │ └── usermod_v2_battery_status_basic.h ├── buzzer │ └── usermod_v2_buzzer.h ├── mpu6050_imu │ ├── readme.md │ └── usermod_mpu6050_imu.h ├── mqtt_switch_v2 │ ├── README.md │ └── usermod_mqtt_switch.h ├── multi_relay │ ├── readme.md │ └── usermod_multi_relay.h ├── photoresistor_sensor_mqtt_v1 │ ├── README.md │ └── usermod.cpp ├── project_cars_shiftlight │ ├── readme.md │ └── wled06_usermod.ino ├── quinled-an-penta │ ├── quinled-an-penta.h │ └── readme.md ├── readme.md ├── rgb-rotary-encoder │ ├── readme.md │ └── rgb-rotary-encoder.h ├── rotary_encoder_change_effect │ └── wled06_usermod.ino ├── sensors_to_mqtt │ ├── readme.md │ └── usermod_v2_SensorsToMqtt.h ├── seven_segment_display │ ├── readme.md │ └── usermod_v2_seven_segment_display.h ├── seven_segment_display_reloaded │ ├── readme.md │ └── usermod_seven_segment_reloaded.h ├── stairway_wipe_basic │ ├── readme.md │ ├── stairway-wipe-usermod-v2.h │ └── wled06_usermod.ino ├── usermod_rotary_brightness_color │ ├── README.md │ └── usermod_rotary_brightness_color.h ├── usermod_v2_auto_save │ ├── readme.md │ └── usermod_v2_auto_save.h ├── usermod_v2_four_line_display │ ├── readme.md │ └── usermod_v2_four_line_display.h ├── usermod_v2_four_line_display_ALT │ ├── 4LD_wled_fonts.c │ ├── readme.md │ └── usermod_v2_four_line_display_ALT.h ├── usermod_v2_mode_sort │ ├── readme.md │ └── usermod_v2_mode_sort.h ├── usermod_v2_rotary_encoder_ui │ ├── platformio_override.ini.sample │ ├── readme.md │ └── usermod_v2_rotary_encoder_ui.h ├── usermod_v2_rotary_encoder_ui_ALT │ ├── readme.md │ └── usermod_v2_rotary_encoder_ui_ALT.h ├── usermod_v2_word_clock │ ├── readme.md │ └── usermod_v2_word_clock.h ├── wizlights │ ├── readme.md │ └── wizlights.h └── word-clock-matrix │ ├── Word Clock Baffle.stl │ ├── readme.md │ ├── word clock stencil.svg │ └── word-clock-matrix.cpp ├── wled00.sln └── wled00 ├── FX.cpp ├── FX.h ├── FX_fcn.cpp ├── NodeStruct.h ├── alexa.cpp ├── audio_reactive.h ├── audio_source.h ├── bus_manager.h ├── bus_wrapper.h ├── button.cpp ├── cfg.cpp ├── colors.cpp ├── const.h ├── data ├── 404.htm ├── dmxmap.htm ├── edit.htm ├── favicon.ico ├── icons-ui │ ├── Read Me.txt │ ├── demo-files │ │ ├── demo.css │ │ └── demo.js │ ├── demo.html │ ├── fonts │ │ ├── wled122.woff │ │ └── wled122.woff2 │ ├── selection.json │ └── style.css ├── index.css ├── index.htm ├── index.js ├── iro.js ├── liveview.htm ├── liveviewws.htm ├── liveviewws2D.htm ├── msg.htm ├── rangetouch.js ├── settings.htm ├── settings_dmx.htm ├── settings_leds.htm ├── settings_sec.htm ├── settings_sound.htm ├── settings_sync.htm ├── settings_time.htm ├── settings_ui.htm ├── settings_um.htm ├── settings_wifi.htm ├── style.css ├── update.htm ├── usermod.htm └── welcome.htm ├── dmx.cpp ├── e131.cpp ├── fcn_declare.h ├── file.cpp ├── html_other.h ├── html_settings.h ├── html_ui.h ├── hue.cpp ├── improv.cpp ├── ir.cpp ├── ir_codes.h ├── json.cpp ├── led.cpp ├── lx_parser.cpp ├── mqtt.cpp ├── my_config_sample.h ├── ntp.cpp ├── overlay.cpp ├── palettes.h ├── pin_manager.cpp ├── pin_manager.h ├── playlist.cpp ├── presets.cpp ├── set.cpp ├── src └── dependencies │ ├── async-mqtt-client │ ├── AsyncMqttClient.cpp │ ├── AsyncMqttClient.h │ ├── AsyncMqttClient.hpp │ ├── AsyncMqttClient │ │ ├── Callbacks.hpp │ │ ├── DisconnectReasons.hpp │ │ ├── Flags.hpp │ │ ├── Helpers.hpp │ │ ├── MessageProperties.hpp │ │ ├── Packets │ │ │ ├── ConnAckPacket.cpp │ │ │ ├── ConnAckPacket.hpp │ │ │ ├── Packet.hpp │ │ │ ├── PingRespPacket.cpp │ │ │ ├── PingRespPacket.hpp │ │ │ ├── PubAckPacket.cpp │ │ │ ├── PubAckPacket.hpp │ │ │ ├── PubCompPacket.cpp │ │ │ ├── PubCompPacket.hpp │ │ │ ├── PubRecPacket.cpp │ │ │ ├── PubRecPacket.hpp │ │ │ ├── PubRelPacket.cpp │ │ │ ├── PubRelPacket.hpp │ │ │ ├── PublishPacket.cpp │ │ │ ├── PublishPacket.hpp │ │ │ ├── SubAckPacket.cpp │ │ │ ├── SubAckPacket.hpp │ │ │ ├── UnsubAckPacket.cpp │ │ │ └── UnsubAckPacket.hpp │ │ ├── ParsingInformation.hpp │ │ └── Storage.hpp │ ├── LICENSE │ └── README.md │ ├── dmx │ ├── ESPDMX.cpp │ ├── ESPDMX.h │ ├── LICENSE.md │ ├── SparkFunDMX.cpp │ └── SparkFunDMX.h │ ├── e131 │ ├── ESPAsyncE131.cpp │ └── ESPAsyncE131.h │ ├── espalexa │ ├── Espalexa.h │ ├── EspalexaDevice.cpp │ ├── EspalexaDevice.h │ └── LICENSE │ ├── json │ ├── ArduinoJson-v6.h │ └── AsyncJson-v6.h │ ├── network │ ├── Network.cpp │ └── Network.h │ ├── time │ ├── DS1307RTC.cpp │ ├── DS1307RTC.h │ ├── DateStrings.cpp │ ├── LICENSE.txt │ ├── Readme.txt │ ├── Time.cpp │ ├── TimeLib.h │ ├── library.json │ └── library.properties │ ├── timezone │ ├── LICENSE.md │ ├── ReadMe.md │ ├── Timezone.cpp │ └── Timezone.h │ ├── toki │ └── Toki.h │ └── ws2812fx │ ├── LICENSE.txt │ └── readme.txt ├── udp.cpp ├── um_manager.cpp ├── usermod.cpp ├── usermod_v2_empty.h ├── usermods_list.cpp ├── util.cpp ├── wled.cpp ├── wled.h ├── wled00.ino ├── wled00.vcxproj ├── wled00.vcxproj.filters ├── wled00.vcxproj.user ├── wled_eeprom.cpp ├── wled_ethernet.h ├── wled_math.h ├── wled_serial.cpp ├── wled_server.cpp ├── ws.cpp └── xml.cpp /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/python-3/.devcontainer/base.Dockerfile 2 | 3 | # [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6 4 | ARG VARIANT="3" 5 | FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} 6 | 7 | # [Option] Install Node.js 8 | ARG INSTALL_NODE="true" 9 | ARG NODE_VERSION="lts/*" 10 | RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi 11 | 12 | # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. 13 | # COPY requirements.txt /tmp/pip-tmp/ 14 | # RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ 15 | # && rm -rf /tmp/pip-tmp 16 | 17 | # [Optional] Uncomment this section to install additional OS packages. 18 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 19 | # && apt-get -y install --no-install-recommends 20 | 21 | # [Optional] Uncomment this line to install global node packages. 22 | # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 23 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Python 3", 3 | "build": { 4 | "dockerfile": "Dockerfile", 5 | "context": "..", 6 | "args": { 7 | // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9 8 | "VARIANT": "3", 9 | // Options 10 | "INSTALL_NODE": "true", 11 | "NODE_VERSION": "lts/*" 12 | } 13 | }, 14 | 15 | // Set *default* container specific settings.json values on container create. 16 | "settings": { 17 | "terminal.integrated.shell.linux": "/bin/bash", 18 | "python.pythonPath": "/usr/local/bin/python", 19 | "python.linting.enabled": true, 20 | "python.linting.pylintEnabled": true, 21 | "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", 22 | "python.formatting.blackPath": "/usr/local/py-utils/bin/black", 23 | "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", 24 | "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", 25 | "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", 26 | "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", 27 | "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", 28 | "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", 29 | "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" 30 | }, 31 | 32 | // Add the IDs of extensions you want installed when the container is created. 33 | "extensions": [ 34 | "ms-python.python", 35 | "platformio.platformio-ide" 36 | ], 37 | 38 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 39 | // "forwardPorts": [], 40 | 41 | // Use 'postCreateCommand' to run commands after the container is created. 42 | "postCreateCommand": "npm install", 43 | 44 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 45 | "remoteUser": "vscode" 46 | } 47 | 48 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | layout python-venv python3 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [Aircoookie] 2 | custom: ['https://paypal.me/Aircoookie'] 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: SoundReactive WLED Wiki 4 | url: https://github.com/atuline/WLED/wiki 5 | about: Take a look at our well-maintained documentation and guides, maybe your answer is there already ! 6 | - name: WLED frequently asked questions (kno.wled.ge base) 7 | url: https://kno.wled.ge/basics/faq/ 8 | about: Take a look at the frequently asked questions and documentation, perhaps your question is already answered! 9 | - name: Soundreactive WLED Discord community 10 | url: https://discord.gg/4CQRmfR 11 | about: Please ask and answer questions and discuss setup issues here! 12 | - name: WLED community forum 13 | url: https://wled.discourse.group/ 14 | about: For issues and ideas that might need longer discussion. 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an improvement idea for Soundreactive WLED! 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | 22 | Thank you for your ideas for making WLED better! 23 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 120 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - keep 9 | - enhancement 10 | - confirmed 11 | # Label to use when marking an issue as stale 12 | staleLabel: stale 13 | # Comment to post when marking an issue as stale. Set to `false` to disable 14 | markComment: > 15 | Hey! This issue has been open for quite some time without any new comments now. 16 | It will be closed automatically in a week if no further activity occurs. 17 | 18 | Thank you for using WLED! 19 | # Comment to post when closing a stale issue. Set to `false` to disable 20 | closeComment: false 21 | -------------------------------------------------------------------------------- /.github/workflows/pages.yml: -------------------------------------------------------------------------------- 1 | name: Publish WIKI to pages 2 | 3 | # Controls when the workflow will run 4 | on: 5 | # push trigger runs automatically when a wiki page changes 6 | # disabled as github-pages are not enabled in our repo currently. 7 | # push: 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | 11 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 12 | permissions: 13 | contents: read 14 | pages: write 15 | id-token: write 16 | 17 | # Allow one concurrent deployment 18 | concurrency: 19 | group: "pages" 20 | cancel-in-progress: true 21 | 22 | jobs: 23 | build: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - name: Setup Node.js environment 27 | uses: actions/setup-node@v3.5.0 28 | - name: checkout 29 | uses: actions/checkout@v3 30 | with: 31 | repository: 'atuline/WLED.wiki' 32 | - name: show files 33 | run: find ./ 34 | - name: build docs 35 | run: npm install -g github-wikito-converter && mkdir _site && gwtc --output _site/ --file-name index ./ 36 | - name: Upload artifact 37 | uses: actions/upload-pages-artifact@v1 38 | 39 | # Deployment job 40 | deploy: 41 | environment: 42 | name: github-pages 43 | url: ${{ steps.deployment.outputs.page_url }} 44 | runs-on: ubuntu-latest 45 | needs: build 46 | steps: 47 | - name: Deploy to GitHub Pages 48 | id: deployment 49 | uses: actions/deploy-pages@v1 50 | -------------------------------------------------------------------------------- /.github/workflows/wled-ci.yml: -------------------------------------------------------------------------------- 1 | name: PlatformIO CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | 7 | get_default_envs: 8 | name: Gather Environments 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Cache pip 13 | uses: actions/cache@v2 14 | with: 15 | path: ~/.cache/pip 16 | key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} 17 | restore-keys: | 18 | ${{ runner.os }}-pip- 19 | - uses: actions/setup-python@v2 20 | - name: Install PlatformIO 21 | run: pip install -r requirements.txt 22 | - name: Get default environments 23 | id: envs 24 | run: | 25 | echo "::set-output name=environments::$(pio project config --json-output | jq -cr '.[0][1][0][1]')" 26 | outputs: 27 | environments: ${{ steps.envs.outputs.environments }} 28 | 29 | 30 | build: 31 | name: Build Enviornments 32 | runs-on: ubuntu-latest 33 | needs: get_default_envs 34 | strategy: 35 | matrix: 36 | environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} 37 | steps: 38 | - uses: actions/checkout@v2 39 | - name: Cache pip 40 | uses: actions/cache@v2 41 | with: 42 | path: ~/.cache/pip 43 | key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} 44 | restore-keys: | 45 | ${{ runner.os }}-pip- 46 | - name: Cache PlatformIO 47 | uses: actions/cache@v2 48 | with: 49 | path: ~/.platformio 50 | key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} 51 | - name: Set up Python 52 | uses: actions/setup-python@v2 53 | - name: Install PlatformIO 54 | run: pip install -r requirements.txt 55 | - name: Build firmware 56 | env: 57 | WLED_RELEASE: True 58 | run: pio run -e ${{ matrix.environment }} 59 | - uses: actions/upload-artifact@v2 60 | with: 61 | name: firmware-${{ matrix.environment }} 62 | path: | 63 | build_output/firmware/*.bin 64 | build_output/firmware/*.gz 65 | - uses: actions/upload-artifact@v2 66 | if: startsWith(github.ref, 'refs/tags/') 67 | with: 68 | name: firmware-release 69 | path: build_output/release/*.bin 70 | release: 71 | name: Create Release 72 | runs-on: ubuntu-latest 73 | needs: [get_default_envs, build] 74 | if: startsWith(github.ref, 'refs/tags/') 75 | steps: 76 | - uses: actions/download-artifact@v2 77 | with: 78 | name: firmware-release 79 | - name: Create draft release 80 | uses: softprops/action-gh-release@v1 81 | with: 82 | draft: True 83 | files: | 84 | *.bin 85 | env: 86 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 87 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .cache 3 | .pioenvs 4 | .piolibdeps 5 | .vscode 6 | !.vscode/extensions.json 7 | /wled00/Release 8 | /wled00/extLibs 9 | /platformio_override.ini 10 | /wled00/my_config.h 11 | /build_output 12 | .DS_Store 13 | .gitignore 14 | .clang-format 15 | node_modules 16 | .idea 17 | .direnv 18 | wled00/wled00.ino.cpp 19 | -------------------------------------------------------------------------------- /.gitpod.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-full 2 | 3 | USER gitpod 4 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - command: pip3 install -U platformio && platformio run 3 | 4 | image: 5 | file: .gitpod.Dockerfile 6 | 7 | vscode: 8 | extensions: 9 | - Atishay-Jain.All-Autocomplete 10 | - esbenp.prettier-vscode 11 | - shardulm94.trailing-spaces 12 | -------------------------------------------------------------------------------- /.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 | ], 7 | "unwantedRecommendations": [ 8 | "ms-vscode.cpptools-extension-pack" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Build: HTML and binary", 6 | "dependsOn": [ 7 | "Build: HTML only", 8 | "Build: binary only" 9 | ], 10 | "dependsOrder": "sequence", 11 | "problemMatcher": [ 12 | "$platformio", 13 | ], 14 | }, 15 | { 16 | "type": "PlatformIO", 17 | "label": "Build: binary only", 18 | "task": "Build", 19 | "group": { 20 | "kind": "build", 21 | "isDefault": true, 22 | }, 23 | "problemMatcher": [ 24 | "$platformio" 25 | ], 26 | "presentation": { 27 | "panel": "shared" 28 | } 29 | }, 30 | { 31 | "type": "npm", 32 | "script": "build", 33 | "group": "build", 34 | "problemMatcher": [], 35 | "label": "Build: HTML only", 36 | "detail": "npm run build", 37 | "presentation": { 38 | "panel": "shared" 39 | } 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /Aircoookie_LICENSE: -------------------------------------------------------------------------------- 1 | The license below is valid for the code that is common with upstream (AC WLED 0.13.3) from https://github.com/Aircoookie/WLED. 2 | Additions and changes that are exclusive to this fork (WLED-SR) are under GPLv3 license, see LICENSE. 3 | 4 | MIT License 5 | 6 | Copyright (c) 2016 Christian Schwinne 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Thank you for making WLED better! 2 | 3 | Here are a few suggestions to make it easier for you to contribute! 4 | 5 | ### Code style 6 | 7 | When in doubt, it is easiest to replicate the code style you find in the files you want to edit :) 8 | Below are the guidelines we use in the WLED repository. 9 | 10 | #### Indentation 11 | 12 | We use tabs for Indentation in Web files (.html/.css/.js) and spaces (2 per indentation level) for all other files. 13 | You are all set if you have enabled `Editor: Detect Indentation` in VS Code. 14 | 15 | #### Blocks 16 | 17 | Whether the opening bracket of e.g. an `if` block is in the same line as the condition or in a separate line is up to your discretion. If there is only one statement, leaving out block braches is acceptable. 18 | 19 | Good: 20 | ```cpp 21 | if (a == b) { 22 | doStuff(a); 23 | } 24 | ``` 25 | 26 | ```cpp 27 | if (a == b) 28 | { 29 | doStuff(a); 30 | } 31 | ``` 32 | 33 | ```cpp 34 | if (a == b) doStuff(a); 35 | ``` 36 | 37 | There should always be a space between a keyword and its condition and between the condition and brace. 38 | Within the condition, no space should be between the paranthesis and variables. 39 | Spaces between variables and operators are up to the authors discretion. 40 | There should be no space between function names and their argument parenthesis. 41 | 42 | Good: 43 | ```cpp 44 | if (a == b) { 45 | doStuff(a); 46 | } 47 | ``` 48 | 49 | Not good: 50 | ```cpp 51 | if( a==b ){ 52 | doStuff ( a); 53 | } 54 | ``` 55 | 56 | #### Comments 57 | 58 | Comments should have a space between the delimiting characters (e.g. `//`) and the comment text. 59 | Note: This is a recent change, the majority of the codebase still has comments without spaces. 60 | 61 | Good: 62 | ``` 63 | // This is a comment. 64 | 65 | /* This is a CSS inline comment */ 66 | 67 | /* 68 | * This is a comment 69 | * wrapping over multiple lines, 70 | * used in WLED for file headers and function explanations 71 | */ 72 | 73 | 74 | ``` 75 | 76 | There is no set character limit for a comment within a line, 77 | though as a rule of thumb you should wrap your comment if it exceeds the width of your editor window. 78 | Inline comments are OK if they describe that line only and are not exceedingly wide. -------------------------------------------------------------------------------- /Microphones.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/Microphones.pdf -------------------------------------------------------------------------------- /boards/esp32_16MB-poe.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "arduino": { 4 | "ldscript": "esp32_out.ld" 5 | }, 6 | "core": "esp32", 7 | "extra_flags": "-DARDUINO_ESP32_POE", 8 | "f_cpu": "240000000L", 9 | "f_flash": "40000000L", 10 | "flash_mode": "dio", 11 | "mcu": "esp32", 12 | "variant": "esp32-poe", 13 | "partitions": "partitions_16M.csv" 14 | }, 15 | "connectivity": [ 16 | "wifi", 17 | "bluetooth", 18 | "ethernet", 19 | "can" 20 | ], 21 | "debug": { 22 | "openocd_board": "esp-wroom-32.cfg" 23 | }, 24 | "frameworks": [ 25 | "arduino", 26 | "espidf" 27 | ], 28 | "name": "ESP32 16MB", 29 | "upload": { 30 | "flash_size": "16MB", 31 | "maximum_ram_size": 327680, 32 | "maximum_size": 16777216, 33 | "require_upload_port": true, 34 | "speed": 2000000 35 | }, 36 | "url": "https://en.wikipedia.org/wiki/ESP32", 37 | "vendor": "Multiple" 38 | } 39 | -------------------------------------------------------------------------------- /boards/esp32_16MB.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "arduino": { 4 | "ldscript": "esp32_out.ld" 5 | }, 6 | "core": "esp32", 7 | "extra_flags": "-DARDUINO_ESP32_DEV", 8 | "f_cpu": "240000000L", 9 | "f_flash": "40000000L", 10 | "flash_mode": "dio", 11 | "mcu": "esp32", 12 | "variant": "esp32", 13 | "partitions": "partitions_16M.csv" 14 | }, 15 | "connectivity": [ 16 | "wifi", 17 | "bluetooth", 18 | "ethernet", 19 | "can" 20 | ], 21 | "debug": { 22 | "openocd_board": "esp-wroom-32.cfg" 23 | }, 24 | "frameworks": [ 25 | "arduino", 26 | "espidf" 27 | ], 28 | "name": "ESP32 16MB", 29 | "upload": { 30 | "flash_size": "16MB", 31 | "maximum_ram_size": 327680, 32 | "maximum_size": 16777216, 33 | "require_upload_port": true, 34 | "speed": 2000000 35 | }, 36 | "url": "https://en.wikipedia.org/wiki/ESP32", 37 | "vendor": "Multiple" 38 | } 39 | -------------------------------------------------------------------------------- /images/Readme.md: -------------------------------------------------------------------------------- 1 | ### Additional Logos 2 | 3 | Additional awesome logos for WLED can be found here [Aircoookie/Akemi](https://github.com/Aircoookie/Akemi). 4 | 5 | 6 | -------------------------------------------------------------------------------- /images/macbook-pro-space-gray-on-the-wooden-table.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/images/macbook-pro-space-gray-on-the-wooden-table.jpg -------------------------------------------------------------------------------- /images/walking-with-iphone-x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/images/walking-with-iphone-x.jpg -------------------------------------------------------------------------------- /images/wled_logo_akemi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/images/wled_logo_akemi.png -------------------------------------------------------------------------------- /images/wled_logo_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/images/wled_logo_old.png -------------------------------------------------------------------------------- /include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wled", 3 | "version": "0.13.4", 4 | "description": "Tools for WLED project", 5 | "main": "tools/cdata.js", 6 | "directories": { 7 | "lib": "lib", 8 | "test": "test" 9 | }, 10 | "scripts": { 11 | "build": "node tools/cdata.js", 12 | "dev": "nodemon -e js,html,htm,css,png,jpg,gif,ico,js -w tools/ -w wled00/data/ -x node tools/cdata.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/atuline/WLED.git" 17 | }, 18 | "author": "", 19 | "license": "GPL-3.0-or-later", 20 | "bugs": { 21 | "url": "https://github.com/atuline/WLED/issues" 22 | }, 23 | "homepage": "https://github.com/atuline/WLED#readme", 24 | "dependencies": { 25 | "clean-css": "^4.2.3", 26 | "html-minifier-terser": "^5.1.1", 27 | "inliner": "^1.13.1", 28 | "nodemon": "^2.0.4", 29 | "zlib": "^1.0.5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pio-scripts/obj-dump.py: -------------------------------------------------------------------------------- 1 | # Little convenience script to get an object dump 2 | 3 | Import('env') 4 | 5 | def obj_dump_after_elf(source, target, env): 6 | print("Create firmware.asm") 7 | env.Execute("xtensa-lx106-elf-objdump "+ "-D " + str(target[0]) + " > "+ "${PROGNAME}.asm") 8 | 9 | env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf]) 10 | -------------------------------------------------------------------------------- /pio-scripts/output_bins.py: -------------------------------------------------------------------------------- 1 | Import('env') 2 | import os 3 | import shutil 4 | import gzip 5 | 6 | OUTPUT_DIR = "build_output{}".format(os.path.sep) 7 | 8 | def _get_cpp_define_value(env, define): 9 | define_list = [item[-1] for item in env["CPPDEFINES"] if item[0] == define] 10 | 11 | if define_list: 12 | return define_list[0] 13 | 14 | return None 15 | 16 | def _create_dirs(dirs=["firmware", "map"]): 17 | # check if output directories exist and create if necessary 18 | if not os.path.isdir(OUTPUT_DIR): 19 | os.mkdir(OUTPUT_DIR) 20 | 21 | for d in dirs: 22 | if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)): 23 | os.mkdir("{}{}".format(OUTPUT_DIR, d)) 24 | 25 | def bin_rename_copy(source, target, env): 26 | _create_dirs() 27 | variant = env["PIOENV"] 28 | 29 | # create string with location and file names based on variant 30 | map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant) 31 | bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant) 32 | 33 | release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME") 34 | 35 | if release_name: 36 | _create_dirs(["release"]) 37 | version = _get_cpp_define_value(env, "WLED_VERSION") 38 | release_file = "{}release{}WLEDSR_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, version, release_name) #WLEDSR: add SR postfix to WLED 39 | shutil.copy(str(target[0]), release_file) 40 | 41 | # check if new target files exist and remove if necessary 42 | for f in [map_file, bin_file]: 43 | if os.path.isfile(f): 44 | os.remove(f) 45 | 46 | # copy firmware.bin to firmware/.bin 47 | shutil.copy(str(target[0]), bin_file) 48 | 49 | # copy firmware.map to map/.map 50 | if os.path.isfile("firmware.map"): 51 | shutil.move("firmware.map", map_file) 52 | 53 | def bin_gzip(source, target, env): 54 | _create_dirs() 55 | variant = env["PIOENV"] 56 | 57 | # create string with location and file names based on variant 58 | bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant) 59 | gzip_file = "{}firmware{}{}.bin.gz".format(OUTPUT_DIR, os.path.sep, variant) 60 | 61 | # check if new target files exist and remove if necessary 62 | if os.path.isfile(gzip_file): os.remove(gzip_file) 63 | 64 | # write gzip firmware file 65 | with open(bin_file,"rb") as fp: 66 | with gzip.open(gzip_file, "wb", compresslevel = 9) as f: 67 | shutil.copyfileobj(fp, f) 68 | 69 | env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_rename_copy, bin_gzip]) 70 | -------------------------------------------------------------------------------- /pio-scripts/set_version.py: -------------------------------------------------------------------------------- 1 | Import('env') 2 | import json 3 | 4 | PACKAGE_FILE = "package.json" 5 | 6 | with open(PACKAGE_FILE, "r") as package: 7 | version = json.load(package)["version"] 8 | env.Append(BUILD_FLAGS=[f"-DWLED_VERSION={version}"]) 9 | -------------------------------------------------------------------------------- /pio-scripts/strip-floats.py: -------------------------------------------------------------------------------- 1 | Import('env') 2 | 3 | # 4 | # Dump build environment (for debug) 5 | #print env.Dump() 6 | # 7 | 8 | flags = " ".join(env['LINKFLAGS']) 9 | flags = flags.replace("-u _printf_float", "") 10 | flags = flags.replace("-u _scanf_float", "") 11 | newflags = flags.split() 12 | 13 | env.Replace( 14 | LINKFLAGS=newflags 15 | ) -------------------------------------------------------------------------------- /pio-scripts/user_config_copy.py: -------------------------------------------------------------------------------- 1 | Import('env') 2 | import os 3 | import shutil 4 | 5 | # copy WLED00/my_config_sample.h to WLED00/my_config.h 6 | if os.path.isfile("wled00/my_config.h"): 7 | print ("*** use existing my_config.h ***") 8 | else: 9 | shutil.copy("wled00/my_config_sample.h", "wled00/my_config.h") 10 | -------------------------------------------------------------------------------- /platformio_override.ini.sample: -------------------------------------------------------------------------------- 1 | # Example PlatformIO Project Configuration Override 2 | # ------------------------------------------------------------------------------ 3 | # Copy to platformio_override.ini to activate overrides 4 | # ------------------------------------------------------------------------------ 5 | # Please visit documentation: https://docs.platformio.org/page/projectconf.html 6 | 7 | [platformio] 8 | default_envs = WLED_tasmota_1M 9 | 10 | [env:WLED_tasmota_1M] 11 | board = esp01_1m 12 | platform = ${common.platform_wled_default} 13 | platform_packages = ${common.platform_packages} 14 | board_build.ldscript = ${common.ldscript_1m128k} 15 | lib_deps = ${esp8266.lib_deps} 16 | build_unflags = ${common.build_unflags} 17 | build_flags = ${common.build_flags_esp8266} 18 | ; ********************************************************************* 19 | ; *** Use custom settings from file my_config.h 20 | -DWLED_USE_MY_CONFIG 21 | ; ********************************************************************* 22 | ; 23 | ; 24 | ; *** To use the below defines/overrides, copy and paste each onto it's own line just below build_flags in the section above. 25 | ; 26 | ; disable specific features 27 | ; -D WLED_DISABLE_OTA 28 | ; -D WLED_DISABLE_ALEXA 29 | ; -D WLED_DISABLE_BLYNK 30 | ; -D WLED_DISABLE_HUESYNC 31 | ; -D WLED_DISABLE_INFRARED 32 | ; -D WLED_DISABLE_WEBSOCKETS 33 | ; PIN defines - uncomment and change, if needed: 34 | ; -D LEDPIN=2 35 | ; -D BTNPIN=0 36 | ; -D TOUCHPIN=T0 37 | ; -D IRPIN=4 38 | ; -D RLYPIN=12 39 | ; -D RLYMDE=1 40 | ; digital LED strip types - uncomment only one ! - this will disable WS281x / SK681x support 41 | ; -D USE_APA102 42 | ; -D USE_WS2801 43 | ; -D USE_LPD8806 44 | ; PIN defines for 2 wire LEDs 45 | -D CLKPIN=0 46 | -D DATAPIN=2 47 | ; to drive analog LED strips (aka 5050) hardware configuration is no longer necessary 48 | ; configure the settings in the UI as follows (hard): 49 | ; for the Magic Home LED Controller use PWM pins 5,12,13,15 50 | ; for the H801 controller use PINs 15,13,12,14 (W2 = 04) 51 | ; for the BW-LT11 controller use PINs 12,4,14,5 52 | ; 53 | ; set the name of the module - make sure there is a quote-backslash-quote before the name and a backslash-quote-quote after the name 54 | ; -D SERVERNAME="\"WLED\"" 55 | ; 56 | ; set the number of LEDs 57 | ; -D DEFAULT_LED_COUNT=30 58 | ; 59 | ; set milliampere limit when using ESP pin to power leds 60 | ; -D ABL_MILLIAMPS_DEFAULT=850 61 | ; 62 | ; enable IR by setting remote type 63 | ; -D IRTYPE=0 ;0 Remote disabled | 1 24-key RGB | 2 24-key with CT | 3 40-key blue | 4 40-key RGB | 5 21-key RGB | 6 6-key black | 7 9-key red | 8 JSON remote 64 | ; 65 | ; set default color order of your led strip 66 | ; -D DEFAULT_LED_COLOR_ORDER=COL_ORDER_GRB 67 | -------------------------------------------------------------------------------- /requirements.in: -------------------------------------------------------------------------------- 1 | platformio 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with python 3.8 3 | # To update, run: 4 | # 5 | # pip-compile 6 | # 7 | aiofiles==0.8.0 8 | # via platformio 9 | ajsonrpc==1.2.0 10 | # via platformio 11 | anyio==3.6.1 12 | # via starlette 13 | async-timeout==4.0.2 14 | # via zeroconf 15 | bottle==0.12.23 16 | # via platformio 17 | certifi==2022.6.15 18 | # via requests 19 | charset-normalizer==2.1.1 20 | # via requests 21 | click==8.1.3 22 | # via 23 | # platformio 24 | # uvicorn 25 | colorama==0.4.5 26 | # via 27 | # click 28 | # platformio 29 | h11==0.13.0 30 | # via 31 | # uvicorn 32 | # wsproto 33 | idna==3.3 34 | # via 35 | # anyio 36 | # requests 37 | ifaddr==0.2.0 38 | # via zeroconf 39 | marshmallow==3.17.0 40 | # via platformio 41 | packaging==21.3 42 | # via marshmallow 43 | platformio==6.1.4 44 | # via -r requirements.in 45 | pyelftools==0.29 46 | # via platformio 47 | pyparsing==3.0.9 48 | # via packaging 49 | pyserial==3.5 50 | # via platformio 51 | requests==2.28.1 52 | # via platformio 53 | semantic-version==2.10.0 54 | # via platformio 55 | sniffio==1.2.0 56 | # via anyio 57 | starlette==0.20.4 58 | # via platformio 59 | tabulate==0.8.10 60 | # via platformio 61 | typing-extensions==4.3.0 62 | # via starlette 63 | urllib3==1.26.11 64 | # via requests 65 | uvicorn==0.18.2 66 | # via platformio 67 | wsproto==1.1.0 68 | # via platformio 69 | zeroconf==0.39.0 70 | # via platformio 71 | -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | -------------------------------------------------------------------------------- /tools/WLED_ESP32_16MB.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 0x5000, 3 | otadata, data, ota, 0xe000, 0x2000, 4 | app0, app, ota_0, 0x10000, 0x200000, 5 | app1, app, ota_1, 0x210000,0x200000, 6 | spiffs, data, spiffs, 0x410000,0xBE0000, -------------------------------------------------------------------------------- /tools/WLED_ESP32_16MB_9MB_FS.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 0x5000, 3 | otadata, data, ota, 0xe000, 0x2000, 4 | app0, app, ota_0, 0x10000, 0x300000, 5 | app1, app, ota_1, 0x310000,0x300000, 6 | spiffs, data, spiffs, 0x610000,0x9E0000, 7 | coredump, data, coredump,0xFF0000,0x10000, 8 | # to create/use ffat, see https://github.com/marcmerlin/esp32_fatfsimage -------------------------------------------------------------------------------- /tools/WLED_ESP32_2MB_noOTA.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 20K, 3 | otadata, data, ota, 0xe000, 8K, 4 | app0, app, ota_0, 0x10000, 1536K, 5 | spiffs, data, spiffs, 0x190000, 384K, 6 | -------------------------------------------------------------------------------- /tools/WLED_ESP32_4MB_1MB_FS.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 0x5000, 3 | otadata, data, ota, 0xe000, 0x2000, 4 | app0, app, ota_0, 0x10000, 0x180000, 5 | app1, app, ota_1, 0x190000,0x180000, 6 | spiffs, data, spiffs, 0x310000,0xF0000, -------------------------------------------------------------------------------- /tools/WLED_ESP32_4MB_256KB_FS.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 0x5000, 3 | otadata, data, ota, 0xe000, 0x2000, 4 | app0, app, ota_0, 0x10000, 0x1D0000, 5 | app1, app, ota_1, 0x1E0000,0x1D0000, 6 | spiffs, data, spiffs, 0x3B0000,0x40000, 7 | coredump, data, coredump,0x3F0000,0x10000, -------------------------------------------------------------------------------- /tools/WLED_ESP32_8MB.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 0x5000, 3 | otadata, data, ota, 0xe000, 0x2000, 4 | app0, app, ota_0, 0x10000, 0x200000, 5 | app1, app, ota_1, 0x210000,0x200000, 6 | spiffs, data, spiffs, 0x410000,0x3F0000, -------------------------------------------------------------------------------- /tools/multi-update.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET FWPATH=c:\path\to\your\WLED\build_output\firmware 4 | GOTO ESPS 5 | 6 | :UPDATEONE 7 | IF NOT EXIST %FWPATH%\%2 GOTO SKIP 8 | ping -w 1000 -n 1 %1 | find "TTL=" || GOTO SKIP 9 | ECHO Updating %1 10 | curl -s -F "update=@%FWPATH%/%2" %1/update >nul 11 | :SKIP 12 | GOTO:EOF 13 | 14 | :ESPS 15 | call :UPDATEONE 192.168.x.x firmware.bin 16 | call :UPDATEONE .... 17 | -------------------------------------------------------------------------------- /tools/multi-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | FWPATH=/path/to/your/WLED/build_output/firmware 3 | 4 | update_one() { 5 | if [ -f $FWPATH/$2 ]; then 6 | ping -c 1 $1 >/dev/null 7 | PINGRESULT=$? 8 | if [ $PINGRESULT -eq 0 ]; then 9 | echo Updating $1 10 | curl -s -F "update=@${FWPATH}/$2" $1/update >/dev/null 11 | return 0 12 | fi 13 | return 1 14 | fi 15 | } 16 | 17 | update_one 192.168.x.x firmware.bin 18 | update_one 192.168.x.x firmware.bin 19 | # ... -------------------------------------------------------------------------------- /tools/partitions-4MB_spiffs-tinyuf2.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | # bootloader.bin,, 0x1000, 32K 4 | # partition table, 0x8000, 4K 5 | 6 | nvs, data, nvs, 0x9000, 20K, 7 | otadata, data, ota, 0xe000, 8K, 8 | ota_0, 0, ota_0, 0x10000, 1408K, 9 | ota_1, 0, ota_1, 0x170000, 1408K, 10 | uf2, app, factory,0x2d0000, 256K, 11 | spiffs, data, spiffs, 0x310000, 960K, 12 | -------------------------------------------------------------------------------- /tools/plotter.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import matplotlib.animation as animation 3 | from matplotlib import interactive, style 4 | import numpy as np 5 | import random 6 | import serial 7 | 8 | # Initialize serial port 9 | ser = serial.Serial() 10 | ser.port = 'dev/cu.SLAB_USBtoUART' # Conected serial port 11 | ser.baudrate = 115200 12 | ser.timeout = 50 13 | ser.open() 14 | if ser.is_open: 15 | print("\nAll right, serial port now open. Configuration:\n") 16 | print(ser, "\n") 17 | 18 | # Create figure for plotting 19 | fig = plt.figure() 20 | ax = fig.add_subplot(1, 1, 1) 21 | xs = [] # Store trials here (n) 22 | ys = [] # Store relative frequency here 23 | rs = [] # For theoretical probablility 24 | 25 | 26 | def animate(i, xs, ys): 27 | """ This function is called periodically from FuncAnimation """ 28 | line = ser.readline() # ascii 29 | line_as_list = line.split(b',') 30 | i = int(line_as_list[0]) 31 | relProb = line_as_list[1] 32 | relProb_as_list = relProb.split(b'\n') 33 | relProb_float = float(relProb_as_list[0]) 34 | 35 | # Add x and y to lists 36 | xs.append(i) 37 | ys.append(relProb_float) 38 | rs.append(0.5) 39 | 40 | # Limit x and y lists to 20 items 41 | # xs = xs[-20] 42 | # ys = ys[-20] 43 | 44 | # Draw x and y lists 45 | ax.clear() 46 | ax.plot(xs, ys, label="Experimental Probability") 47 | ax.plot(xs, rs, label="Theoretical Probability") 48 | 49 | # Format plot 50 | plt.xticks(rotation=45, ha='right') 51 | plt.subplots_adjust(bottom=0.30) 52 | plt.title('This is how I roll...') 53 | plt.ylabel('Relative Frequency') 54 | plt.legend() 55 | plt.axis([1, None, 0, 1.1]) # Use for arbitrary number of trials 56 | # plt.axis([1, 100, 0, 1.1]) # Use for 100 trial demo 57 | 58 | 59 | # Set up plot to call animate() function periodically 60 | ani = animation.FuncAnimation(fig, animate, fargs=(xs, ys), interval=1000) 61 | plt.show() 62 | -------------------------------------------------------------------------------- /usermods/Artemis_reciever/readme.md: -------------------------------------------------------------------------------- 1 | Usermod to allow WLED to receive via UDP port from RGB.NET (and therefore add as a device to be controlled within artemis on PC) 2 | 3 | This is only a very simple code to support a single led strip, it does not support the full function of the RGB.NET sketch for esp8266 only what is needed to be used with Artemis. It will show as a ws281x device in artemis when you provide the correct hostname or ip. Artemis queries the number of LEDs via the web interface (/config) but communication to set the LEDs is all done via the UDP interface. 4 | 5 | To install, copy the usermod.cpp file to wled00 folder and recompile -------------------------------------------------------------------------------- /usermods/Artemis_reciever/usermod.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * RGB.NET (artemis) receiver 3 | * 4 | * This works via the UDP, http is not supported apart from reporting LED count 5 | * 6 | * 7 | */ 8 | #include "wled.h" 9 | #include 10 | 11 | WiFiUDP UDP; 12 | const unsigned int RGBNET_localUdpPort = 1872; // local port to listen on 13 | unsigned char RGBNET_packet[770]; 14 | long lastTime = 0; 15 | int delayMs = 10; 16 | bool isRGBNETUDPEnabled; 17 | 18 | void RGBNET_readValues() { 19 | 20 | int RGBNET_packetSize = UDP.parsePacket(); 21 | if (RGBNET_packetSize) { 22 | // receive incoming UDP packets 23 | int sequenceNumber = UDP.read(); 24 | int channel = UDP.read(); 25 | 26 | //channel data is not used we only supports one channel 27 | int len = UDP.read(RGBNET_packet, strip.getLengthTotal()*3); 28 | if(len==0){ 29 | return; 30 | } 31 | 32 | for (int i = 0; i < len; i=i+3) { 33 | strip.setPixelColor(i/3, RGBNET_packet[i], RGBNET_packet[i+1], RGBNET_packet[i+2], 0); 34 | } 35 | //strip.show(); 36 | } 37 | } 38 | 39 | //update LED strip 40 | void RGBNET_show() { 41 | strip.show(); 42 | lastTime = millis(); 43 | } 44 | 45 | //This function provides a json with info on the number of LEDs connected 46 | // it is needed by artemis to know how many LEDs to display on the surface 47 | void handleConfig(AsyncWebServerRequest *request) 48 | { 49 | String config = (String)"{\ 50 | \"channels\": [\ 51 | {\ 52 | \"channel\": 1,\ 53 | \"leds\": " + strip.getLengthTotal() + "\ 54 | },\ 55 | {\ 56 | \"channel\": 2,\ 57 | \"leds\": " + "0" + "\ 58 | },\ 59 | {\ 60 | \"channel\": 3,\ 61 | \"leds\": " + "0" + "\ 62 | },\ 63 | {\ 64 | \"channel\": 4,\ 65 | \"leds\": " + "0" + "\ 66 | }\ 67 | ]\ 68 | }"; 69 | request->send(200, "application/json", config); 70 | } 71 | 72 | 73 | void userSetup() 74 | { 75 | server.on("/config", HTTP_GET, [](AsyncWebServerRequest *request){ 76 | handleConfig(request); 77 | }); 78 | } 79 | 80 | void userConnected() 81 | { 82 | // new wifi, who dis? 83 | UDP.begin(RGBNET_localUdpPort); 84 | isRGBNETUDPEnabled = true; 85 | } 86 | 87 | void userLoop() 88 | { 89 | RGBNET_readValues(); 90 | if (millis()-lastTime > delayMs) { 91 | RGBNET_show(); 92 | } 93 | } -------------------------------------------------------------------------------- /usermods/BH1750_v2/platformio_override.ini: -------------------------------------------------------------------------------- 1 | ; Options 2 | ; ------- 3 | ; USERMOD_BH1750 - define this to have this user mod included wled00\usermods_list.cpp 4 | ; USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL - the max number of milliseconds between measurements, defaults to 10000ms 5 | ; USERMOD_BH1750_MIN_MEASUREMENT_INTERVAL - the min number of milliseconds between measurements, defaults to 500ms 6 | ; USERMOD_BH1750_FIRST_MEASUREMENT_AT - the number of milliseconds after boot to take first measurement, defaults to 10 seconds 7 | ; USERMOD_BH1750_OFFSET_VALUE - the offset value to report on, defaults to 1 8 | ; 9 | [env:usermod_BH1750_d1_mini] 10 | extends = env:d1_mini 11 | build_flags = 12 | ${common.build_flags_esp8266} 13 | -D USERMOD_BH1750 14 | lib_deps = 15 | ${env.lib_deps} 16 | claws/BH1750 @ ^1.2.0 17 | -------------------------------------------------------------------------------- /usermods/BH1750_v2/readme.md: -------------------------------------------------------------------------------- 1 | # BH1750 usermod 2 | 3 | This usermod will read from an ambient light sensor like the BH1750 sensor. 4 | The luminance is displayed both in the Info section of the web UI as well as published to the `/luminance` MQTT topic if enabled. 5 | 6 | ## Installation 7 | 8 | Copy the example `platformio_override.ini` to the root directory. This file should be placed in the same directory as `platformio.ini`. 9 | 10 | ### Define Your Options 11 | 12 | * `USERMOD_BH1750` - define this to have this user mod included wled00\usermods_list.cpp 13 | * `USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL` - the max number of milliseconds between measurements, defaults to 10000ms 14 | * `USERMOD_BH1750_MIN_MEASUREMENT_INTERVAL` - the min number of milliseconds between measurements, defaults to 500ms 15 | * `USERMOD_BH1750_FIRST_MEASUREMENT_AT` - the number of milliseconds after boot to take first measurement, defaults to 10 seconds 16 | * `USERMOD_BH1750_OFFSET_VALUE` - the offset value to report on, defaults to 1 17 | 18 | All parameters can be configured at runtime using Usermods settings page. 19 | 20 | ### PlatformIO requirements 21 | 22 | If you are using `platformio_override.ini`, you should be able to refresh the task list and see your custom task, for example `env:usermod_BH1750_d1_mini`. 23 | 24 | ## Change Log 25 | -------------------------------------------------------------------------------- /usermods/BH1750_v2/usermods_list.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | /* 3 | * Register your v2 usermods here! 4 | */ 5 | #ifdef USERMOD_BH1750 6 | #include "../usermods/BH1750_v2/usermod_BH1750.h" 7 | #endif 8 | 9 | void registerUsermods() 10 | { 11 | #ifdef USERMOD_BH1750 12 | usermods.add(new Usermod_BH1750()); 13 | #endif 14 | } 15 | -------------------------------------------------------------------------------- /usermods/Cronixie/readme.md: -------------------------------------------------------------------------------- 1 | # Cronixie clock usermod 2 | 3 | This usermod supports driving the Cronixie M and L clock kits by Diamex. 4 | 5 | ## Installation 6 | 7 | Compile and upload after adding `-D USERMOD_CRONIXIE` to `build_flags` of your PlatformIO environment. 8 | Make sure the Auto Brightness Limiter is enabled at 420mA (!) and configure 60 WS281x LEDs. -------------------------------------------------------------------------------- /usermods/DHT/platformio_override.ini: -------------------------------------------------------------------------------- 1 | ; Options 2 | ; ------- 3 | ; USERMOD_DHT - define this to have this user mod included wled00\usermods_list.cpp 4 | ; USERMOD_DHT_DHTTYPE - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22 5 | ; USERMOD_DHT_PIN - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board 6 | ; USERMOD_DHT_CELSIUS - define this to report temperatures in degrees celsious, otherwise fahrenheit will be reported 7 | ; USERMOD_DHT_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds 8 | ; USERMOD_DHT_FIRST_MEASUREMENT_AT - the number of milliseconds after boot to take first measurement, defaults to 90 seconds 9 | ; USERMOD_DHT_STATS - For debug, report delay stats 10 | 11 | [env:d1_mini_usermod_dht_C] 12 | extends = env:d1_mini 13 | build_flags = ${env:d1_mini.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS 14 | lib_deps = ${env.lib_deps} 15 | https://github.com/alwynallan/DHT_nonblocking 16 | 17 | [env:custom32_LEDPIN_16_usermod_dht_C] 18 | extends = env:custom32_LEDPIN_16 19 | build_flags = ${env:custom32_LEDPIN_16.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS -D USERMOD_DHT_STATS 20 | lib_deps = ${env.lib_deps} 21 | https://github.com/alwynallan/DHT_nonblocking 22 | 23 | -------------------------------------------------------------------------------- /usermods/DHT/readme.md: -------------------------------------------------------------------------------- 1 | # DHT Temperature/Humidity sensor usermod 2 | 3 | This usermod will read from an attached DHT22 or DHT11 humidity and temperature sensor. 4 | The sensor readings are displayed in the Info section of the web UI. 5 | 6 | If sensor is not detected after a while (10 update intervals), this usermod will be disabled. 7 | 8 | ## Installation 9 | 10 | Copy the example `platformio_override.ini` to the root directory. This file should be placed in the same directory as `platformio.ini`. 11 | 12 | ### Define Your Options 13 | 14 | * `USERMOD_DHT` - define this to have this user mod included wled00\usermods_list.cpp 15 | * `USERMOD_DHT_DHTTYPE` - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22 16 | * `USERMOD_DHT_PIN` - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board 17 | * `USERMOD_DHT_CELSIUS` - define this to report temperatures in degrees celsious, otherwise fahrenheit will be reported 18 | * `USERMOD_DHT_MEASUREMENT_INTERVAL` - the number of milliseconds between measurements, defaults to 60 seconds 19 | * `USERMOD_DHT_FIRST_MEASUREMENT_AT` - the number of milliseconds after boot to take first measurement, defaults to 90 seconds 20 | * `USERMOD_DHT_STATS` - For debug, report delay stats 21 | 22 | ## Project link 23 | 24 | * [QuinLED-Dig-Uno](https://quinled.info/2018/09/15/quinled-dig-uno/) - Project link 25 | 26 | ### PlatformIO requirements 27 | 28 | If you are using `platformio_override.ini`, you should be able to refresh the task list and see your custom task, for example `env:d1_mini_usermod_dht_C`. If not, you can add the libraries and dependencies into `platformio.ini` as you see fit. 29 | 30 | 31 | ## Change Log 32 | 33 | 2020-02-04 34 | * Change default QuinLed pin to Q2 35 | * Instead of trying to keep updates at constant cadence, space readings out by measurement interval; hope this helps to avoid occasional bursts of readings with errors 36 | * Add some more (optional) stats 37 | 2020-02-03 38 | * Due to poor readouts on ESP32 with previous DHT library, rewrote to use https://github.com/alwynallan/DHT_nonblocking 39 | * The new library serializes/delays up to 5ms for the sensor readout 40 | 2020-02-02 41 | * Created 42 | -------------------------------------------------------------------------------- /usermods/EXAMPLE_v2/readme.md: -------------------------------------------------------------------------------- 1 | # Usermods API v2 example usermod 2 | 3 | In this usermod file you can find the documentation on how to take advantage of the new version 2 usermods! 4 | 5 | ## Installation 6 | 7 | Copy `usermod_v2_example.h` to the wled00 directory. 8 | Uncomment the corresponding lines in `usermods_list.cpp` and compile! 9 | _(You shouldn't need to actually install this, it does nothing useful)_ 10 | 11 | -------------------------------------------------------------------------------- /usermods/EleksTube_IPS/Hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Define the hardware for the EleksTube IPS clock. Mostly pin definitions 3 | */ 4 | #ifndef ELEKSTUBEHAX_HARDWARE_H 5 | #define ELEKSTUBEHAX_HARDWARE_H 6 | 7 | #include 8 | #include // for HIGH and LOW 9 | 10 | // Common indexing scheme, used to identify the digit 11 | #define SECONDS_ONES (0) 12 | #define SECONDS_TENS (1) 13 | #define MINUTES_ONES (2) 14 | #define MINUTES_TENS (3) 15 | #define HOURS_ONES (4) 16 | #define HOURS_TENS (5) 17 | #define NUM_DIGITS (6) 18 | 19 | #define SECONDS_ONES_MAP (0x01 << SECONDS_ONES) 20 | #define SECONDS_TENS_MAP (0x01 << SECONDS_TENS) 21 | #define MINUTES_ONES_MAP (0x01 << MINUTES_ONES) 22 | #define MINUTES_TENS_MAP (0x01 << MINUTES_TENS) 23 | #define HOURS_ONES_MAP (0x01 << HOURS_ONES) 24 | #define HOURS_TENS_MAP (0x01 << HOURS_TENS) 25 | 26 | // WS2812 (or compatible) LEDs on the back of the display modules. 27 | #define BACKLIGHTS_PIN (12) 28 | 29 | // Buttons, active low, externally pulled up (with actual resistors!) 30 | #define BUTTON_LEFT_PIN (33) 31 | #define BUTTON_MODE_PIN (32) 32 | #define BUTTON_RIGHT_PIN (35) 33 | #define BUTTON_POWER_PIN (34) 34 | 35 | // I2C to DS3231 RTC. 36 | #define RTC_SCL_PIN (22) 37 | #define RTC_SDA_PIN (21) 38 | 39 | // Chip Select shift register, to select the display 40 | #define CSSR_DATA_PIN (14) 41 | #define CSSR_CLOCK_PIN (16) 42 | #define CSSR_LATCH_PIN (17) 43 | 44 | // SPI to displays 45 | // DEFINED IN User_Setup.h 46 | // Look for: TFT_MOSI, TFT_SCLK, TFT_CS, TFT_DC, and TFT_RST 47 | 48 | // Power for all TFT displays are grounded through a MOSFET so they can all be turned off. 49 | // Active HIGH. 50 | #define TFT_ENABLE_PIN (27) 51 | 52 | #endif // ELEKSTUBEHAX_HARDWARE_H 53 | -------------------------------------------------------------------------------- /usermods/EleksTube_IPS/User_Setup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is intended to over-ride `User_Setup.h` that comes with the TFT_eSPI library. 3 | * I hate having to modify the library code. 4 | */ 5 | 6 | // ST7789 135 x 240 display with no chip select line 7 | 8 | #define ST7789_DRIVER // Configure all registers 9 | 10 | #define TFT_WIDTH 135 11 | #define TFT_HEIGHT 240 12 | 13 | #define CGRAM_OFFSET // Library will add offsets required 14 | 15 | //#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue 16 | //#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red 17 | 18 | //#define TFT_INVERSION_ON 19 | //#define TFT_INVERSION_OFF 20 | 21 | // EleksTube IPS 22 | #define TFT_SDA_READ // Read and write on the MOSI/SDA pin, no separate MISO pin 23 | #define TFT_MOSI 23 24 | #define TFT_SCLK 18 25 | //#define TFT_CS -1 // Not connected 26 | #define TFT_DC 25 // Data Command, aka Register Select or RS 27 | #define TFT_RST 26 // Connect reset to ensure display initialises 28 | 29 | #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH 30 | //#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters 31 | //#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters 32 | //#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm 33 | //#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. 34 | //#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. 35 | //#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT 36 | //#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts 37 | 38 | //#define SMOOTH_FONT 39 | 40 | 41 | //#define SPI_FREQUENCY 27000000 42 | #define SPI_FREQUENCY 40000000 43 | 44 | /* 45 | * To make the Library not over-write all this: 46 | */ 47 | #define USER_SETUP_LOADED 48 | -------------------------------------------------------------------------------- /usermods/EleksTube_IPS/readme.md: -------------------------------------------------------------------------------- 1 | # EleksTube IPS Clock usermod 2 | 3 | This usermod allows WLED to run on the EleksTube IPS clock. 4 | It enables running all WLED effects on the background SK6812 lighting, while displaying digit bitmaps on the 6 IPS screens. 5 | Code is largely based on https://github.com/SmittyHalibut/EleksTubeHAX by Mark Smith! 6 | 7 | Supported: 8 | - Display with custom bitmaps (.bmp) or raw RGB565 images (.bin) from filesystem 9 | - Background lighting 10 | - All 4 hardware buttons 11 | - RTC (with RTC usermod) 12 | - Standard WLED time features (NTP, DST, timezones) 13 | 14 | Not supported: 15 | - On-device setup with buttons (WiFi setup only) 16 | 17 | Your images must be 1-135 pixels wide and 1-240 pixels high. 18 | For BMP, 1, 4, 8, and 24 bits per pixel formats are supported. 19 | 20 | ## Installation 21 | 22 | Compile and upload to clock using the `elekstube_ips` PlatformIO environment 23 | Once uploaded (the clock can be flashed like any ESP32 module), go to `[WLED-IP]/edit` and upload the 0-9.bin files from [here](https://github.com/Aircoookie/NixieThemes/tree/master/themes/RealisticNixie/bin). 24 | You can find more clockfaces in the [NixieThemes](https://github.com/Aircoookie/NixieThemes/) repo. 25 | Use LED pin 12, relay pin 27 and button pin 34. 26 | 27 | ## Use of RGB565 images 28 | 29 | Binary 16-bit per pixel RGB565 format `.bin` and `.clk` images are now supported. This has the benefit of only using 2/3rds of the file size a 24 BPP `.bmp` has. 30 | The drawback is that this format cannot be handled by common image programs and that an extra conversion step is needed. 31 | You can use https://lvgl.io/tools/imageconverter to convert your .bmp to a .bin file (settings `True color` and `Binary RGB565`). 32 | Thank you to @RedNax67 for adding .bin and .clk support. 33 | For most clockface designs, using 4 or 8 BPP BMP formats will save even more file size: 34 | 35 | | Bits per pixel | File size in kB (for 135x240 img) | % of 24 BPP BMP | Max unique colors 36 | | --- | --- | --- | --- | 37 | 24 | 98 | 100% | 16M (66K) 38 | 16 (.clk) | 64.8 | 66% | 66K 39 | 8 | 33.7 | 34% | 256 40 | 4 | 16.4 | 17% | 16 41 | 1 | 4.9 | 5% | 2 42 | 43 | Comparison 1 vs. 4 vs. 8 vs. 24 BPP. With this clockface on the actual clock, 4 bit looks good, and 8 bit is almost indistinguishable from 24 bit. 44 | 45 | ![comparison](https://user-images.githubusercontent.com/21045690/156899667-5b55ed9f-6e03-4066-b2aa-1260e9570369.png) -------------------------------------------------------------------------------- /usermods/Enclosure_with_OLED_temp_ESP07/assets/controller.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/Enclosure_with_OLED_temp_ESP07/assets/controller.jpg -------------------------------------------------------------------------------- /usermods/Enclosure_with_OLED_temp_ESP07/assets/pcb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/Enclosure_with_OLED_temp_ESP07/assets/pcb.png -------------------------------------------------------------------------------- /usermods/Enclosure_with_OLED_temp_ESP07/assets/readme.md: -------------------------------------------------------------------------------- 1 | # Enclosure and PCB 2 | 3 | ## IP67 rated enclosure 4 | ![Enclosure](controller.jpg) 5 | 6 | ## PCB 7 | ![PCB](pcb.png) 8 | -------------------------------------------------------------------------------- /usermods/Enclosure_with_OLED_temp_ESP07/readme.md: -------------------------------------------------------------------------------- 1 | # Almost universal controller board for outdoor applications 2 | This usermod is using ideas from @mrVanboy and @400killer 3 | 4 | Installation of file: Copy and replace file in wled00 directory. 5 | 6 | For BME280 sensor use usermod_bme280.cpp. Copy to wled00 and rename to usermod.cpp 7 | 8 | ## Project repository 9 | - [Original repository](https://github.com/srg74/Controller-for-WLED-firmware) - Main controller repository 10 | ## Features 11 | - SSD1306 128x32 and 128x64 I2C OLED display 12 | - On screen IP address, SSID and controller status (e.g. ON or OFF, recent effect) 13 | - Auto display shutoff for saving display lifetime 14 | - Dallas temperature sensor 15 | - Reporting temperature to MQTT broker 16 | 17 | ## Hardware 18 | ![Hardware connection](assets/controller.jpg) 19 | 20 | ## Functionality checked with 21 | - ESP-07S 22 | - PlatformIO 23 | - SSD1306 128x32 I2C OLED display 24 | - DS18B20 (temperature sensor) 25 | - BME280 (temperature, humidity and pressure sensor) 26 | - KY-022 (infrared receiver) 27 | - Push button (N.O. momentary switch) 28 | 29 | For Dallas sensor uncomment `U8g2@~2.27.3`,`DallasTemperature@~3.8.0`,`OneWire@~2.3.5 under` `[common]` section in `platformio.ini`: 30 | ```ini 31 | # platformio.ini 32 | ... 33 | [platformio] 34 | ... 35 | default_envs = esp07 36 | ; default_envs = d1_mini 37 | ... 38 | [common] 39 | ... 40 | lib_deps_external = 41 | ... 42 | #For use SSD1306 OLED display uncomment following 43 | U8g2@~2.27.3 44 | #For Dallas sensor uncomment following 2 lines 45 | DallasTemperature@~3.8.0 46 | OneWire@~2.3.5 47 | ... 48 | ``` 49 | 50 | For BME280 sensor uncomment `U8g2@~2.27.3`,`BME280@~3.0.0 under` `[common]` section in `platformio.ini`: 51 | ```ini 52 | # platformio.ini 53 | ... 54 | [platformio] 55 | ... 56 | default_envs = esp07 57 | ; default_envs = d1_mini 58 | ... 59 | [common] 60 | ... 61 | lib_deps_external = 62 | ... 63 | #For use SSD1306 OLED display uncomment following 64 | U8g2@~2.27.3 65 | #For BME280 sensor uncomment following 66 | BME280@~3.0.0 67 | ... 68 | ``` 69 | -------------------------------------------------------------------------------- /usermods/Fix_unreachable_netservices_v2/readme.md: -------------------------------------------------------------------------------- 1 | # Fix unreachable net services V2 2 | 3 | **Attention: This usermod compiles only for ESP8266** 4 | 5 | This usermod-v2 modification performs a ping request to the local IP address every 60 seconds. By this procedure the net services of WLED remains accessible in some problematic WLAN environments. 6 | 7 | The modification works with static or DHCP IP address configuration. 8 | 9 | _Story:_ 10 | 11 | Unfortunately, with all ESP projects where a web server or other network services are running, I have the problem that after some time the web server is no longer accessible. Now I found out that the connection is at least reestablished when a ping request is executed by the device. 12 | 13 | With this modification, in the worst case, the network functions are not available for 60 seconds until the next ping request. 14 | 15 | ## Webinterface 16 | 17 | The number of pings and reconnects is displayed on the info page in the web interface. 18 | The ping delay can be changed. Changes persist after a reboot. 19 | 20 | ## JSON API 21 | 22 | The usermod supports the following state changes: 23 | 24 | | JSON key | Value range | Description | 25 | |-------------|------------------|---------------------------------| 26 | | PingDelayMs | 5000 to 18000000 | Deactivdate/activate the sensor | 27 | 28 | Changes also persist after a reboot. 29 | 30 | ## Installation 31 | 32 | 1. Copy the file `usermod_Fix_unreachable_netservices.h` to the `wled00` directory. 33 | 2. Register the usermod by adding `#include "usermod_Fix_unreachable_netservices.h"` in the top and `registerUsermod(new FixUnreachableNetServices());` in the bottom of `usermods_list.cpp`. 34 | 35 | Example **usermods_list.cpp**: 36 | 37 | ```cpp 38 | #include "wled.h" 39 | /* 40 | * Register your v2 usermods here! 41 | * (for v1 usermods using just usermod.cpp, you can ignore this file) 42 | */ 43 | 44 | /* 45 | * Add/uncomment your usermod filename here (and once more below) 46 | * || || || 47 | * \/ \/ \/ 48 | */ 49 | //#include "usermod_v2_example.h" 50 | //#include "usermod_temperature.h" 51 | //#include "usermod_v2_empty.h" 52 | #include "usermod_Fix_unreachable_netservices.h" 53 | 54 | void registerUsermods() 55 | { 56 | /* 57 | * Add your usermod class name here 58 | * || || || 59 | * \/ \/ \/ 60 | */ 61 | //usermods.add(new MyExampleUsermod()); 62 | //usermods.add(new UsermodTemperature()); 63 | //usermods.add(new UsermodRenameMe()); 64 | usermods.add(new FixUnreachableNetServices()); 65 | 66 | } 67 | ``` 68 | 69 | Hopefully I can help someone with that - @gegu 70 | -------------------------------------------------------------------------------- /usermods/JSON_IR_remote/21-key_ir.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "21-key", 3 | "0xFFA25D": { 4 | "label": "On", 5 | "pos": "1x1", 6 | "cmd": "T=1" 7 | }, 8 | "0xFF629D": { 9 | "label": "Off", 10 | "pos": "1x2", 11 | "cmd": "T=0" 12 | }, 13 | "0xFFE21D": { 14 | "label": "Flash", 15 | "pos": "1x3", 16 | "cmnt": "Cycle Effects", 17 | "cmd": "CY=0&FX=~" 18 | }, 19 | "0xFF22DD": { 20 | "label": "Strobe", 21 | "pos": "2x1", 22 | "cmnt": "Sinelon Dual", 23 | "cmd": "CY=0&FX=93" 24 | }, 25 | "0xFF02FD": { 26 | "label": "Fade", 27 | "pos": "2x2", 28 | "cmnt": "Rain", 29 | "cmd": "CY=0&FX=43" 30 | }, 31 | "0xFFC23D": { 32 | "label": "Smooth", 33 | "pos": "2x3", 34 | "cmnt": "Aurora", 35 | "cmd": "CY=0&FX=38" 36 | }, 37 | "0xFFE01F": { 38 | "label": "Bright +", 39 | "pos": "3x1", 40 | "cmd": "A=~16" 41 | }, 42 | "0xFFA857": { 43 | "label": "Bright -", 44 | "pos": "3x2", 45 | "cmd": "A=~-16" 46 | }, 47 | "0xFF906F": { 48 | "label": "White", 49 | "pos": "3x3", 50 | "cmd": "FP=5&CL=hFFFFFF&C2=hFFFFFF&C3=hA8A8A8" 51 | }, 52 | "0xFF6897": { 53 | "label": "Red", 54 | "pos": "4x1", 55 | "cmnt": "Lava", 56 | "cmd": "FP=8" 57 | }, 58 | "0xFF9867": { 59 | "label": "Green", 60 | "pos": "4x2", 61 | "cmnt": "Forest", 62 | "cmd": "FP=10" 63 | }, 64 | "0xFFB04F": { 65 | "label": "Blue", 66 | "pos": "4x3", 67 | "cmnt": "Breeze", 68 | "cmd": "FP=15" 69 | }, 70 | "0xFF30CF": { 71 | "label": "Tomato", 72 | "pos": "5x1", 73 | "cmd": "FP=5&CL=hFF6347&C2=hFFBF47&C3=hA85859" 74 | }, 75 | "0xFF18E7": { 76 | "label": "LightGreen", 77 | "pos": "5x2", 78 | "cmnt": "Rivendale", 79 | "cmd": "FP=14" 80 | }, 81 | "0xFF7A85": { 82 | "label": "SkyBlue", 83 | "pos": "5x3", 84 | "cmnt": "Ocean", 85 | "cmd": "FP=9" 86 | }, 87 | "0xFF10EF": { 88 | "label": "Orange", 89 | "pos": "6x1", 90 | "cmnt": "Orangery", 91 | "cmd": "FP=47" 92 | }, 93 | "0xFF38C7": { 94 | "label": "Aqua", 95 | "pos": "6x2", 96 | "cmd": "FP=5&CL=hFFFF&C2=h7FFF&C3=h39A895" 97 | }, 98 | "0xFF5AA5": { 99 | "label": "Purple", 100 | "pos": "6x3", 101 | "cmd": "FP=5&CL=h663399&C2=h993399&C3=h473864" 102 | }, 103 | "0xFF42BD": { 104 | "label": "Yellow", 105 | "pos": "7x1", 106 | "cmd": "FP=5&CL=hFFFF00&C2=hFFC800&C3=hFDFFDE" 107 | }, 108 | "0xFF4AB5": { 109 | "label": "Cyan", 110 | "pos": "7x2", 111 | "cmnt": "Beech", 112 | "cmd": "FP=22" 113 | }, 114 | "0xFF52AD": { 115 | "label": "Pink", 116 | "pos": "7x3", 117 | "cmd": "FP=5&CL=hFFC0CB&C2=hFFD4C0&C3=hA88C96" 118 | } 119 | } -------------------------------------------------------------------------------- /usermods/JSON_IR_remote/6-key_ir.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "6-key", 3 | "0xFF0FF0": { 4 | "label": "Power", 5 | "pos": "1x1", 6 | "cmd": "T=2" 7 | }, 8 | "0xFF8F70": { 9 | "label": "Channel +", 10 | "pos": "2x1", 11 | "cmnt": "Cycle palette up", 12 | "cmd": "FP=~" 13 | }, 14 | "0xFF4FB0": { 15 | "label": "Channel -", 16 | "pos": "3x1", 17 | "cmnt": "Cycle palette down", 18 | "cmd": "FP=~-" 19 | }, 20 | "0xFFCF30": { 21 | "label": "Volume +", 22 | "pos": "4x1", 23 | "cmnt": "Brighten", 24 | "cmd": "A=~16" 25 | }, 26 | "0xFF2FD0": { 27 | "label": "Volume -", 28 | "pos": "5x1", 29 | "cmnt": "Dim", 30 | "cmd": "A=~-16" 31 | }, 32 | "0xFFAF50": { 33 | "label": "Mute", 34 | "pos": "6x1", 35 | "cmnt": "Cycle effects", 36 | "cmd": "CY=0&FX=~" 37 | } 38 | } -------------------------------------------------------------------------------- /usermods/JSON_IR_remote/9-key_ir.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "9-key", 3 | "0xFF629D": { 4 | "label": "Power", 5 | "cmd": "T=2" 6 | }, 7 | "0xFF22DD": { 8 | "label": "A", 9 | "cmnt": "Preset 1", 10 | "cmd": "PL=1" 11 | }, 12 | "0xFF02FD": { 13 | "label": "B", 14 | "cmnt": "Preset 2", 15 | "cmd": "PL=2" 16 | }, 17 | "0xFFC23D": { 18 | "label": "C", 19 | "cmnt": "Preset 3", 20 | "cmd": "PL=3" 21 | }, 22 | "0xFF30CF": { 23 | "label": "Left", 24 | "cmnt": "Speed -", 25 | "cmd": "SI=~-16" 26 | }, 27 | "0xFF7A85": { 28 | "label": "Right", 29 | "cmnt": "Speed +", 30 | "cmd": "SI=~16" 31 | }, 32 | "0xFF9867": { 33 | "label": "Up", 34 | "cmnt": "Bright +", 35 | "cmd": "A=~16" 36 | }, 37 | "0xFF38C7": { 38 | "label": "Down", 39 | "cmnt": "Bright -", 40 | "cmd": "A=~-16" 41 | }, 42 | "0xFF18E7": { 43 | "label": "Select", 44 | "cmnt": "Cycle effects", 45 | "cmd": "CY=0&FX=~" 46 | } 47 | } -------------------------------------------------------------------------------- /usermods/JSON_IR_remote/IR_Remote_Codes.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/JSON_IR_remote/IR_Remote_Codes.xlsx -------------------------------------------------------------------------------- /usermods/JSON_IR_remote/readme.md: -------------------------------------------------------------------------------- 1 | # JSON IR remote 2 | 3 | ## Purpose 4 | 5 | The JSON IR remote allows users to customize IR remote behavior without writing custom code and compiling. 6 | It also enables using any remote that is compatible with your IR receiver. Using the JSON IR remote, you can 7 | map buttons from any remote to any HTTP request API or JSON API command. 8 | 9 | ## Usage 10 | 11 | * Upload the IR config file, named _ir.json_ to your board using the [ip address]/edit url. Pick from one of the included files or create your own. 12 | * On the config > LED settings page, set the correct IR pin. 13 | * On the config > Sync Interfaces page, select "JSON Remote" as the Infrared remote. 14 | 15 | ## Modification 16 | 17 | * See if there is a json file with the same number of buttons as your remote. Many remotes will have the same internals and emit the same codes but have different labels. 18 | * In the ir.json file, each key will be the hex encoded IR code. 19 | * The "cmd" property will be the HTTP Request API or JSON API to execute when that button is pressed. 20 | * A limited number of c functions are supported (!incBrightness, !decBrightness, !presetFallback) 21 | * When using !presetFallback, include properties PL (preset to load), FX (effect to fall back to) and FP (palette to fall back to) 22 | * If the command is _repeatable_ and does not contain the "~" character, add a "rpt": true property. 23 | * Other properties are ignored, but having a label property may help when editing. 24 | 25 | 26 | Sample: 27 | { 28 | "0xFF629D": {"cmd": "T=2", "rpt": true, "label": "Toggle on/off"}, // HTTP command 29 | "0xFF9867": {"cmd": "A=~16", "label": "Inc brightness"}, // HTTP command with incrementing 30 | "0xFF38C7": {"cmd": {"bri": 10}, "label": "Dim to 10"}, // JSON command 31 | "0xFF22DD": {"cmd": "!presetFallback", "PL": 1, "FX": 16, "FP": 6, 32 | "label": "Preset 1 or fallback to Saw - Party"}, // c function 33 | } 34 | -------------------------------------------------------------------------------- /usermods/MY9291/usermode_MY9291.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wled.h" 4 | #include "MY92xx.h" 5 | 6 | #define MY92XX_MODEL MY92XX_MODEL_MY9291 7 | #define MY92XX_CHIPS 1 8 | #define MY92XX_DI_PIN 13 9 | #define MY92XX_DCKI_PIN 15 10 | 11 | #define MY92XX_RED 0 12 | #define MY92XX_GREEN 1 13 | #define MY92XX_BLUE 2 14 | #define MY92XX_WHITE 3 15 | 16 | class MY9291Usermod : public Usermod { 17 | private: 18 | my92xx _my92xx = my92xx(MY92XX_MODEL, MY92XX_CHIPS, MY92XX_DI_PIN, MY92XX_DCKI_PIN, MY92XX_COMMAND_DEFAULT); 19 | 20 | public: 21 | 22 | void setup() { 23 | _my92xx.setState(true); 24 | } 25 | 26 | void connected() { 27 | } 28 | 29 | void loop() { 30 | uint32_t c = strip.getPixelColor(0); 31 | int w = ((c >> 24) & 0xff) * bri / 255.0; 32 | int r = ((c >> 16) & 0xff) * bri / 255.0; 33 | int g = ((c >> 8) & 0xff) * bri / 255.0; 34 | int b = (c & 0xff) * bri / 255.0; 35 | _my92xx.setChannel(MY92XX_RED, r); 36 | _my92xx.setChannel(MY92XX_GREEN, g); 37 | _my92xx.setChannel(MY92XX_BLUE, b); 38 | _my92xx.setChannel(MY92XX_WHITE, w); 39 | _my92xx.update(); 40 | } 41 | 42 | uint16_t getId() { 43 | return USERMOD_ID_MY9291; 44 | } 45 | }; -------------------------------------------------------------------------------- /usermods/PWM_fan/readme.md: -------------------------------------------------------------------------------- 1 | # PWM fan 2 | 3 | v2 Usermod to to control PWM fan with RPM feedback and temperature control 4 | 5 | This usermod requires Dallas Temperature usermod to obtain temperature information. If this is not available the fan will always run at 100% speed. 6 | If the fan does not have _tacho_ (RPM) output you can set the _tacho-pin_ to -1 to not use that feature. 7 | 8 | You can also set the thershold temperature at which fan runs at lowest speed. If the actual temperature measured will be 3°C greater than threshold temperature the fan will run at 100%. 9 | 10 | If the _tacho_ is supported the current speed (in RPM) will be repored in WLED Info page. 11 | 12 | ## Installation 13 | 14 | Add the compile-time option `-D USERMOD_PWM_FAN` to your `platformio.ini` (or `platformio_override.ini`) or use `#define USERMOD_PWM_FAN` in `myconfig.h`. 15 | You will also need `-D USERMOD_DALLASTEMPERATURE`. 16 | 17 | ### Define Your Options 18 | 19 | All of the parameters are configured during run-time using Usermods settings page. 20 | This includes: 21 | 22 | * PWM output pin (can be configured at compile time `-D PWM_PIN=xx`) 23 | * tacho input pin (can be configured at compile time `-D TACHO_PIN=xx`) 24 | * sampling frequency in seconds 25 | * threshold temperature in degees C 26 | 27 | _NOTE:_ You may also need to tweak Dallas Temperature usermod sampling frequency to match PWM fan sampling frequency. 28 | 29 | ### PlatformIO requirements 30 | 31 | No special requirements. 32 | 33 | ## Change Log 34 | 35 | 2021-10 36 | * First public release 37 | -------------------------------------------------------------------------------- /usermods/QuinLED_Dig_Uno_Temp_MQTT/readme.md: -------------------------------------------------------------------------------- 1 | # QuinLED Dig Uno board 2 | 3 | These files allow WLED 0.9.1 to report the temp sensor on the Quinled board to MQTT. I use it to report the board temp to Home Assistant via MQTT, so it will send notifications if something happens and the board start to heat up. 4 | This code uses Aircookie's WLED software. It has a premade file for user modifications. I use it to publish the temperature from the dallas temperature sensor on the Quinled board. The entries for the top of the WLED00 file, initializes the required libraries, and variables for the sensor. The .ino file waits for 60 seconds, and checks to see if the MQTT server is connected (thanks Aircoookie). It then poles the sensor, and published it using the MQTT service already running, using the main topic programmed in the WLED UI. 5 | 6 | Installation of file: Copy and replace file in wled00 directory 7 | 8 | ## Project link 9 | 10 | * [QuinLED-Dig-Uno](https://quinled.info/2018/09/15/quinled-dig-uno/) - Project link 11 | 12 | ### Platformio requirements 13 | 14 | Uncomment `DallasTemperature@~3.8.0`,`OneWire@~2.3.5 under` `[common]` section in `platformio.ini`: 15 | 16 | ```ini 17 | # platformio.ini 18 | ... 19 | [platformio] 20 | ... 21 | ; default_envs = esp07 22 | default_envs = d1_mini 23 | ... 24 | [common] 25 | ... 26 | lib_deps_external = 27 | ... 28 | #For use SSD1306 OLED display uncomment following 29 | U8g2@~2.27.3 30 | #For Dallas sensor uncomment following 2 lines 31 | DallasTemperature@~3.8.0 32 | OneWire@~2.3.5 33 | ... 34 | ``` 35 | -------------------------------------------------------------------------------- /usermods/QuinLED_Dig_Uno_Temp_MQTT/usermod.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "wled.h" 3 | //Intiating code for QuinLED Dig-Uno temp sensor 4 | //Uncomment Celsius if that is your prefered temperature scale 5 | #include //Dallastemperature sensor 6 | #ifdef ARDUINO_ARCH_ESP32 //ESP32 boards 7 | OneWire oneWire(18); 8 | #else //ESP8266 boards 9 | OneWire oneWire(14); 10 | #endif 11 | DallasTemperature sensor(&oneWire); 12 | long temptimer = millis(); 13 | long lastMeasure = 0; 14 | #define Celsius // Show temperature mesaurement in Celcius otherwise is in Fahrenheit 15 | void userSetup() 16 | { 17 | // Start the DS18B20 sensor 18 | sensor.begin(); 19 | } 20 | 21 | //gets called every time WiFi is (re-)connected. Initialize own network interfaces here 22 | void userConnected() 23 | { 24 | 25 | } 26 | 27 | void userLoop() 28 | { 29 | temptimer = millis(); 30 | 31 | // Timer to publishe new temperature every 60 seconds 32 | if (temptimer - lastMeasure > 60000) { 33 | lastMeasure = temptimer; 34 | 35 | //Check if MQTT Connected, otherwise it will crash the 8266 36 | if (mqtt != nullptr){ 37 | sensor.requestTemperatures(); 38 | 39 | //Gets prefered temperature scale based on selection in definitions section 40 | #ifdef Celsius 41 | float board_temperature = sensor.getTempCByIndex(0); 42 | #else 43 | float board_temperature = sensors.getTempFByIndex(0); 44 | #endif 45 | 46 | //Create character string populated with user defined device topic from the UI, and the read temperature. Then publish to MQTT server. 47 | char subuf[38]; 48 | strcpy(subuf, mqttDeviceTopic); 49 | strcat(subuf, "/temperature"); 50 | mqtt->publish(subuf, 0, true, String(board_temperature).c_str()); 51 | return;} 52 | return;} 53 | return; 54 | } 55 | -------------------------------------------------------------------------------- /usermods/RTC/readme.md: -------------------------------------------------------------------------------- 1 | # DS1307/DS3231 Real time clock 2 | 3 | Gets the time from I2C RTC module on boot. This allows clocks to operate e.g. if temporarily no WiFi is available. 4 | The stored time is updated each time NTP is synced. 5 | 6 | ## Installation 7 | 8 | Add the build flag `-D USERMOD_RTC` to your platformio environment. 9 | -------------------------------------------------------------------------------- /usermods/RTC/usermod_rtc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // WLEDSR - make sure the "right" Wire object is availeable 4 | #include "src/dependencies/time/DS1307RTC.h" 5 | #include "wled.h" 6 | 7 | #if !defined(HW_PIN_SDA) && !defined(HW_PIN_SCL) // WLEDSR - don't overwrite global pins 8 | #ifdef ARDUINO_ARCH_ESP32 9 | #define HW_PIN_SCL 22 10 | #define HW_PIN_SDA 21 11 | #else 12 | #define HW_PIN_SCL 5 13 | #define HW_PIN_SDA 4 14 | #endif 15 | #endif 16 | 17 | //Connect DS1307 to standard I2C pins (ESP32: GPIO 21 (SDA)/GPIO 22 (SCL)) 18 | 19 | class RTCUsermod : public Usermod { 20 | private: 21 | unsigned long lastTime = 0; 22 | bool disabled = false; 23 | public: 24 | 25 | void setup() { 26 | PinManagerPinType pins[2] = { { HW_PIN_SCL, true }, { HW_PIN_SDA, true } }; 27 | if (!pinManager.allocateMultiplePins(pins, 2, PinOwner::HW_I2C)) { disabled = true; return; } 28 | Wire.begin(pins[1].pin, pins[0].pin); // WLEDSR this will silently fail if Wire is already started 29 | // Wire.setClock(400000); 30 | RTC.begin(); 31 | time_t rtcTime = RTC.get(); 32 | if (rtcTime) { 33 | toki.setTime(rtcTime,TOKI_NO_MS_ACCURACY,TOKI_TS_RTC); 34 | updateLocalTime(); 35 | } else { 36 | if (!RTC.chipPresent()) disabled = true; //don't waste time if H/W error 37 | } 38 | } 39 | 40 | void loop() { 41 | if (strip.isUpdating()) return; 42 | if (!disabled && toki.isTick()) { 43 | time_t t = toki.second(); 44 | if (abs(t - RTC.get())> 2) RTC.set(t); //set RTC to NTP/UI-provided value - WLEDSR allow up to 3 sec deviation 45 | } 46 | } 47 | 48 | /* 49 | * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object. 50 | * It will be called by WLED when settings are actually saved (for example, LED settings are saved) 51 | * I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings! 52 | */ 53 | void addToConfig(JsonObject& root) 54 | { 55 | //JsonObject top = root.createNestedObject("RTC"); 56 | //JsonArray pins = top.createNestedArray("pin"); 57 | //pins.add(HW_PIN_SCL); 58 | //pins.add(HW_PIN_SDA); 59 | } 60 | 61 | uint16_t getId() 62 | { 63 | return USERMOD_ID_RTC; 64 | } 65 | }; -------------------------------------------------------------------------------- /usermods/RelayBlinds/presets.json: -------------------------------------------------------------------------------- 1 | {"0":{},"2":{"n":"▲","win":"U0=2"},"1":{"n":"▼","win":"U0=1"}} -------------------------------------------------------------------------------- /usermods/RelayBlinds/readme.md: -------------------------------------------------------------------------------- 1 | # RelayBlinds usermod 2 | 3 | This simple usermod toggles two relay pins momentarily (default for 500ms) when `userVar0` is set. 4 | This can be used to e.g. "push" the buttons of a window blinds motor controller. 5 | 6 | v1 usermod. Please replace usermod.cpp in the `wled00` directory with the one in this file. 7 | You may upload `index.htm` to `[WLED-IP]/edit` to replace the default lighting UI with a simple Up/Down button one. 8 | Also, a simple `presets.json` file is available, this makes the relay actions controllable via two presets to facilitate control e.g. via the default UI or Alexa. -------------------------------------------------------------------------------- /usermods/RelayBlinds/usermod.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | 3 | //Use userVar0 and userVar1 (API calls &U0=,&U1=, uint16_t) 4 | 5 | //gets called once at boot. Do all initialization that doesn't depend on network here 6 | void userSetup() 7 | { 8 | 9 | } 10 | 11 | //gets called every time WiFi is (re-)connected. Initialize own network interfaces here 12 | void userConnected() 13 | { 14 | 15 | } 16 | 17 | /* 18 | * Physical IO 19 | */ 20 | #define PIN_UP_RELAY 4 21 | #define PIN_DN_RELAY 5 22 | #define PIN_ON_TIME 500 23 | bool upActive = false, upActiveBefore = false, downActive = false, downActiveBefore = false; 24 | unsigned long upStartTime = 0, downStartTime = 0; 25 | 26 | void handleRelay() 27 | { 28 | //up and down relays 29 | if (userVar0) { 30 | upActive = true; 31 | if (userVar0 == 1) { 32 | upActive = false; 33 | downActive = true; 34 | } 35 | userVar0 = 0; 36 | } 37 | 38 | if (upActive) 39 | { 40 | if(!upActiveBefore) 41 | { 42 | pinMode(PIN_UP_RELAY, OUTPUT); 43 | digitalWrite(PIN_UP_RELAY, LOW); 44 | upActiveBefore = true; 45 | upStartTime = millis(); 46 | DEBUG_PRINTLN("UPA"); 47 | } 48 | if (millis()- upStartTime > PIN_ON_TIME) 49 | { 50 | upActive = false; 51 | DEBUG_PRINTLN("UPN"); 52 | } 53 | } else if (upActiveBefore) 54 | { 55 | pinMode(PIN_UP_RELAY, INPUT); 56 | upActiveBefore = false; 57 | } 58 | 59 | if (downActive) 60 | { 61 | if(!downActiveBefore) 62 | { 63 | pinMode(PIN_DN_RELAY, OUTPUT); 64 | digitalWrite(PIN_DN_RELAY, LOW); 65 | downActiveBefore = true; 66 | downStartTime = millis(); 67 | } 68 | if (millis()- downStartTime > PIN_ON_TIME) 69 | { 70 | downActive = false; 71 | } 72 | } else if (downActiveBefore) 73 | { 74 | pinMode(PIN_DN_RELAY, INPUT); 75 | downActiveBefore = false; 76 | } 77 | } 78 | 79 | //loop. You can use "if (WLED_CONNECTED)" to check for successful connection 80 | void userLoop() 81 | { 82 | handleRelay(); 83 | } -------------------------------------------------------------------------------- /usermods/SN_Photoresistor/platformio_override.ini: -------------------------------------------------------------------------------- 1 | ; Options 2 | ; ------- 3 | ; USERMOD_SN_PHOTORESISTOR - define this to have this user mod included wled00\usermods_list.cpp 4 | ; USERMOD_SN_PHOTORESISTOR_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds 5 | ; USERMOD_SN_PHOTORESISTOR_FIRST_MEASUREMENT_AT - the number of milliseconds after boot to take first measurement, defaults to 20 seconds 6 | ; USERMOD_SN_PHOTORESISTOR_REFERENCE_VOLTAGE - the voltage supplied to the sensor, defaults to 5v 7 | ; USERMOD_SN_PHOTORESISTOR_ADC_PRECISION - the ADC precision is the number of distinguishable ADC inputs, defaults to 1024.0 (10 bits) 8 | ; USERMOD_SN_PHOTORESISTOR_RESISTOR_VALUE - the resistor size, defaults to 10000.0 (10K hms) 9 | ; USERMOD_SN_PHOTORESISTOR_OFFSET_VALUE - the offset value to report on, defaults to 25 10 | ; 11 | [env:usermod_sn_photoresistor_d1_mini] 12 | extends = env:d1_mini 13 | build_flags = 14 | ${common.build_flags_esp8266} 15 | -D USERMOD_SN_PHOTORESISTOR 16 | lib_deps = ${env.lib_deps} 17 | -------------------------------------------------------------------------------- /usermods/SN_Photoresistor/readme.md: -------------------------------------------------------------------------------- 1 | # SN_Photoresistor usermod 2 | 3 | This usermod will read from an attached photoresistor sensor like the KY-018 sensor. 4 | The luminance is displayed both in the Info section of the web UI as well as published to the `/luminance` MQTT topic if enabled. 5 | 6 | ## Installation 7 | 8 | Copy the example `platformio_override.ini` to the root directory. This file should be placed in the same directory as `platformio.ini`. 9 | 10 | ### Define Your Options 11 | 12 | * `USERMOD_SN_PHOTORESISTOR` - define this to have this user mod included wled00\usermods_list.cpp 13 | * `USERMOD_SN_PHOTORESISTOR_MEASUREMENT_INTERVAL` - the number of milliseconds between measurements, defaults to 60 seconds 14 | * `USERMOD_SN_PHOTORESISTOR_FIRST_MEASUREMENT_AT` - the number of milliseconds after boot to take first measurement, defaults to 20 seconds 15 | * `USERMOD_SN_PHOTORESISTOR_REFERENCE_VOLTAGE` - the voltage supplied to the sensor, defaults to 5v 16 | * `USERMOD_SN_PHOTORESISTOR_ADC_PRECISION` - the ADC precision is the number of distinguishable ADC inputs, defaults to 1024.0 (10 bits) 17 | * `USERMOD_SN_PHOTORESISTOR_RESISTOR_VALUE` - the resistor size, defaults to 10000.0 (10K hms) 18 | * `USERMOD_SN_PHOTORESISTOR_OFFSET_VALUE` - the offset value to report on, defaults to 25 19 | 20 | All parameters can be configured at runtime using Usermods settings page. 21 | 22 | ## Project link 23 | 24 | * [QuinLED-Dig-Uno](https://quinled.info/2018/09/15/quinled-dig-uno/) - Project link 25 | 26 | ### PlatformIO requirements 27 | 28 | If you are using `platformio_override.ini`, you should be able to refresh the task list and see your custom task, for example `env:usermod_sn_photoresistor_d1_mini`. 29 | 30 | ## Change Log 31 | -------------------------------------------------------------------------------- /usermods/SN_Photoresistor/usermods_list.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | /* 3 | * Register your v2 usermods here! 4 | */ 5 | #ifdef USERMOD_SN_PHOTORESISTOR 6 | #include "../usermods/SN_Photoresistor/usermod_sn_photoresistor.h" 7 | #endif 8 | 9 | void registerUsermods() 10 | { 11 | #ifdef USERMOD_SN_PHOTORESISTOR 12 | usermods.add(new Usermod_SN_Photoresistor()); 13 | #endif 14 | } -------------------------------------------------------------------------------- /usermods/ST7789_display/README.md: -------------------------------------------------------------------------------- 1 | # ST7789 TFT IPS Color display 240x240pxwith ESP32 boards 2 | 3 | This usermod allow to use 240x240 display to display following: 4 | 5 | * Network SSID; 6 | * IP address; 7 | * Brightness; 8 | * Chosen effect; 9 | * Chosen palette; 10 | * Estimated current in mA; 11 | 12 | ## Hardware 13 | 14 | *** 15 | ![Hardware](images/ST7789_Guide.jpg) 16 | 17 | ## Library used 18 | 19 | [Bodmer/TFT_eSPI](https://github.com/Bodmer/TFT_eSPI) 20 | 21 | ## Setup 22 | 23 | *** 24 | 25 | ### Platformio.ini changes 26 | 27 | In the `platformio.ini` file, uncomment the `TFT_eSPI` line within the [common] section, under `lib_deps`: 28 | 29 | ```ini 30 | # platformio.ini 31 | ... 32 | [common] 33 | ... 34 | lib_deps = 35 | ... 36 | #For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line 37 | #TFT_eSPI 38 | ... 39 | ``` 40 | 41 | Also, while in the `platformio.ini` file, you must change the environment setup to build for just the esp32dev platform as follows: 42 | 43 | Add lines to section: 44 | 45 | ```ini 46 | default_envs = esp32dev 47 | build_flags = ${common.build_flags_esp32} 48 | -D USERMOD_ST7789_DISPLAY 49 | 50 | ``` 51 | 52 | Save the `platformio.ini` file. Once this is saved, the required library files should be automatically downloaded for modifications in a later step. 53 | 54 | ### TFT_eSPI Library Adjustments 55 | 56 | We need to modify a file in the `TFT_eSPI` library. If you followed the directions to modify and save the `platformio.ini` file above, the `User_Setup_Select.h` file can be found in the `/.pio/libdeps/esp32dev/TFT_eSPI` folder. 57 | 58 | Modify the `User_Setup_Select.h` file as follows: 59 | 60 | * Comment out the following line (which is the 'default' setup file): 61 | 62 | ```ini 63 | //#include // Default setup is root library folder 64 | ``` 65 | 66 | * Add following line: 67 | 68 | ```ini 69 | #include // Setup file for ESP32 ST7789V SPI bus TFT 70 | ``` 71 | 72 | * Copy file `"Setup_ST7789_Display.h"` from usermod folder to `/.pio/libdeps/esp32dev/TFT_eSPI/User_Setups` 73 | -------------------------------------------------------------------------------- /usermods/ST7789_display/Setup_ST7789_Display.h: -------------------------------------------------------------------------------- 1 | // Setup for the ESP32 board with 1.5" 240x240 display 2 | 3 | // See SetupX_Template.h for all options available 4 | 5 | #define ST7789_DRIVER 6 | #define TFT_SDA_READ // Display has a bidirectionsl SDA pin 7 | 8 | #define TFT_WIDTH 240 9 | #define TFT_HEIGHT 240 10 | 11 | #define CGRAM_OFFSET // Library will add offsets required 12 | 13 | //#define TFT_MISO -1 14 | 15 | #define TFT_MOSI 21 16 | #define TFT_SCLK 22 17 | //#define TFT_CS 5 18 | #define TFT_DC 18 19 | #define TFT_RST 5 20 | 21 | #define TFT_BL 26 // Display backlight control pin 22 | 23 | #define TFT_BACKLIGHT_ON HIGH // HIGH or LOW are options 24 | 25 | #define LOAD_GLCD 26 | #define LOAD_FONT2 27 | #define LOAD_FONT4 28 | #define LOAD_FONT6 29 | #define LOAD_FONT7 30 | #define LOAD_FONT8 31 | #define LOAD_GFXFF 32 | 33 | //#define SMOOTH_FONT 34 | 35 | //#define SPI_FREQUENCY 27000000 36 | #define SPI_FREQUENCY 40000000 // Maximum for ILI9341 37 | 38 | 39 | #define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V -------------------------------------------------------------------------------- /usermods/ST7789_display/images/ST7789_Guide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/ST7789_display/images/ST7789_Guide.jpg -------------------------------------------------------------------------------- /usermods/Si7021_MQTT_HA/readme.md: -------------------------------------------------------------------------------- 1 | # Si7021 to MQTT (with Home Assistant Auto Discovery) usermod 2 | 3 | This usermod implements support for [Si7021 I²C temperature and humidity sensors](https://www.silabs.com/documents/public/data-sheets/Si7021-A20.pdf). 4 | 5 | The sensor data will *not* be shown on the WLED UI (so far) but published via MQTT to WLED's "build in" MQTT device topic. 6 | 7 | ``` 8 | temperature: $mqttDeviceTopic/si7021_temperature 9 | humidity: $mqttDeviceTopic/si7021_humidity 10 | ``` 11 | 12 | Additionally the following sensors can be published: 13 | 14 | ``` 15 | heat_index: $mqttDeviceTopic/si7021_heat_index 16 | dew_point: $mqttDeviceTopic/si7021_dew_point 17 | absolute_humidity: $mqttDeviceTopic/si7021_absolute_humidity 18 | ``` 19 | 20 | Sensor data will be updated/send every 60 seconds. 21 | 22 | This usermod also supports Home Assistant Auto Discovery. 23 | 24 | ## Settings via Usermod Setup 25 | 26 | - `enabled`: Enables this usermod 27 | - `Send Dew Point, Abs. Humidity and Heat Index`: Enables additional sensors 28 | - `Home Assistant MQTT Auto-Discovery`: Enables Home Assistant Auto Discovery 29 | 30 | # Installation 31 | 32 | ## Hardware 33 | 34 | Attach the Si7021 sensor to the I²C interface. 35 | 36 | Default PINs ESP32: 37 | 38 | ``` 39 | SCL_PIN = 22; 40 | SDA_PIN = 21; 41 | ``` 42 | 43 | Default PINs ESP8266: 44 | 45 | ``` 46 | SCL_PIN = 5; 47 | SDA_PIN = 4; 48 | ``` 49 | 50 | ## Software 51 | 52 | Add to `build_flags` in platformio.ini: 53 | 54 | ``` 55 | -D USERMOD_SI7021_MQTT_HA 56 | ``` 57 | 58 | Add to `lib_deps` in platformio.ini: 59 | 60 | ``` 61 | adafruit/Adafruit Si7021 Library @ 1.4.0 62 | BME280@~3.0.0 63 | ``` 64 | 65 | # Credits 66 | 67 | - Aircoookie for making WLED 68 | - Other usermod creators for example code (`sensors_to_mqtt` and `multi_relay` especially) 69 | - You, for reading this -------------------------------------------------------------------------------- /usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure1a.png -------------------------------------------------------------------------------- /usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure2a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure2a.png -------------------------------------------------------------------------------- /usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure3a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure3a.png -------------------------------------------------------------------------------- /usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure4a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure4a.png -------------------------------------------------------------------------------- /usermods/TTGO-T-Display/assets/ttgo_hardware1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/TTGO-T-Display/assets/ttgo_hardware1.png -------------------------------------------------------------------------------- /usermods/TTGO-T-Display/platformio_override.ini: -------------------------------------------------------------------------------- 1 | [env:esp32dev] 2 | build_flags = ${common.build_flags_esp32} 3 | ; PIN defines - uncomment and change, if needed: 4 | ; -D LEDPIN=2 5 | -D BTNPIN=35 6 | ; -D IRPIN=4 7 | ; -D RLYPIN=12 8 | ; -D RLYMDE=1 9 | -------------------------------------------------------------------------------- /usermods/Temperature/platformio_override.ini: -------------------------------------------------------------------------------- 1 | ; Options 2 | ; ------- 3 | ; USERMOD_DALLASTEMPERATURE - define this to have this user mod included wled00\usermods_list.cpp 4 | ; USERMOD_DALLASTEMPERATURE_CELSIUS - define this to report temperatures in degrees celsius, otherwise fahrenheit will be reported 5 | ; USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds 6 | ; USERMOD_DALLASTEMPERATURE_FIRST_MEASUREMENT_AT - the number of milliseconds after boot to take first measurement, defaults to 20 seconds 7 | ; 8 | [env:d1_mini_usermod_dallas_temperature_C] 9 | extends = env:d1_mini 10 | build_flags = ${common.build_flags_esp8266} -D USERMOD_DALLASTEMPERATURE -D USERMOD_DALLASTEMPERATURE_CELSIUS 11 | lib_deps = ${env.lib_deps} 12 | milesburton/DallasTemperature@^3.9.0 13 | OneWire@~2.3.5 14 | -------------------------------------------------------------------------------- /usermods/Temperature/readme.md: -------------------------------------------------------------------------------- 1 | # Temperature usermod 2 | 3 | Based on the excellent `QuinLED_Dig_Uno_Temp_MQTT` by srg74 and 400killer! 4 | This usermod will read from an attached DS18B20 temperature sensor (as available on the QuinLED Dig-Uno) 5 | The temperature is displayed both in the Info section of the web UI as well as published to the `/temperature` MQTT topic if enabled. 6 | This usermod may be expanded with support for different sensor types in the future. 7 | 8 | If temperature sensor is not detected during boot, this usermod will be disabled. 9 | 10 | ## Installation 11 | 12 | Copy the example `platformio_override.ini` to the root directory. This file should be placed in the same directory as `platformio.ini`. 13 | 14 | ### Define Your Options 15 | 16 | * `USERMOD_DALLASTEMPERATURE` - define this to have this user mod included wled00\usermods_list.cpp 17 | * `USERMOD_DALLASTEMPERATURE_FIRST_MEASUREMENT_AT` - the number of milliseconds after boot to take first measurement, defaults to 20 seconds 18 | 19 | All parameters can be configured at runtime using Usermods settings page, including pin, selection to display temerature in degrees Celsius or Farenheit mand measurement interval. 20 | 21 | ## Project link 22 | 23 | * [QuinLED-Dig-Uno](https://quinled.info/2018/09/15/quinled-dig-uno/) - Project link 24 | * [Srg74-WLED-Wemos-shield](https://github.com/srg74/WLED-wemos-shield) - another great DIY WLED board 25 | 26 | ### PlatformIO requirements 27 | 28 | If you are using `platformio_override.ini`, you should be able to refresh the task list and see your custom task, for example `env:d1_mini_usermod_dallas_temperature_C`. 29 | 30 | 31 | If you are not using `platformio_override.ini`, you might have to uncomment `OneWire@~2.3.5 under` `[common]` section in `platformio.ini`: 32 | 33 | ```ini 34 | # platformio.ini 35 | ... 36 | [platformio] 37 | ... 38 | ; default_envs = esp07 39 | default_envs = d1_mini 40 | ... 41 | [common] 42 | ... 43 | lib_deps = 44 | ... 45 | #For Dallas sensor uncomment following line 46 | OneWire@~2.3.5 47 | ... 48 | ``` 49 | 50 | ## Change Log 51 | 52 | 2020-09-12 53 | * Changed to use async, non-blocking implementation 54 | * Do not report low temperatures that indicate an error to mqtt 55 | * Disable plugin if temperature sensor not detected 56 | * Report the number of seconds until the first read in the info screen instead of sensor error 57 | 2021-04 58 | * Adaptation for runtime configuration. -------------------------------------------------------------------------------- /usermods/Temperature/usermods_list.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | /* 3 | * Register your v2 usermods here! 4 | */ 5 | 6 | /* 7 | * Add/uncomment your usermod filename here (and once more below) 8 | * || || || 9 | * \/ \/ \/ 10 | */ 11 | //#include "usermod_v2_example.h" 12 | #ifdef USERMOD_DALLASTEMPERATURE 13 | #include "../usermods/Temperature/usermod_temperature.h" 14 | #endif 15 | 16 | //#include "usermod_v2_empty.h" 17 | 18 | void registerUsermods() 19 | { 20 | /* 21 | * Add your usermod class name here 22 | * || || || 23 | * \/ \/ \/ 24 | */ 25 | //usermods.add(new MyExampleUsermod()); 26 | #ifdef USERMOD_DALLASTEMPERATURE 27 | usermods.add(new UsermodTemperature()); 28 | #endif 29 | 30 | //usermods.add(new UsermodRenameMe()); 31 | } -------------------------------------------------------------------------------- /usermods/UserModv2_SunRiseAndSet/README.md: -------------------------------------------------------------------------------- 1 | WLED v2 UserMod for running macros at sunrise and sunset. 2 | 3 | At the time of this text, this user mod requires code to be changed to set certain variables: 4 | 1. To reflect the user's graphical location (latitude/longitude) used for calculating apparent sunrise/sunset 5 | 2. To specify which macros will be run at sunrise and/or sunset. (defaults to 15 at sunrise and 16 at sunset) 6 | 3. To optionally provide an offset from sunrise/sunset, in minutes (max of +/- 2 hours), when the macro will be run. 7 | 8 | In addition, WLED must be configured to get time from NTP (and the time must be retrieved via NTP.) 9 | 10 | Please open the UserMod_SunRiseAndSet.h file for instructions on what needs to be changed, where to copy files, etc. 11 | 12 | If this usermod proves useful enough, the code might eventually be updated to allow prompting for the required information 13 | via the web interface and to store settings in EEPROM instead of hard-coding in the .h file. 14 | 15 | This usermod has only been tested on the esp32dev platform, but there's no reason it wouldn't work on other platforms. 16 | -------------------------------------------------------------------------------- /usermods/VL53L0X_gestures/readme.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | That usermod implements support of simple hand gestures with VL53L0X sensor: on/off and brightness correction. 4 | It can be useful for kitchen strips to avoid any touches. 5 | - on/off - just swipe a hand below your sensor ("shortPressAction" is called and can be customized through WLED macros) 6 | - brightness correction - keep your hand below sensor for 1 second to switch to "brightness" mode. 7 | Configure brightness by changing distance to the sensor (see parameters below for customization). 8 | "macroLongPress" is also called here. 9 | 10 | ## Installation 11 | 12 | 1. Attach VL53L0X sensor to i2c pins according to default pins for your board. 13 | 2. Add `-D USERMOD_VL53L0X_GESTURES` to your build flags at platformio.ini (plaformio_override.ini) for needed environment. 14 | In my case, for example: `build_flags = ${common.build_flags_esp8266} -D RLYPIN=12 -D USERMOD_VL53L0X_GESTURES` 15 | 3. Add "pololu/VL53L0X" dependency below to `lib_deps` like this: 16 | ```ini 17 | lib_deps = ${env.lib_deps} 18 | pololu/VL53L0X @ ^1.3.0 19 | ``` 20 | 21 | My entire `platformio_override.ini` for example (for nodemcu board): 22 | ```ini 23 | [platformio] 24 | default_envs = nodemcu 25 | 26 | [env:nodemcu] 27 | board = nodemcu 28 | platform = ${common.platform_wled_default} 29 | platform_packages = ${common.platform_packages} 30 | board_build.ldscript = ${common.ldscript_4m1m} 31 | build_unflags = ${common.build_unflags} 32 | build_flags = ${common.build_flags_esp8266} -D RLYPIN=12 -D USERMOD_VL53L0X_GESTURES 33 | lib_deps = ${env.lib_deps} 34 | pololu/VL53L0X @ ^1.3.0 35 | ``` -------------------------------------------------------------------------------- /usermods/Wemos_D1_mini+Wemos32_mini_shield/readme.md: -------------------------------------------------------------------------------- 1 | # Wemos D1 mini and Wemos32 mini shield 2 | - Installation of file: Copy and replace file in wled00 directory 3 | - For BME280 sensor use usermod_bme280.cpp. Copy to wled00 and rename to usermod.cpp 4 | - Added third choice of controller Heltec WiFi-Kit-8. Totally DIY but with OLED display. 5 | ## Project repository 6 | - [Original repository](https://github.com/srg74/WLED-wemos-shield) - WLED Wemos shield repository 7 | - [Wemos shield project Wiki](https://github.com/srg74/WLED-wemos-shield/wiki) 8 | - [Precompiled WLED firmware](https://github.com/srg74/WLED-wemos-shield/tree/master/resources/Firmware) 9 | ## Features 10 | - SSD1306 128x32 or 128x64 I2C OLED display 11 | - On screen IP address, SSID and controller status (e.g. ON or OFF, recent effect) 12 | - Auto display shutoff for saving display lifetime 13 | - Dallas temperature sensor 14 | - Reporting temperature to MQTT broker 15 | - Relay for energy saving 16 | 17 | ## Hardware 18 | ![Shield](https://github.com/srg74/WLED-wemos-shield/blob/master/resources/Images/Assembly_8.jpg) 19 | 20 | ## Functionality checked with 21 | 22 | - Wemos D1 mini original v3.1 and clones 23 | - Wemos32 mini 24 | - PlatformIO 25 | - SSD1306 128x32 I2C OLED display 26 | - DS18B20 (temperature sensor) 27 | - BME280 (temperature, humidity and pressure sensor) 28 | - Push button (N.O. momentary switch) 29 | 30 | ### Platformio requirements 31 | 32 | For Dallas sensor uncomment `U8g2@~2.27.3`,`DallasTemperature@~3.8.0`,`OneWire@~2.3.5 under` `[common]` section in `platformio.ini`: 33 | ```ini 34 | # platformio.ini 35 | ... 36 | [platformio] 37 | ... 38 | ; default_envs = esp07 39 | default_envs = d1_mini 40 | ... 41 | [common] 42 | ... 43 | lib_deps_external = 44 | ... 45 | #For use SSD1306 OLED display uncomment following 46 | U8g2@~2.27.3 47 | #For Dallas sensor uncomment following 2 lines 48 | DallasTemperature@~3.8.0 49 | OneWire@~2.3.5 50 | ... 51 | ``` 52 | 53 | For BME280 sensor uncomment `U8g2@~2.27.3`,`BME280@~3.0.0 under` `[common]` section in `platformio.ini`: 54 | ```ini 55 | # platformio.ini 56 | ... 57 | [platformio] 58 | ... 59 | ; default_envs = esp07 60 | default_envs = d1_mini 61 | ... 62 | [common] 63 | ... 64 | lib_deps_external = 65 | ... 66 | #For use SSD1306 OLED display uncomment following 67 | U8g2@~2.27.3 68 | #For BME280 sensor uncomment following 69 | BME280@~3.0.0 70 | ... 71 | ``` 72 | -------------------------------------------------------------------------------- /usermods/artifx/artifx.css: -------------------------------------------------------------------------------- 1 | .ceTextarea { 2 | width: 90%; 3 | height: 300px; 4 | resize: none; 5 | white-space: pre; 6 | } 7 | 8 | #kceEditor { 9 | max-width: 490px; 10 | display: inline-block; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /usermods/battery_keypad_controller/README.md: -------------------------------------------------------------------------------- 1 | # Battery powered controller with keypad 2 | 3 | I'm using this controller for a festival totem. Runs on 3 18650 Cells, can deliver >5A current. 4 | 5 | Via keypad one can select 8 presets, change effect, effect speed, effect intensity and palette. Brightness can be 6 | adjusted with a potentiometer. 7 | 8 | ## Pictures 9 | 10 | ![bat-key-ctrl-1](assets/bat-key-ctrl-1.jpg) 11 | ![bat-key-ctrl-2](assets/bat-key-ctrl-2.jpg) 12 | ![bat-key-ctrl-3](assets/bat-key-ctrl-3.jpg) 13 | -------------------------------------------------------------------------------- /usermods/battery_keypad_controller/assets/bat-key-ctrl-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/battery_keypad_controller/assets/bat-key-ctrl-1.jpg -------------------------------------------------------------------------------- /usermods/battery_keypad_controller/assets/bat-key-ctrl-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/battery_keypad_controller/assets/bat-key-ctrl-2.jpg -------------------------------------------------------------------------------- /usermods/battery_keypad_controller/assets/bat-key-ctrl-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/battery_keypad_controller/assets/bat-key-ctrl-3.jpg -------------------------------------------------------------------------------- /usermods/battery_status_basic/assets/battery_connection_schematic_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/battery_status_basic/assets/battery_connection_schematic_01.png -------------------------------------------------------------------------------- /usermods/battery_status_basic/assets/battery_connection_schematic_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/battery_status_basic/assets/battery_connection_schematic_02.png -------------------------------------------------------------------------------- /usermods/battery_status_basic/assets/battery_info_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/battery_status_basic/assets/battery_info_screen.png -------------------------------------------------------------------------------- /usermods/buzzer/usermod_v2_buzzer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wled.h" 4 | #include "Arduino.h" 5 | 6 | #include 7 | 8 | #define USERMOD_ID_BUZZER 900 9 | #ifndef USERMOD_BUZZER_PIN 10 | #define USERMOD_BUZZER_PIN GPIO_NUM_32 11 | #endif 12 | 13 | /* 14 | * Usermods allow you to add own functionality to WLED more easily 15 | * See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality 16 | * 17 | * Using a usermod: 18 | * 1. Copy the usermod into the sketch folder (same folder as wled00.ino) 19 | * 2. Register the usermod by adding #include "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp 20 | */ 21 | 22 | class BuzzerUsermod : public Usermod { 23 | private: 24 | unsigned long lastTime_ = 0; 25 | unsigned long delay_ = 0; 26 | std::deque> sequence_ {}; 27 | public: 28 | /* 29 | * setup() is called once at boot. WiFi is not yet connected at this point. 30 | * You can use it to initialize variables, sensors or similar. 31 | */ 32 | void setup() { 33 | // Setup the pin, and default to LOW 34 | pinMode(USERMOD_BUZZER_PIN, OUTPUT); 35 | digitalWrite(USERMOD_BUZZER_PIN, LOW); 36 | 37 | // Beep on startup 38 | sequence_.push_back({ HIGH, 50 }); 39 | sequence_.push_back({ LOW, 0 }); 40 | } 41 | 42 | 43 | /* 44 | * connected() is called every time the WiFi is (re)connected 45 | * Use it to initialize network interfaces 46 | */ 47 | void connected() { 48 | // Double beep on WiFi 49 | sequence_.push_back({ LOW, 100 }); 50 | sequence_.push_back({ HIGH, 50 }); 51 | sequence_.push_back({ LOW, 30 }); 52 | sequence_.push_back({ HIGH, 50 }); 53 | sequence_.push_back({ LOW, 0 }); 54 | } 55 | 56 | /* 57 | * loop() is called continuously. Here you can check for events, read sensors, etc. 58 | */ 59 | void loop() { 60 | if (sequence_.size() < 1) return; // Wait until there is a sequence 61 | if (millis() - lastTime_ <= delay_) return; // Wait until delay has elapsed 62 | 63 | auto event = sequence_.front(); 64 | sequence_.pop_front(); 65 | 66 | digitalWrite(USERMOD_BUZZER_PIN, event.first); 67 | delay_ = event.second; 68 | 69 | lastTime_ = millis(); 70 | } 71 | 72 | 73 | /* 74 | * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!). 75 | * This could be used in the future for the system to determine whether your usermod is installed. 76 | */ 77 | uint16_t getId() 78 | { 79 | return USERMOD_ID_BUZZER; 80 | } 81 | }; -------------------------------------------------------------------------------- /usermods/mqtt_switch_v2/README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATION NOTICE 2 | This usermod is deprecated and no longer maintained. It will be removed in a future WLED release. Please use usermod multi_relay which has more features. 3 | 4 | 5 | # MQTT controllable switches 6 | This usermod allows controlling switches (e.g. relays) via MQTT. 7 | 8 | ## Usermod installation 9 | 10 | 1. Copy the file `usermod_mqtt_switch.h` to the `wled00` directory. 11 | 2. Register the usermod by adding `#include "usermod_mqtt_switch.h"` in the top and `registerUsermod(new UsermodMqttSwitch());` in the bottom of `usermods_list.cpp`. 12 | 13 | 14 | Example `usermods_list.cpp`: 15 | 16 | ``` 17 | #include "wled.h" 18 | #include "usermod_mqtt_switch.h" 19 | 20 | void registerUsermods() 21 | { 22 | usermods.add(new UsermodMqttSwitch()); 23 | } 24 | ``` 25 | 26 | ## Define pins 27 | Add a define for MQTTSWITCHPINS to platformio_override.ini. 28 | The following example defines 3 switches connected to the GPIO pins 13, 5 and 2: 29 | 30 | ``` 31 | [env:livingroom] 32 | board = esp12e 33 | platform = ${common.platform_wled_default} 34 | board_build.ldscript = ${common.ldscript_4m1m} 35 | build_flags = ${common.build_flags_esp8266} 36 | -D LEDPIN=3 37 | -D BTNPIN=4 38 | -D RLYPIN=12 39 | -D RLYMDE=1 40 | -D STATUSPIN=15 41 | -D MQTTSWITCHPINS="13, 5, 2" 42 | ``` 43 | 44 | Pins can be inverted by setting `MQTTSWITCHINVERT`. For example `-D MQTTSWITCHINVERT="false, false, true"` would invert the switch on pin 2 in the previous example. 45 | 46 | The default state after booting before any MQTT message can be set by `MQTTSWITCHDEFAULTS`. For example `-D MQTTSWITCHDEFAULTS="ON, OFF, OFF"` would power on the switch on pin 13 and power off switches on pins 5 and 2. 47 | 48 | ## MQTT topics 49 | This usermod listens on `[mqttDeviceTopic]/switch/0/set` (where 0 is replaced with the index of the switch) for commands. Anything starting with `ON` turns on the switch, everything else turns it off. 50 | Feedback about the current state is provided at `[mqttDeviceTopic]/switch/0/state`. 51 | 52 | ### Home Assistant auto-discovery 53 | Auto-discovery information is automatically published and you shoudn't have to do anything to register the switches in Home Assistant. 54 | 55 | -------------------------------------------------------------------------------- /usermods/photoresistor_sensor_mqtt_v1/README.md: -------------------------------------------------------------------------------- 1 | # Photoresister sensor with MQTT 2 | 3 | This simple usermod allows attaching a photoresistor sensor like the KY-018 and publish the readings in percentage over MQTT. The frequency of MQTT messages can be modified, and there is a threshold value that can be set so that significant changes in the readings can be published immediately instead of waiting for the next update. This was found to be a good compromise between spamming MQTT messages and delayed updates. 4 | 5 | I also found it useful to limit the frequency of analog pin reads because otherwise the board hangs. 6 | 7 | This usermod has only been tested with the KY-018 sensor though should work for any other analog pin sensor. Note that this does not control the LED strip directly, it only publishes MQTT readings for use with other integrations like Home Assistant. 8 | 9 | ## Installation 10 | 11 | Copy and replace the file `usermod.cpp` in wled00 directory. 12 | -------------------------------------------------------------------------------- /usermods/photoresistor_sensor_mqtt_v1/usermod.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | /* 3 | * This v1 usermod file allows you to add own functionality to WLED more easily 4 | * See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality 5 | * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in const.h) 6 | * If you just need 8 bytes, use 2551-2559 (you do not need to increase EEPSIZE) 7 | * 8 | * Consider the v2 usermod API if you need a more advanced feature set! 9 | */ 10 | 11 | //Use userVar0 and userVar1 (API calls &U0=,&U1=, uint16_t) 12 | 13 | const int LIGHT_PIN = A0; // define analog pin 14 | const long UPDATE_MS = 30000; // Upper threshold between mqtt messages 15 | const char MQTT_TOPIC[] = "/light"; // MQTT topic for sensor values 16 | const int CHANGE_THRESHOLD = 5; // Change threshold in percentage to send before UPDATE_MS 17 | 18 | // variables 19 | long lastTime = 0; 20 | long timeDiff = 0; 21 | long readTime = 0; 22 | int lightValue = 0; 23 | float lightPercentage = 0; 24 | float lastPercentage = 0; 25 | 26 | //gets called once at boot. Do all initialization that doesn't depend on network here 27 | void userSetup() 28 | { 29 | pinMode(LIGHT_PIN, INPUT); 30 | } 31 | 32 | //gets called every time WiFi is (re-)connected. Initialize own network interfaces here 33 | void userConnected() 34 | { 35 | 36 | } 37 | 38 | void publishMqtt(float state) 39 | { 40 | //Check if MQTT Connected, otherwise it will crash the 8266 41 | if (mqtt != nullptr){ 42 | char subuf[38]; 43 | strcpy(subuf, mqttDeviceTopic); 44 | strcat(subuf, MQTT_TOPIC); 45 | mqtt->publish(subuf, 0, true, String(state).c_str()); 46 | } 47 | } 48 | 49 | //loop. You can use "if (WLED_CONNECTED)" to check for successful connection 50 | void userLoop() 51 | { 52 | // Read only every 500ms, otherwise it causes the board to hang 53 | if (millis() - readTime > 500) 54 | { 55 | readTime = millis(); 56 | timeDiff = millis() - lastTime; 57 | 58 | // Convert value to percentage 59 | lightValue = analogRead(LIGHT_PIN); 60 | lightPercentage = ((float)lightValue * -1 + 1024)/(float)1024 *100; 61 | 62 | // Send MQTT message on significant change or after UPDATE_MS 63 | if (abs(lightPercentage - lastPercentage) > CHANGE_THRESHOLD || timeDiff > UPDATE_MS) 64 | { 65 | publishMqtt(lightPercentage); 66 | lastTime = millis(); 67 | lastPercentage = lightPercentage; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /usermods/project_cars_shiftlight/readme.md: -------------------------------------------------------------------------------- 1 | ### Shift Light for Project Cars 2 | 3 | Turn your WLED lights into a rev light and shift indicator for Project Cars. 4 | 5 | It is pretty straight forward to use. 6 | 7 | 1. Make sure, your WLED device and your PC/console are on the same network and can talk to each other 8 | 9 | 2. Go to the gameplay settings menu in PCARS and enable UDP. There are 9 numbers you can choose from. This is the refresh rate. The lower the number, the better. But you might run into problems at faster rates. 10 | 11 | | Number | Updates/Second | 12 | | ------ | -------------- | 13 | | 1 | 60 | 14 | | 2 | 50 | 15 | | 3 | 40 | 16 | | 4 | 30 | 17 | | 5 | 20 | 18 | | 6 | 15 | 19 | | 7 | 10 | 20 | | 8 | 05 | 21 | | 9 | 1 | 22 | 23 | 3. once you enter a race, WLED should automatically shift to PCARS mode. Done. 24 | -------------------------------------------------------------------------------- /usermods/readme.md: -------------------------------------------------------------------------------- 1 | ### Usermods 2 | 3 | This folder serves as a repository for usermods (custom `usermod.cpp` files)! 4 | 5 | If you have created an usermod that you believe is useful (for example to support a particular sensor, display, feature...), feel free to contribute by opening a pull request! 6 | 7 | In order for other people to be able to have fun with your usermod, please keep these points in mind: 8 | 9 | - Create a folder in this folder with a descriptive name (for example `usermod_ds18b20_temp_sensor_mqtt`) 10 | - Include your custom files 11 | - If your usermod requires changes to other WLED files, please write a `readme.md` outlining the steps one has to take to use the usermod 12 | - Create a pull request! 13 | - If your feature is useful for the majority of WLED users, I will consider adding it to the base code! 14 | 15 | While I do my best to not break too much, keep in mind that as WLED is being updated, usermods might break. 16 | I am not actively maintaining any usermod in this directory, that is your responsibility as the creator of the usermod. 17 | 18 | For new usermods, I would recommend trying out the new v2 usermod API, which allows installing multiple usermods at once and new functions! 19 | You can take a look at `EXAMPLE_v2` for some documentation and at `Temperature` for a completed v2 usermod! 20 | 21 | Thank you for your help :) 22 | -------------------------------------------------------------------------------- /usermods/rotary_encoder_change_effect/wled06_usermod.ino: -------------------------------------------------------------------------------- 1 | //Use userVar0 and userVar1 (API calls &U0=,&U1=, uint16_t) 2 | 3 | long lastTime = 0; 4 | int delayMs = 10; 5 | const int pinA = D6; //data 6 | const int pinB = D7; //clk 7 | int oldA = LOW; 8 | 9 | //gets called once at boot. Do all initialization that doesn't depend on network here 10 | void userSetup() { 11 | pinMode(pinA, INPUT_PULLUP); 12 | pinMode(pinB, INPUT_PULLUP); 13 | } 14 | 15 | //gets called every time WiFi is (re-)connected. Initialize own network interfaces here 16 | void userConnected() { 17 | } 18 | 19 | //loop. You can use "if (WLED_CONNECTED)" to check for successful connection 20 | void userLoop() { 21 | if (millis()-lastTime > delayMs) { 22 | int A = digitalRead(pinA); 23 | int B = digitalRead(pinB); 24 | 25 | if (oldA == LOW && A == HIGH) { 26 | if (oldB == HIGH) { 27 | // bri += 10; 28 | // if (bri > 250) bri = 10; 29 | effectCurrent += 1; 30 | if (effectCurrent >= MODE_COUNT) effectCurrent = 0; 31 | } 32 | else { 33 | // bri -= 10; 34 | // if (bri < 10) bri = 250; 35 | effectCurrent -= 1; 36 | if (effectCurrent < 0) effectCurrent = (MODE_COUNT-1); 37 | } 38 | oldA = A; 39 | 40 | //call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (No notification) 41 | // 6: fx changed 7: hue 8: preset cycle 9: blynk 10: alexa 42 | colorUpdated(CALL_MODE_FX_CHANGED); 43 | lastTime = millis(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /usermods/sensors_to_mqtt/readme.md: -------------------------------------------------------------------------------- 1 | # Sensors To Home Assistant (or mqtt) 2 | 3 | This usermod will publish values of the BMP280, CCS811 and Si7021 sensors to Home Assistant via MQTT. 4 | 5 | Its using home assistant automatic device discovery feature. 6 | 7 | The use of Home Assistant is not mandatory; it will publish the sensor values via MQTT just fine without it. 8 | 9 | Its resusing the mqtt connection set in the WLED web user interface. 10 | 11 | ## Maintainer 12 | 13 | twitter.com/mpronk89 14 | 15 | ## Features 16 | 17 | - Reads BMP280, CCS811 and Si7021 senors 18 | - Publishes via MQTT, configured via webui of wled 19 | - Announces device in Home Assistant for easy setup 20 | - Efficient energy usage 21 | - Updates every 60 seconds 22 | 23 | ## Example mqtt topics: 24 | 25 | `$mqttDeviceTopic` is set in webui of WLED! 26 | 27 | ``` 28 | temperature: $mqttDeviceTopic/temperature 29 | pressure: $mqttDeviceTopic/pressure 30 | humidity: $mqttDeviceTopic/humidity 31 | tvoc: $mqttDeviceTopic/tvoc 32 | eCO2: $mqttDeviceTopic/eco2 33 | IAQ: $mqttDeviceTopic/iaq 34 | ``` 35 | 36 | # Installation 37 | 38 | ## Hardware 39 | 40 | ### Requirements 41 | 42 | 1. BMP280/CCS811/Si7021 sensor. E.g. https://aliexpress.com/item/32979998543.html 43 | 2. A microcontroller which can talk i2c, e.g. esp32 44 | 45 | ### installation 46 | 47 | Attach the sensor to the i2c interface. 48 | 49 | Default PINs esp32: 50 | 51 | ``` 52 | SCL_PIN = 22; 53 | SDA_PIN = 21; 54 | ``` 55 | 56 | Default PINs ESP8266: 57 | 58 | ``` 59 | SCL_PIN = 5; 60 | SDA_PIN = 4; 61 | ``` 62 | 63 | ## Enable in WLED 64 | 65 | 1. Copy `usermod_v2_SensorsToMqtt.h` into the `wled00` directory. 66 | 2. Add to `build_flags` in platformio.ini: 67 | 68 | ``` 69 | -D USERMOD_SENSORSTOMQTT 70 | ``` 71 | 72 | 3. And add to `lib_deps` in platformio.ini: 73 | 74 | ``` 75 | adafruit/Adafruit BMP280 Library @ 2.1.0 76 | adafruit/Adafruit CCS811 Library @ 1.0.4 77 | adafruit/Adafruit Si7021 Library @ 1.4.0 78 | ``` 79 | 80 | The #ifdefs in `usermods_list.cpp` should do the rest :) 81 | 82 | # Credits 83 | 84 | - Aircoookie for making WLED 85 | - Other usermod creators for example code 86 | - Bouke_Regnerus for https://community.home-assistant.io/t/example-indoor-air-quality-text-sensor-using-ccs811-sensor/125854 87 | - You, for reading this 88 | -------------------------------------------------------------------------------- /usermods/seven_segment_display/readme.md: -------------------------------------------------------------------------------- 1 | # Seven Segment Display 2 | 3 | Usermod that uses the overlay feature to create a configurable seven segment display. 4 | This has only been tested on a single configuration. Colon support is entirely untested. 5 | 6 | ## Installation 7 | 8 | Add the compile-time option `-D USERMOD_SEVEN_SEGMENT` to your `platformio.ini` (or `platformio_override.ini`) or use `#define USERMOD_SEVEN_SEGMENT` in `my_config.h`. 9 | 10 | ## Settings 11 | Settings can be controlled through both the usermod setting page and through MQTT with a raw payload. 12 | ##### Example 13 | Topic ```/sevenSeg/perSegment/set``` 14 | Payload ```3``` 15 | #### perSegment -- ssLEDPerSegment 16 | The number of individual LEDs per segment. There are 7 segments per digit. 17 | #### perPeriod -- ssLEDPerPeriod 18 | The number of individual LEDs per period. A ':' has 2x periods. 19 | #### startIdx -- ssStartLED 20 | Index of the LED that the display starts at. Allows a seven segment display to be in the middle of a string. 21 | #### timeEnable -- ssTimeEnabled 22 | When true, when displayMask is configured for a time output and no message is set the time will be displayed. 23 | #### scrollSpd -- ssScrollSpeed 24 | Time, in milliseconds, between message shifts when the length of displayMsg exceeds the length of the displayMask. 25 | #### displayMask -- ssDisplayMask 26 | This should represent the configuration of the physical display. 27 |
28 | HH - 0-23. hh - 1-12, kk - 1-24 hours  
29 | MM or mm - 0-59 minutes  
30 | SS or ss = 0-59 seconds  
31 | : for a colon  
32 | All others for alpha numeric, (will be blank when displaying time)
33 | 
34 | ##### Example 35 | ```HHMMSS ``` 36 | ```hh:MM:SS ``` 37 | #### displayMsg -- ssDisplayMessage 38 | Message to be displayed across the display. If the length exceeds the length of the displayMask the message will scroll at scrollSpd. To 'remove' a message or revert back to time, if timeEnabled is true, set the message to '~'. 39 | #### displayCfg -- ssDisplayConfig 40 | The order that your LEDs are configured. All seven segments in the display need to be wired the same way. 41 |
42 |            -------
43 |          /   A   /          0 - EDCGFAB
44 |         / F     / B         1 - EDCBAFG
45 |        /       /            2 - GCDEFAB
46 |        -------              3 - GBAFEDC
47 |      /   G   /              4 - FABGEDC
48 |     / E     / C             5 - FABCDEG
49 |    /       /
50 |    -------
51 |       D
52 | 
53 | 54 | ## Version 55 | 20211009 - Initial release 56 | -------------------------------------------------------------------------------- /usermods/stairway_wipe_basic/readme.md: -------------------------------------------------------------------------------- 1 | ### Stairway lighting 2 | 3 | Quick usermod to accomplish something similar to [this video](https://www.youtube.com/watch?v=NHkju5ncC4A). 4 | 5 | This usermod allows you to add a lightstrip alongside or on the steps of a staircase. 6 | When the `userVar0` variable is set, the LEDs will gradually turn on in a Wipe effect. 7 | Both directions are supported by setting userVar0 to 1 and 2, respectively (HTTP API commands `U0=1` and `U0=2`). 8 | 9 | After the Wipe is complete, the light will either stay on (Solid effect) indefinitely or after `userVar1` seconds have elapsed. 10 | If userVar0 is updated (e.g. by triggering a second sensor) the light will slowly fade off. 11 | This could be extended to also run a Wipe effect in reverse order to turn the LEDs back off. 12 | 13 | This is just a basic version to accomplish this using HTTP API calls `U0` and `U1` and/or macros. 14 | It should be easy to adapt this code however to interface with motion sensors or other input devices. -------------------------------------------------------------------------------- /usermods/usermod_rotary_brightness_color/README.md: -------------------------------------------------------------------------------- 1 | # Rotary Encoder (Brightness and Color) 2 | 3 | V2 usermod that allows changing brightness and color using a rotary encoder, 4 | change between modes by pressing a button (many encoders have one included) 5 | 6 | but it will wait for AUTOSAVE_SETTLE_MS milliseconds, a "settle" 7 | period in case there are other changes (any change will 8 | extend the "settle" window). 9 | 10 | It will additionally load preset AUTOSAVE_PRESET_NUM at startup. 11 | during the first `loop()`. Reasoning below. 12 | 13 | AutoSaveUsermod is standalone, but if FourLineDisplayUsermod is installed, it will notify the user of the saved changes. 14 | 15 | Note: I don't love that WLED doesn't respect the brightness of the preset being auto loaded, so the AutoSaveUsermod will set the AUTOSAVE_PRESET_NUM preset in the first loop, so brightness IS honored. This means WLED will effectively ignore Default brightness and Apply N preset at boot when the AutoSaveUsermod is installed. 16 | 17 | ## Installation 18 | 19 | define `USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR` e.g. 20 | 21 | `#define USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR` in my_config.h 22 | 23 | or add `-D USERMOD_ROTARY_ENCODER_BRIGHTNESS_COLOR` to `build_flags` in platformio_override.ini 24 | 25 | ### Define Your Options 26 | 27 | Open Usermod Settings in WLED to change settings: 28 | 29 | `fadeAmount` - how many points to fade the Neopixel with each step of the rotary encoder (default 5) 30 | `pin[3]` - pins to connect to the rotary encoder: 31 | - `pin[0]` is pin A on your rotary encoder 32 | - `pin[1]` is pin B on your rotary encoder 33 | - `pin[2]` is the button on your rotary encoder (optional, set to -1 to disable the button and the rotary encoder will control brightness only) 34 | 35 | ### PlatformIO requirements 36 | 37 | No special requirements. 38 | 39 | ## Change Log 40 | 41 | 2021-07 42 | * Upgraded to work with the latest WLED code, and make settings configurable in Usermod Settings 43 | -------------------------------------------------------------------------------- /usermods/usermod_v2_auto_save/readme.md: -------------------------------------------------------------------------------- 1 | # Auto Save 2 | 3 | v2 Usermod to automatically save settings 4 | to preset number AUTOSAVE_PRESET_NUM after a change to any of 5 | 6 | * brightness 7 | * effect speed 8 | * effect intensity 9 | * mode (effect) 10 | * palette 11 | 12 | but it will wait for AUTOSAVE_SETTLE_MS milliseconds, a "settle" 13 | period in case there are other changes (any change will 14 | extend the "settle" window). 15 | 16 | It will additionally load preset AUTOSAVE_PRESET_NUM at startup. 17 | during the first `loop()`. Reasoning below. 18 | 19 | AutoSaveUsermod is standalone, but if FourLineDisplayUsermod is installed, it will notify the user of the saved changes. 20 | 21 | Note: I don't love that WLED doesn't respect the brightness of the preset being auto loaded, so the AutoSaveUsermod will set the AUTOSAVE_PRESET_NUM preset in the first loop, so brightness IS honored. This means WLED will effectively ignore Default brightness and Apply N preset at boot when the AutoSaveUsermod is installed. 22 | 23 | ## Installation 24 | 25 | Copy and update the example `platformio_override.ini.sample` 26 | from the Rotary Encoder UI usermode folder to the root directory of your particular build. 27 | This file should be placed in the same directory as `platformio.ini`. 28 | 29 | ### Define Your Options 30 | 31 | * `USERMOD_AUTO_SAVE` - define this to have this the Auto Save usermod included wled00\usermods_list.cpp 32 | * `USERMOD_FOUR_LINE_DISPLAY` - define this to have this the Four Line Display mod included wled00\usermods_list.cpp - also tells this usermod that the display is available (see the Four Line Display usermod `readme.md` for more details) 33 | 34 | You can configure auto-save parameters using Usermods settings page. 35 | 36 | ### PlatformIO requirements 37 | 38 | No special requirements. 39 | 40 | Note: the Four Line Display usermod requires the libraries `U8g2` and `Wire`. 41 | 42 | ## Change Log 43 | 44 | 2021-02 45 | * First public release 46 | 2021-04 47 | * Adaptation for runtime configuration. -------------------------------------------------------------------------------- /usermods/usermod_v2_four_line_display/readme.md: -------------------------------------------------------------------------------- 1 | # I2C 4 Line Display Usermod 2 | 3 | First, thanks to the authors of the ssd11306_i2c_oled_u8g2 mod. 4 | 5 | This usermod provides a four line display using either 6 | 128x32 or 128x64 OLED displays. 7 | It's can operate independently, but starts to provide 8 | a relatively complete on-device UI when paired with the 9 | Rotary Encoder UI usermod. I strongly encourage you to use 10 | them together. 11 | 12 | [See the pair of usermods in action](https://www.youtube.com/watch?v=tITQY80rIOA) 13 | 14 | ## Installation 15 | 16 | Copy and update the example `platformio_override.ini.sample` 17 | from the Rotary Encoder UI usermode folder to the root directory of your particular build. 18 | This file should be placed in the same directory as `platformio.ini`. 19 | 20 | ### Define Your Options 21 | 22 | * `USERMOD_FOUR_LINE_DISPLAY` - define this to have this the Four Line Display mod included wled00\usermods_list.cpp - also tells Rotary Encoder usermod, if installed, that the display is available 23 | * `FLD_PIN_SCL` - The display SCL pin, defaults to 5 24 | * `FLD_PIN_SDA` - The display SDA pin, defaults to 4 25 | 26 | All of the parameters can be configured using Usermods settings page, inluding GPIO pins. 27 | 28 | ### PlatformIO requirements 29 | 30 | This usermod requires the `U8g2` and `Wire` libraries. See the 31 | `platformio_override.ini.sample` found in the Rotary Encoder 32 | UI usermod folder for how to include these using `platformio_override.ini`. 33 | 34 | ## Configuration 35 | 36 | * `enabled` - enable/disable usermod 37 | * `pin` - GPIO pins used for display; I2C displays use Clk & Data; SPI displays can use SCK, MOSI, CS, DC & RST 38 | * `type` - display type in numeric format 39 | * 1 = I2C SSD1306 128x32 40 | * 2 = I2C SH1106 128x32 41 | * 3 = I2C SSD1306 128x64 (4 double-height lines) 42 | * 4 = I2C SSD1305 128x32 43 | * 5 = I2C SSD1305 128x64 (4 double-height lines) 44 | * 6 = SPI SSD1306 128x32 45 | * 7 = SPI SSD1306 128x64 (4 double-height lines) 46 | * `contrast` - set display contrast (higher contrast may reduce display lifetime) 47 | * `refreshRateSec` - time in seconds for display refresh 48 | * `screenTimeOutSec` - screen saver time-out in seconds 49 | * `flip` - flip/rotate display 180° 50 | * `sleepMode` - enable/disable screen saver 51 | * `clockMode` - enable/disable clock display in screen saver mode 52 | * `i2c-freq-kHz` - I2C clock frequency in kHz (may help reduce dropped frames, range: 400-3400) 53 | 54 | ## Change Log 55 | 56 | 2021-02 57 | * First public release 58 | 59 | 2021-04 60 | * Adaptation for runtime configuration. 61 | 62 | 2021-11 63 | * Added configuration option description. -------------------------------------------------------------------------------- /usermods/usermod_v2_four_line_display_ALT/readme.md: -------------------------------------------------------------------------------- 1 | # I2C 4 Line Display Usermod ALT 2 | 3 | Thank you to the authors of the original version of these usermods. It would not have been possible without them! 4 | "usermod_v2_four_line_display" 5 | "usermod_v2_rotary_encoder_ui" 6 | 7 | The core of these usermods are a copy of the originals. The main changes are done to the FourLineDisplay usermod. 8 | The display usermod UI has been completely changed. 9 | 10 | 11 | The changes made to the RotaryEncoder usermod were made to support the new UI in the display usermod. 12 | Without the display it functions identical to the original. 13 | The original "usermod_v2_auto_save" will not work with the display just yet. 14 | 15 | Press the encoder to cycle through the options: 16 | *Brightness 17 | *Speed 18 | *Intensity 19 | *Palette 20 | *Effect 21 | *Main Color (only if display is used) 22 | *Saturation (only if display is used) 23 | 24 | Press and hold the encoder to display Network Info 25 | if AP is active then it will display AP ssid and Password 26 | 27 | Also shows if the timer is enabled 28 | 29 | [See the pair of usermods in action](https://www.youtube.com/watch?v=ulZnBt9z3TI) 30 | 31 | ## Installation 32 | 33 | Please refer to the original `usermod_v2_rotary_encoder_ui` readme for the main instructions 34 | Then to activate this alternative usermod add `#define USE_ALT_DISPLAY` to the `usermods_list.cpp` file, 35 | or add `-D USE_ALT_DISPLAY` to the original `platformio_override.ini.sample` file 36 | 37 | 38 | ### PlatformIO requirements 39 | 40 | Note: the Four Line Display usermod requires the libraries `U8g2` and `Wire`. 41 | 42 | ## Change Log 43 | 44 | 2021-10 45 | * First public release -------------------------------------------------------------------------------- /usermods/usermod_v2_mode_sort/readme.md: -------------------------------------------------------------------------------- 1 | # Mode Sort 2 | 3 | v2 usermod that provides data about modes and 4 | palettes to other usermods. Notably it provides: 5 | * A direct method for a mode or palette name 6 | * Ability to retrieve mode and palette names in 7 | alphabetical order 8 | 9 | ```char **getModesQStrings()``` 10 | 11 | Provides an array of char* (pointers) to the names of the 12 | palettes within JSON_mode_names, in the same order as 13 | JSON_mode_names. These strings end in double quote (") 14 | (or \0 if there is a problem). 15 | 16 | ```byte *getModesAlphaIndexes()``` 17 | 18 | An array of byte designating the indexes of names of the 19 | modes in alphabetical order. "Solid" will always remain 20 | at the front of the list. 21 | 22 | ```char **getPalettesQStrings()``` 23 | 24 | Provides an array of char* (pointers) to the names of the 25 | palettes within JSON_palette_names, in the same order as 26 | JSON_palette_names. These strings end in double quote (") 27 | (or \0 if there is a problem). 28 | 29 | ```byte *getPalettesAlphaIndexes()``` 30 | 31 | An array of byte designating the indexes of names of the 32 | palettes in alphabetical order. "Default" and those 33 | starting with "(" will always remain at the front of the list. 34 | -------------------------------------------------------------------------------- /usermods/usermod_v2_rotary_encoder_ui/platformio_override.ini.sample: -------------------------------------------------------------------------------- 1 | [platformio] 2 | default_envs = d1_mini 3 | ; default_envs = esp32dev 4 | 5 | [env:esp32dev] 6 | board = esp32dev 7 | platform = espressif32@3.2 8 | build_unflags = ${common.build_unflags} 9 | build_flags = 10 | ${common.build_flags_esp32} 11 | -D USERMOD_MODE_SORT 12 | -D USERMOD_FOUR_LINE_DISPLAY -D FLD_PIN_SCL=22 -D FLD_PIN_SDA=21 13 | -D USERMOD_ROTARY_ENCODER_UI -D ENCODER_DT_PIN=18 -D ENCODER_CLK_PIN=5 -D ENCODER_SW_PIN=19 14 | -D USERMOD_AUTO_SAVE -D AUTOSAVE_PRESET_NUM=1 15 | -D LEDPIN=16 -D BTNPIN=13 16 | upload_speed = 460800 17 | lib_ignore = 18 | ESPAsyncTCP 19 | ESPAsyncUDP 20 | 21 | [env:d1_mini] 22 | board = d1_mini 23 | platform = ${common.platform_wled_default} 24 | platform_packages = ${common.platform_packages} 25 | upload_speed = 460800 26 | board_build.ldscript = ${common.ldscript_4m1m} 27 | build_unflags = ${common.build_unflags} 28 | build_flags = 29 | ${common.build_flags_esp8266} 30 | -D USERMOD_MODE_SORT 31 | -D USERMOD_FOUR_LINE_DISPLAY -D FLD_PIN_SCL=5 -D FLD_PIN_SDA=4 32 | -D USERMOD_ROTARY_ENCODER_UI -D ENCODER_DT_PIN=12 -D ENCODER_CLK_PIN=14 -D ENCODER_SW_PIN=13 33 | -D USERMOD_AUTO_SAVE -D AUTOSAVE_PRESET_NUM=1 34 | -D LEDPIN=3 -D BTNPIN=0 35 | monitor_filters = esp8266_exception_decoder 36 | 37 | [env] 38 | lib_deps = 39 | fastled/FastLED @ 3.3.2 40 | NeoPixelBus @ 2.6.0 41 | ESPAsyncTCP @ 1.2.0 42 | ESPAsyncUDP 43 | AsyncTCP @ 1.0.3 44 | IRremoteESP8266 @ 2.7.3 45 | https://github.com/lorol/LITTLEFS.git 46 | https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.0 47 | U8g2@~2.27.2 48 | Wire 49 | -------------------------------------------------------------------------------- /usermods/usermod_v2_rotary_encoder_ui/readme.md: -------------------------------------------------------------------------------- 1 | # Rotary Encoder UI Usermod 2 | 3 | First, thanks to the authors of other Rotary Encoder usermods. 4 | 5 | This usermod starts to provide a relatively complete on-device 6 | UI when paired with the Four Line Display usermod. I strongly 7 | encourage you to try them together. 8 | 9 | [See the pair of usermods in action](https://www.youtube.com/watch?v=tITQY80rIOA) 10 | 11 | ## Installation 12 | 13 | Copy and update the example `platformio_override.ini.sample` to the root directory of your particular build. 14 | This file should be placed in the same directory as `platformio.ini`. 15 | 16 | ### Define Your Options 17 | 18 | * `USERMOD_ROTARY_ENCODER_UI` - define this to have this user mod included wled00\usermods_list.cpp 19 | * `USERMOD_FOUR_LINE_DISPLAY` - define this to have this the Four Line Display mod included wled00\usermods_list.cpp - also tells this usermod that the display is available (see the Four Line Display usermod `readme.md` for more details) 20 | * `ENCODER_DT_PIN` - The encoders DT pin, defaults to 12 21 | * `ENCODER_CLK_PIN` - The encoders CLK pin, defaults to 14 22 | * `ENCODER_SW_PIN` - The encoders SW pin, defaults to 13 23 | 24 | ### PlatformIO requirements 25 | 26 | No special requirements. 27 | 28 | Note: the Four Line Display usermod requires the libraries `U8g2` and `Wire`. 29 | 30 | ## Change Log 31 | 32 | 2021-02 33 | * First public release 34 | -------------------------------------------------------------------------------- /usermods/usermod_v2_rotary_encoder_ui_ALT/readme.md: -------------------------------------------------------------------------------- 1 | # Rotary Encoder UI Usermod ALT 2 | 3 | Thank you to the authors of the original version of these usermods. It would not have been possible without them! 4 | "usermod_v2_four_line_display" 5 | "usermod_v2_rotary_encoder_ui" 6 | 7 | The core of these usermods are a copy of the originals. The main changes are done to the FourLineDisplay usermod. 8 | The display usermod UI has been completely changed. 9 | 10 | 11 | The changes made to the RotaryEncoder usermod were made to support the new UI in the display usermod. 12 | Without the display it functions identical to the original. 13 | The original "usermod_v2_auto_save" will not work with the display just yet. 14 | 15 | Press the encoder to cycle through the options: 16 | *Brightness 17 | *Speed 18 | *Intensity 19 | *Palette 20 | *Effect 21 | *Main Color (only if display is used) 22 | *Saturation (only if display is used) 23 | 24 | Press and hold the encoder to display Network Info 25 | if AP is active then it will display AP ssid and Password 26 | 27 | Also shows if the timer is enabled 28 | 29 | [See the pair of usermods in action](https://www.youtube.com/watch?v=ulZnBt9z3TI) 30 | 31 | ## Installation 32 | 33 | Please refer to the original `usermod_v2_rotary_encoder_ui` readme for the main instructions 34 | Then to activate this alternative usermod add `#define USE_ALT_DISPLAY` to the `usermods_list.cpp` file, 35 | or add `-D USE_ALT_DISPLAY` to the original `platformio_override.ini.sample` file 36 | 37 | 38 | ### PlatformIO requirements 39 | 40 | Note: the Four Line Display usermod requires the libraries `U8g2` and `Wire`. 41 | 42 | ## Change Log 43 | 44 | 2021-10 45 | * First public release -------------------------------------------------------------------------------- /usermods/usermod_v2_word_clock/readme.md: -------------------------------------------------------------------------------- 1 | # Word Clock Usermod V2 2 | 3 | This usermod can be used to drive a wordclock with a 11x10 pixel matrix with WLED. There are also 4 additional dots for the minutes. 4 | The visualisation is desribed in 4 mask with LED numbers (single dots for minutes, minutes, hours and "clock/Uhr"). 5 | There are 2 parameters to chnage the behaviour: 6 | 7 | active: enable/disable usermod 8 | diplayItIs: enable/disable display of "Es ist" on the clock. 9 | 10 | ## Installation 11 | 12 | Copy and update the example `platformio_override.ini.sample` 13 | from the Rotary Encoder UI usermode folder to the root directory of your particular build. 14 | This file should be placed in the same directory as `platformio.ini`. 15 | 16 | ### Define Your Options 17 | 18 | * `USERMOD_WORDCLOCK` - define this to have this the Auto Save usermod included wled00\usermods_list.cpp 19 | 20 | ### PlatformIO requirements 21 | 22 | No special requirements. 23 | 24 | ## Change Log 25 | 26 | 2022/03/30 initial commit -------------------------------------------------------------------------------- /usermods/wizlights/readme.md: -------------------------------------------------------------------------------- 1 | # Controlling Wiz lights 2 | 3 | This usermod allows the control of [WiZ](https://www.wizconnected.com/en/consumer/) lights that are in the same network as the WLED controller. 4 | 5 | The mod takes the colors from the first few pixels and sends them to the lights. 6 | 7 | ## Configuration 8 | 9 | - Interval (ms) 10 | - How frequently to update the WiZ lights, in milliseconds. 11 | - Setting too low may causse ESP to become unresponsive. 12 | - Send Delay (ms) 13 | - An optional millisecond delay after updating each WiZ light. 14 | - Can help smooth out effects when using a larger number of WiZ lights 15 | - Use Enhanced White 16 | - Enables using the WiZ lights onboard white LEDs instead of sending maximum RGB values. 17 | - Tunable with warm and cool LEDs as supported by WiZ bulbs 18 | - Note: Only sent when max RGB value is set, need to have automatic brightness limiter disabled 19 | - ToDo: Have better logic for white value mixing to better take advantage of the lights capabilities 20 | - Always Force Update 21 | - Can be enabled to always send update message to light, even when color matches what was previously sent. 22 | - Force update every x minutes 23 | - Configuration option to allow adjusting the default force update timeout of 5 minutes. 24 | - Setting to 0 has the same impact as enabling Always Force Update 25 | - 26 | Then enter the IPs for the lights to be controlled, in order. There is currently a limit of 15 devices that can be controled, but that number 27 | can be easily changed by updating _MAX_WIZ_LIGHTS_. 28 | 29 | 30 | 31 | 32 | ## Related project 33 | 34 | If you use these lights and python, make sure to check out the [pywizlight](https://github.com/sbidy/pywizlight) project. I learned how to 35 | format the messages to control the lights from that project. 36 | -------------------------------------------------------------------------------- /usermods/word-clock-matrix/Word Clock Baffle.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/usermods/word-clock-matrix/Word Clock Baffle.stl -------------------------------------------------------------------------------- /usermods/word-clock-matrix/readme.md: -------------------------------------------------------------------------------- 1 | ## Word clock usermod 2 | 3 | By @bwente 4 | 5 | See https://www.hackster.io/bwente/word-clock-with-just-two-components-073834 for the hardware guide! 6 | Includes a customizable feature to lower the brightness at night. 7 | -------------------------------------------------------------------------------- /wled00.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2046 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wled00", "wled00\wled00.vcxproj", "{C5F80730-F44F-4478-BDAE-6634EFC2CA88}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Debug|x86.ActiveCfg = Debug|Win32 15 | {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Debug|x86.Build.0 = Debug|Win32 16 | {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Release|x86.ActiveCfg = Release|Win32 17 | {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9A679C2B-61D3-400B-B96F-06E604E9CED2} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /wled00/NodeStruct.h: -------------------------------------------------------------------------------- 1 | #ifndef WLED_NODESTRUCT_H 2 | #define WLED_NODESTRUCT_H 3 | 4 | /*********************************************************************************************\ 5 | * NodeStruct from the ESP Easy project (https://github.com/letscontrolit/ESPEasy) 6 | \*********************************************************************************************/ 7 | 8 | #include 9 | #include 10 | 11 | #define NODE_TYPE_ID_UNDEFINED 0 12 | #define NODE_TYPE_ID_ESP8266 82 13 | #define NODE_TYPE_ID_ESP32 32 14 | 15 | /*********************************************************************************************\ 16 | * NodeStruct 17 | \*********************************************************************************************/ 18 | struct NodeStruct 19 | { 20 | String nodeName; 21 | IPAddress ip; 22 | uint8_t unit; 23 | uint8_t age; 24 | uint8_t nodeType; 25 | uint32_t build; 26 | 27 | NodeStruct() : age(0), nodeType(0), build(0) 28 | { 29 | for (uint8_t i = 0; i < 4; ++i) { ip[i] = 0; } 30 | } 31 | }; 32 | typedef std::map NodesMap; 33 | 34 | #endif // WLED_NODESTRUCT_H 35 | -------------------------------------------------------------------------------- /wled00/data/404.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 40 | 41 | 42 | 43 |

404 Not Found

44 | Akemi does not know where you are headed...

45 | 46 | 47 | -------------------------------------------------------------------------------- /wled00/data/dmxmap.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | DMX Map 4 | 23 | 24 |
...
-------------------------------------------------------------------------------- /wled00/data/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/wled00/data/favicon.ico -------------------------------------------------------------------------------- /wled00/data/icons-ui/Read Me.txt: -------------------------------------------------------------------------------- 1 | Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures. 2 | 3 | To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/#docs/local-fonts 4 | 5 | You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects. 6 | 7 | You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via Main Menu → Manage Projects) to retrieve your icon selection. 8 | -------------------------------------------------------------------------------- /wled00/data/icons-ui/demo-files/demo.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 0; 3 | margin: 0; 4 | font-family: sans-serif; 5 | font-size: 1em; 6 | line-height: 1.5; 7 | color: #555; 8 | background: #fff; 9 | } 10 | h1 { 11 | font-size: 1.5em; 12 | font-weight: normal; 13 | } 14 | small { 15 | font-size: .66666667em; 16 | } 17 | a { 18 | color: #e74c3c; 19 | text-decoration: none; 20 | } 21 | a:hover, a:focus { 22 | box-shadow: 0 1px #e74c3c; 23 | } 24 | .bshadow0, input { 25 | box-shadow: inset 0 -2px #e7e7e7; 26 | } 27 | input:hover { 28 | box-shadow: inset 0 -2px #ccc; 29 | } 30 | input, fieldset { 31 | font-family: sans-serif; 32 | font-size: 1em; 33 | margin: 0; 34 | padding: 0; 35 | border: 0; 36 | } 37 | input { 38 | color: inherit; 39 | line-height: 1.5; 40 | height: 1.5em; 41 | padding: .25em 0; 42 | } 43 | input:focus { 44 | outline: none; 45 | box-shadow: inset 0 -2px #449fdb; 46 | } 47 | .glyph { 48 | font-size: 16px; 49 | width: 15em; 50 | padding-bottom: 1em; 51 | margin-right: 4em; 52 | margin-bottom: 1em; 53 | float: left; 54 | overflow: hidden; 55 | } 56 | .liga { 57 | width: 80%; 58 | width: calc(100% - 2.5em); 59 | } 60 | .talign-right { 61 | text-align: right; 62 | } 63 | .talign-center { 64 | text-align: center; 65 | } 66 | .bgc1 { 67 | background: #f1f1f1; 68 | } 69 | .fgc1 { 70 | color: #999; 71 | } 72 | .fgc0 { 73 | color: #000; 74 | } 75 | p { 76 | margin-top: 1em; 77 | margin-bottom: 1em; 78 | } 79 | .mvm { 80 | margin-top: .75em; 81 | margin-bottom: .75em; 82 | } 83 | .mtn { 84 | margin-top: 0; 85 | } 86 | .mtl, .mal { 87 | margin-top: 1.5em; 88 | } 89 | .mbl, .mal { 90 | margin-bottom: 1.5em; 91 | } 92 | .mal, .mhl { 93 | margin-left: 1.5em; 94 | margin-right: 1.5em; 95 | } 96 | .mhmm { 97 | margin-left: 1em; 98 | margin-right: 1em; 99 | } 100 | .mls { 101 | margin-left: .25em; 102 | } 103 | .ptl { 104 | padding-top: 1.5em; 105 | } 106 | .pbs, .pvs { 107 | padding-bottom: .25em; 108 | } 109 | .pvs, .pts { 110 | padding-top: .25em; 111 | } 112 | .unit { 113 | float: left; 114 | } 115 | .unitRight { 116 | float: right; 117 | } 118 | .size1of2 { 119 | width: 50%; 120 | } 121 | .size1of1 { 122 | width: 100%; 123 | } 124 | .clearfix:before, .clearfix:after { 125 | content: " "; 126 | display: table; 127 | } 128 | .clearfix:after { 129 | clear: both; 130 | } 131 | .hidden-true { 132 | display: none; 133 | } 134 | .textbox0 { 135 | width: 3em; 136 | background: #f1f1f1; 137 | padding: .25em .5em; 138 | line-height: 1.5; 139 | height: 1.5em; 140 | } 141 | #testDrive { 142 | display: block; 143 | padding-top: 24px; 144 | line-height: 1.5; 145 | } 146 | .fs0 { 147 | font-size: 16px; 148 | } 149 | .fs1 { 150 | font-size: 32px; 151 | } 152 | 153 | -------------------------------------------------------------------------------- /wled00/data/icons-ui/demo-files/demo.js: -------------------------------------------------------------------------------- 1 | if (!('boxShadow' in document.body.style)) { 2 | document.body.setAttribute('class', 'noBoxShadow'); 3 | } 4 | 5 | document.body.addEventListener("click", function(e) { 6 | var target = e.target; 7 | if (target.tagName === "INPUT" && 8 | target.getAttribute('class').indexOf('liga') === -1) { 9 | target.select(); 10 | } 11 | }); 12 | 13 | (function() { 14 | var fontSize = document.getElementById('fontSize'), 15 | testDrive = document.getElementById('testDrive'), 16 | testText = document.getElementById('testText'); 17 | function updateTest() { 18 | testDrive.innerHTML = testText.value || String.fromCharCode(160); 19 | if (window.icomoonLiga) { 20 | window.icomoonLiga(testDrive); 21 | } 22 | } 23 | function updateSize() { 24 | testDrive.style.fontSize = fontSize.value + 'px'; 25 | } 26 | fontSize.addEventListener('change', updateSize, false); 27 | testText.addEventListener('input', updateTest, false); 28 | testText.addEventListener('change', updateTest, false); 29 | updateSize(); 30 | }()); 31 | -------------------------------------------------------------------------------- /wled00/data/icons-ui/fonts/wled122.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/wled00/data/icons-ui/fonts/wled122.woff -------------------------------------------------------------------------------- /wled00/data/icons-ui/fonts/wled122.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atuline/WLED/ce6b9d80273575419fecf2a752162f08e28361e0/wled00/data/icons-ui/fonts/wled122.woff2 -------------------------------------------------------------------------------- /wled00/data/icons-ui/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'wled122'; 3 | src: 4 | url('fonts/wled122.woff2?e3eban') format('woff2'), 5 | url('fonts/wled122.ttf?e3eban') format('truetype'), 6 | url('fonts/wled122.woff?e3eban') format('woff'), 7 | url('fonts/wled122.svg?e3eban#wled122') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | font-display: block; 11 | } 12 | 13 | [class^="i-"], [class*=" i-"] { 14 | /* use !important to prevent issues with browser extensions that change fonts */ 15 | font-family: 'wled122' !important; 16 | speak: never; 17 | font-style: normal; 18 | font-weight: normal; 19 | font-variant: normal; 20 | text-transform: none; 21 | line-height: 1; 22 | 23 | /* Better Font Rendering =========== */ 24 | -webkit-font-smoothing: antialiased; 25 | -moz-osx-font-smoothing: grayscale; 26 | } 27 | 28 | .i-pattern:before { 29 | content: "\e23d"; 30 | } 31 | .i-segments:before { 32 | content: "\e34b"; 33 | } 34 | .i-sun:before { 35 | content: "\e333"; 36 | } 37 | .i-palette:before { 38 | content: "\e2b3"; 39 | } 40 | .i-eye:before { 41 | content: "\e0e8"; 42 | } 43 | .i-speed:before { 44 | content: "\e325"; 45 | } 46 | .i-expand:before { 47 | content: "\e395"; 48 | } 49 | .i-power:before { 50 | content: "\e08f"; 51 | } 52 | .i-settings:before { 53 | content: "\e0a2"; 54 | } 55 | .i-playlist:before { 56 | content: "\e139"; 57 | } 58 | .i-night:before { 59 | content: "\e2a2"; 60 | } 61 | .i-cancel:before { 62 | content: "\e38f"; 63 | } 64 | .i-sync:before { 65 | content: "\e116"; 66 | } 67 | .i-confirm:before { 68 | content: "\e390"; 69 | } 70 | .i-brightness:before { 71 | content: "\e2a6"; 72 | } 73 | .i-nodes:before { 74 | content: "\e22d"; 75 | } 76 | .i-add:before { 77 | content: "\e18a"; 78 | } 79 | .i-edit:before { 80 | content: "\e2c6"; 81 | } 82 | .i-intensity:before { 83 | content: "\e409"; 84 | } 85 | .i-star:before { 86 | content: "\e410"; 87 | } 88 | .i-info:before { 89 | content: "\e066"; 90 | } 91 | .i-del:before { 92 | content: "\e037"; 93 | } 94 | .i-presets:before { 95 | content: "\e04c"; 96 | } 97 | -------------------------------------------------------------------------------- /wled00/data/liveview.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WLED Live Preview 8 | 20 | 21 | 22 |
23 | 63 | 64 | -------------------------------------------------------------------------------- /wled00/data/liveviewws.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WLED Live Preview 8 | 20 | 21 | 22 |
23 | 66 | 67 | -------------------------------------------------------------------------------- /wled00/data/msg.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | WLED Message 7 | 8 | 29 | 30 | 31 | 32 |

Sample Message.

33 | Sample Detail. 34 | 35 | 36 | -------------------------------------------------------------------------------- /wled00/data/settings.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WLED Settings 5 | 27 | 28 | 29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | 39 | -------------------------------------------------------------------------------- /wled00/data/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Verdana, sans-serif; 3 | text-align: center; 4 | background: #222; 5 | color: #fff; 6 | line-height: 200%%; /* %% because of AsyncWebServer */ 7 | margin: 0; 8 | } 9 | hr { 10 | border-color: #666; 11 | } 12 | a { 13 | color: #28f; 14 | text-decoration: none; 15 | } 16 | button, .btn { 17 | background: #333; 18 | color: #fff; 19 | font-family: Verdana, sans-serif; 20 | border: 0.3ch solid #333; 21 | border-radius: 24px; 22 | display: inline-block; 23 | font-size: 20px; 24 | margin: 12px 8px 8px; 25 | padding: 8px 12px; 26 | min-width: 48px; 27 | cursor: pointer; 28 | text-decoration: none; 29 | } 30 | button.sml { 31 | padding: 8px; 32 | border-radius: 20px; 33 | font-size: 15px; 34 | min-width: 40px; 35 | margin: 0 0 0 10px; 36 | } 37 | .lnk { 38 | border: 0; 39 | } 40 | button.disabled, button[disabled] { 41 | color: #aaa; 42 | } 43 | .helpB { 44 | text-align: left; 45 | position: absolute; 46 | width: 60px; 47 | } 48 | input { 49 | background: #333; 50 | color: #fff; 51 | font-family: Verdana, sans-serif; 52 | border: 0.5ch solid #333; 53 | } 54 | input:disabled { 55 | color: #888; 56 | } 57 | input[type="number"] { 58 | width: 4em; 59 | margin: 2px; 60 | } 61 | input[type="number"].xxl { 62 | width: 100px; 63 | } 64 | input[type="number"].xl { 65 | width: 85px; 66 | } 67 | input[type="number"].l { 68 | width: 63px; 69 | } 70 | input[type="number"].m { 71 | width: 56px; 72 | } 73 | input[type="number"].s { 74 | width: 49px; 75 | } 76 | input[type="number"].xs { 77 | width: 42px; 78 | } 79 | input[type="checkbox"] { 80 | transform: scale(1.5); 81 | } 82 | select { 83 | background: #333; 84 | color: #fff; 85 | font-family: Verdana, sans-serif; 86 | border: 0.5ch solid #333; 87 | } 88 | td { 89 | padding: 2px; 90 | } 91 | .d5 { 92 | width: 4.5em !important; 93 | } 94 | 95 | /* WLEDSR */ 96 | .tiny { 97 | font-size: 14px; 98 | color: #bbb; 99 | } 100 | 101 | #msg { 102 | display: none; 103 | } 104 | 105 | #toast { 106 | opacity: 0; 107 | background-color: #444; 108 | border-radius: 5px; 109 | bottom: 64px; 110 | color: #fff; 111 | font-size: 17px; 112 | padding: 16px; 113 | pointer-events: none; 114 | position: fixed; 115 | text-align: center; 116 | z-index: 5; 117 | transform: translateX(-50%%); /* %% because of AsyncWebServer */ 118 | max-width: 90%%; /* %% because of AsyncWebServer */ 119 | left: 50%%; /* %% because of AsyncWebServer */ 120 | } 121 | 122 | #toast.show { 123 | opacity: 1; 124 | background-color: #264; 125 | animation: fadein 0.5s, fadein 0.5s 2.5s reverse; 126 | } 127 | 128 | #toast.error { 129 | opacity: 1; 130 | background-color: #b21; 131 | animation: fadein 0.5s; 132 | } 133 | -------------------------------------------------------------------------------- /wled00/data/update.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | WLED Update 7 | 11 | 14 | 15 | 16 |

Sound Reactive WLED Software Update

17 |
18 | ##VERSION##
19 | Download the latest release: 20 |
21 |
22 |
23 | 24 |
25 |
Updating...
Please do not close or refresh the page :)
26 | 27 | 28 | -------------------------------------------------------------------------------- /wled00/data/usermod.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | No usermod custom web page set. 5 | 6 | -------------------------------------------------------------------------------- /wled00/data/welcome.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Welcome! 8 | 50 | 51 | 52 | 53 |
54 |

Welcome to SR WLED!

55 |

Thank you for installing my application!

56 | Next steps:

57 | Connect the module to your local WiFi here!
58 |
59 | Just trying this out in AP mode?
60 |
61 |
62 | 63 | -------------------------------------------------------------------------------- /wled00/dmx.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | 3 | /* 4 | * Support for DMX Output via MAX485. 5 | * Change the output pin in src/dependencies/ESPDMX.cpp, if needed (ESP8266) 6 | * Change the output pin in src/dependencies/SparkFunDMX.cpp, if needed (ESP32) 7 | * ESP8266 Library from: 8 | * https://github.com/Rickgg/ESP-Dmx 9 | * ESP32 Library from: 10 | * https://github.com/sparkfun/SparkFunDMX 11 | */ 12 | 13 | #ifdef WLED_ENABLE_DMX 14 | 15 | void handleDMX() 16 | { 17 | // don't act, when in DMX Proxy mode 18 | if (e131ProxyUniverse != 0) return; 19 | 20 | uint8_t brightness = strip.getBrightness(); 21 | 22 | bool calc_brightness = true; 23 | 24 | // check if no shutter channel is set 25 | for (byte i = 0; i < DMXChannels; i++) 26 | { 27 | if (DMXFixtureMap[i] == 5) calc_brightness = false; 28 | } 29 | 30 | uint16_t len = strip.getLengthTotal(); 31 | for (int i = DMXStartLED; i < len; i++) { // uses the amount of LEDs as fixture count 32 | 33 | uint32_t in = strip.getPixelColor(i); // get the colors for the individual fixtures as suggested by Aircoookie in issue #462 34 | byte w = W(in); 35 | byte r = R(in); 36 | byte g = G(in); 37 | byte b = B(in); 38 | 39 | int DMXFixtureStart = DMXStart + (DMXGap * (i - DMXStartLED)); 40 | for (int j = 0; j < DMXChannels; j++) { 41 | int DMXAddr = DMXFixtureStart + j; 42 | switch (DMXFixtureMap[j]) { 43 | case 0: // Set this channel to 0. Good way to tell strobe- and fade-functions to fuck right off. 44 | dmx.write(DMXAddr, 0); 45 | break; 46 | case 1: // Red 47 | dmx.write(DMXAddr, calc_brightness ? (r * brightness) / 255 : r); 48 | break; 49 | case 2: // Green 50 | dmx.write(DMXAddr, calc_brightness ? (g * brightness) / 255 : g); 51 | break; 52 | case 3: // Blue 53 | dmx.write(DMXAddr, calc_brightness ? (b * brightness) / 255 : b); 54 | break; 55 | case 4: // White 56 | dmx.write(DMXAddr, calc_brightness ? (w * brightness) / 255 : w); 57 | break; 58 | case 5: // Shutter channel. Controls the brightness. 59 | dmx.write(DMXAddr, brightness); 60 | break; 61 | case 6: // Sets this channel to 255. Like 0, but more wholesome. 62 | dmx.write(DMXAddr, 255); 63 | break; 64 | } 65 | } 66 | } 67 | 68 | dmx.update(); // update the DMX bus 69 | } 70 | 71 | void initDMX() { 72 | #ifdef ESP8266 73 | dmx.init(512); // initialize with bus length 74 | #else 75 | dmx.initWrite(512); // initialize with bus length 76 | #endif 77 | } 78 | 79 | #else 80 | void handleDMX() {} 81 | void initDMX() {} 82 | #endif 83 | -------------------------------------------------------------------------------- /wled00/lx_parser.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | 3 | /* 4 | * Parser for Loxone formats 5 | */ 6 | bool parseLx(int lxValue, byte rgbw[4]) 7 | { 8 | #ifdef WLED_ENABLE_LOXONE 9 | DEBUG_PRINT(F("LX: Lox = ")); 10 | DEBUG_PRINTLN(lxValue); 11 | 12 | bool ok = false; 13 | float lxRed = 0, lxGreen = 0, lxBlue = 0; 14 | 15 | if (lxValue < 200000000) { 16 | // Loxone RGB 17 | ok = true; 18 | lxRed = round((lxValue % 1000) * 2.55); 19 | lxGreen = round(((lxValue / 1000) % 1000) * 2.55); 20 | lxBlue = round(((lxValue / 1000000) % 1000) * 2.55); 21 | } else if ((lxValue >= 200000000) && (lxValue <= 201006500)) { 22 | // Loxone Lumitech 23 | ok = true; 24 | float tmpBri = floor((lxValue - 200000000) / 10000); ; 25 | uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000); 26 | 27 | tmpBri *= 2.55; 28 | tmpBri = constrain(tmpBri, 0, 255); 29 | 30 | colorKtoRGB(ct, rgbw); 31 | lxRed = rgbw[0]; lxGreen = rgbw[1]; lxBlue = rgbw[2]; 32 | 33 | lxRed *= (tmpBri/255); 34 | lxGreen *= (tmpBri/255); 35 | lxBlue *= (tmpBri/255); 36 | } 37 | 38 | if (ok) { 39 | rgbw[0] = (uint8_t) constrain(lxRed, 0, 255); 40 | rgbw[1] = (uint8_t) constrain(lxGreen, 0, 255); 41 | rgbw[2] = (uint8_t) constrain(lxBlue, 0, 255); 42 | rgbw[3] = 0; 43 | return true; 44 | } 45 | #endif 46 | return false; 47 | } 48 | 49 | void parseLxJson(int lxValue, byte segId, bool secondary) 50 | { 51 | if (secondary) { 52 | DEBUG_PRINT(F("LY: Lox secondary = ")); 53 | } else { 54 | DEBUG_PRINT(F("LX: Lox primary = ")); 55 | } 56 | DEBUG_PRINTLN(lxValue); 57 | byte rgbw[] = {0,0,0,0}; 58 | if (parseLx(lxValue, rgbw)) { 59 | if (bri == 0) { 60 | DEBUG_PRINTLN(F("LX: turn on")); 61 | toggleOnOff(); 62 | } 63 | bri = 255; 64 | nightlightActive = false; //always disable nightlight when toggling 65 | if (segId == strip.getMainSegmentId()) { 66 | DEBUG_PRINTLN(F("LX: main segment")); 67 | if (secondary) for (byte i = 0; i < 4; i++) colSec[i] = rgbw[i]; 68 | else for (byte i = 0; i < 4; i++) col[i] = rgbw[i]; 69 | } else { 70 | DEBUG_PRINT(F("LX: segment ")); 71 | DEBUG_PRINTLN(segId); 72 | strip.getSegment(segId).setColor(secondary, ((rgbw[3] << 24) | ((rgbw[0]&0xFF) << 16) | ((rgbw[1]&0xFF) << 8) | ((rgbw[2]&0xFF))), segId); 73 | } 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /wled00/my_config_sample.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * Welcome! 5 | * You can use the file "my_config.h" to make changes to the way WLED is compiled! 6 | * It is possible to enable and disable certain features as well as set defaults for some runtime changeable settings. 7 | * 8 | * How to use: 9 | * PlatformIO: Just compile the unmodified code once! The file "my_config.h" will be generated automatically and now you can make your changes. 10 | * 11 | * ArduinoIDE: Make a copy of this file and name it "my_config.h". Go to wled.h and uncomment "#define WLED_USE_MY_CONFIG" in the top of the file. 12 | * 13 | * DO NOT make changes to the "my_config_sample.h" file directly! Your changes will not be applied. 14 | */ 15 | 16 | // uncomment to force the compiler to show a warning to confirm that this file is included 17 | //#warning **** my_config.h: Settings from this file are honored **** 18 | 19 | /* Uncomment to use your WIFI settings as defaults 20 | //WARNING: this will hardcode these as the default even after a factory reset 21 | #define CLIENT_SSID "Your_SSID" 22 | #define CLIENT_PASS "Your_Password" 23 | */ 24 | 25 | //#define MAX_LEDS 1500 //Maximum total LEDs. More than 1500 might create a low memory situation on ESP8266. -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient.h: -------------------------------------------------------------------------------- 1 | #ifndef SRC_ASYNCMQTTCLIENT_H_ 2 | #define SRC_ASYNCMQTTCLIENT_H_ 3 | 4 | #include "AsyncMqttClient.hpp" 5 | 6 | #endif // SRC_ASYNCMQTTCLIENT_H_ 7 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Callbacks.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "DisconnectReasons.hpp" 6 | #include "MessageProperties.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | // user callbacks 10 | typedef std::function OnConnectUserCallback; 11 | typedef std::function OnDisconnectUserCallback; 12 | typedef std::function OnSubscribeUserCallback; 13 | typedef std::function OnUnsubscribeUserCallback; 14 | typedef std::function OnMessageUserCallback; 15 | typedef std::function OnPublishUserCallback; 16 | 17 | // internal callbacks 18 | typedef std::function OnConnAckInternalCallback; 19 | typedef std::function OnPingRespInternalCallback; 20 | typedef std::function OnSubAckInternalCallback; 21 | typedef std::function OnUnsubAckInternalCallback; 22 | typedef std::function OnMessageInternalCallback; 23 | typedef std::function OnPublishInternalCallback; 24 | typedef std::function OnPubRelInternalCallback; 25 | typedef std::function OnPubAckInternalCallback; 26 | typedef std::function OnPubRecInternalCallback; 27 | typedef std::function OnPubCompInternalCallback; 28 | } // namespace AsyncMqttClientInternals 29 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/DisconnectReasons.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class AsyncMqttClientDisconnectReason : int8_t { 4 | TCP_DISCONNECTED = 0, 5 | 6 | MQTT_UNACCEPTABLE_PROTOCOL_VERSION = 1, 7 | MQTT_IDENTIFIER_REJECTED = 2, 8 | MQTT_SERVER_UNAVAILABLE = 3, 9 | MQTT_MALFORMED_CREDENTIALS = 4, 10 | MQTT_NOT_AUTHORIZED = 5, 11 | 12 | ESP8266_NOT_ENOUGH_SPACE = 6, 13 | 14 | TLS_BAD_FINGERPRINT = 7 15 | }; 16 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Flags.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AsyncMqttClientInternals { 4 | constexpr struct { 5 | const uint8_t RESERVED = 0; 6 | const uint8_t CONNECT = 1; 7 | const uint8_t CONNACK = 2; 8 | const uint8_t PUBLISH = 3; 9 | const uint8_t PUBACK = 4; 10 | const uint8_t PUBREC = 5; 11 | const uint8_t PUBREL = 6; 12 | const uint8_t PUBCOMP = 7; 13 | const uint8_t SUBSCRIBE = 8; 14 | const uint8_t SUBACK = 9; 15 | const uint8_t UNSUBSCRIBE = 10; 16 | const uint8_t UNSUBACK = 11; 17 | const uint8_t PINGREQ = 12; 18 | const uint8_t PINGRESP = 13; 19 | const uint8_t DISCONNECT = 14; 20 | const uint8_t RESERVED2 = 1; 21 | } PacketType; 22 | 23 | constexpr struct { 24 | const uint8_t CONNECT_RESERVED = 0x00; 25 | const uint8_t CONNACK_RESERVED = 0x00; 26 | const uint8_t PUBLISH_DUP = 0x08; 27 | const uint8_t PUBLISH_QOS0 = 0x00; 28 | const uint8_t PUBLISH_QOS1 = 0x02; 29 | const uint8_t PUBLISH_QOS2 = 0x04; 30 | const uint8_t PUBLISH_QOSRESERVED = 0x06; 31 | const uint8_t PUBLISH_RETAIN = 0x01; 32 | const uint8_t PUBACK_RESERVED = 0x00; 33 | const uint8_t PUBREC_RESERVED = 0x00; 34 | const uint8_t PUBREL_RESERVED = 0x02; 35 | const uint8_t PUBCOMP_RESERVED = 0x00; 36 | const uint8_t SUBSCRIBE_RESERVED = 0x02; 37 | const uint8_t SUBACK_RESERVED = 0x00; 38 | const uint8_t UNSUBSCRIBE_RESERVED = 0x02; 39 | const uint8_t UNSUBACK_RESERVED = 0x00; 40 | const uint8_t PINGREQ_RESERVED = 0x00; 41 | const uint8_t PINGRESP_RESERVED = 0x00; 42 | const uint8_t DISCONNECT_RESERVED = 0x00; 43 | const uint8_t RESERVED2_RESERVED = 0x00; 44 | } HeaderFlag; 45 | 46 | constexpr struct { 47 | const uint8_t USERNAME = 0x80; 48 | const uint8_t PASSWORD = 0x40; 49 | const uint8_t WILL_RETAIN = 0x20; 50 | const uint8_t WILL_QOS0 = 0x00; 51 | const uint8_t WILL_QOS1 = 0x08; 52 | const uint8_t WILL_QOS2 = 0x10; 53 | const uint8_t WILL = 0x04; 54 | const uint8_t CLEAN_SESSION = 0x02; 55 | const uint8_t RESERVED = 0x00; 56 | } ConnectFlag; 57 | } // namespace AsyncMqttClientInternals 58 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Helpers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AsyncMqttClientInternals { 4 | class Helpers { 5 | public: 6 | static uint32_t decodeRemainingLength(char* bytes) { 7 | uint32_t multiplier = 1; 8 | uint32_t value = 0; 9 | uint8_t currentByte = 0; 10 | uint8_t encodedByte; 11 | do { 12 | encodedByte = bytes[currentByte++]; 13 | value += (encodedByte & 127) * multiplier; 14 | multiplier *= 128; 15 | } while ((encodedByte & 128) != 0); 16 | 17 | return value; 18 | } 19 | 20 | static uint8_t encodeRemainingLength(uint32_t remainingLength, char* destination) { 21 | uint8_t currentByte = 0; 22 | uint8_t bytesNeeded = 0; 23 | 24 | do { 25 | uint8_t encodedByte = remainingLength % 128; 26 | remainingLength /= 128; 27 | if (remainingLength > 0) { 28 | encodedByte = encodedByte | 128; 29 | } 30 | 31 | destination[currentByte++] = encodedByte; 32 | bytesNeeded++; 33 | } while (remainingLength > 0); 34 | 35 | return bytesNeeded; 36 | } 37 | }; 38 | } // namespace AsyncMqttClientInternals 39 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/MessageProperties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct AsyncMqttClientMessageProperties { 4 | uint8_t qos; 5 | bool dup; 6 | bool retain; 7 | }; 8 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/ConnAckPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "ConnAckPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::ConnAckPacket; 4 | 5 | ConnAckPacket::ConnAckPacket(ParsingInformation* parsingInformation, OnConnAckInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) 8 | , _bytePosition(0) 9 | , _sessionPresent(false) 10 | , _connectReturnCode(0) { 11 | } 12 | 13 | ConnAckPacket::~ConnAckPacket() { 14 | } 15 | 16 | void ConnAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 17 | char currentByte = data[(*currentBytePosition)++]; 18 | if (_bytePosition++ == 0) { 19 | _sessionPresent = (currentByte << 7) >> 7; 20 | } else { 21 | _connectReturnCode = currentByte; 22 | _parsingInformation->bufferState = BufferState::NONE; 23 | _callback(_sessionPresent, _connectReturnCode); 24 | } 25 | } 26 | 27 | void ConnAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 28 | (void)data; 29 | (void)currentBytePosition; 30 | } 31 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/ConnAckPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class ConnAckPacket : public Packet { 10 | public: 11 | explicit ConnAckPacket(ParsingInformation* parsingInformation, OnConnAckInternalCallback callback); 12 | ~ConnAckPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnConnAckInternalCallback _callback; 20 | 21 | uint8_t _bytePosition; 22 | bool _sessionPresent; 23 | uint8_t _connectReturnCode; 24 | }; 25 | } // namespace AsyncMqttClientInternals 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/Packet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AsyncMqttClientInternals { 4 | class Packet { 5 | public: 6 | virtual ~Packet() {} 7 | 8 | virtual void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) = 0; 9 | virtual void parsePayload(char* data, size_t len, size_t* currentBytePosition) = 0; 10 | }; 11 | } // namespace AsyncMqttClientInternals 12 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PingRespPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "PingRespPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::PingRespPacket; 4 | 5 | PingRespPacket::PingRespPacket(ParsingInformation* parsingInformation, OnPingRespInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) { 8 | } 9 | 10 | PingRespPacket::~PingRespPacket() { 11 | } 12 | 13 | void PingRespPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 14 | (void)data; 15 | (void)currentBytePosition; 16 | } 17 | 18 | void PingRespPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 19 | (void)data; 20 | (void)currentBytePosition; 21 | } 22 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PingRespPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class PingRespPacket : public Packet { 10 | public: 11 | explicit PingRespPacket(ParsingInformation* parsingInformation, OnPingRespInternalCallback callback); 12 | ~PingRespPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnPingRespInternalCallback _callback; 20 | }; 21 | } // namespace AsyncMqttClientInternals 22 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubAckPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "PubAckPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::PubAckPacket; 4 | 5 | PubAckPacket::PubAckPacket(ParsingInformation* parsingInformation, OnPubAckInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) 8 | , _bytePosition(0) 9 | , _packetIdMsb(0) 10 | , _packetId(0) { 11 | } 12 | 13 | PubAckPacket::~PubAckPacket() { 14 | } 15 | 16 | void PubAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 17 | char currentByte = data[(*currentBytePosition)++]; 18 | if (_bytePosition++ == 0) { 19 | _packetIdMsb = currentByte; 20 | } else { 21 | _packetId = currentByte | _packetIdMsb << 8; 22 | _parsingInformation->bufferState = BufferState::NONE; 23 | _callback(_packetId); 24 | } 25 | } 26 | 27 | void PubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 28 | (void)data; 29 | (void)currentBytePosition; 30 | } 31 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubAckPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class PubAckPacket : public Packet { 10 | public: 11 | explicit PubAckPacket(ParsingInformation* parsingInformation, OnPubAckInternalCallback callback); 12 | ~PubAckPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnPubAckInternalCallback _callback; 20 | 21 | uint8_t _bytePosition; 22 | char _packetIdMsb; 23 | uint16_t _packetId; 24 | }; 25 | } // namespace AsyncMqttClientInternals 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubCompPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "PubCompPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::PubCompPacket; 4 | 5 | PubCompPacket::PubCompPacket(ParsingInformation* parsingInformation, OnPubCompInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) 8 | , _bytePosition(0) 9 | , _packetIdMsb(0) 10 | , _packetId(0) { 11 | } 12 | 13 | PubCompPacket::~PubCompPacket() { 14 | } 15 | 16 | void PubCompPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 17 | char currentByte = data[(*currentBytePosition)++]; 18 | if (_bytePosition++ == 0) { 19 | _packetIdMsb = currentByte; 20 | } else { 21 | _packetId = currentByte | _packetIdMsb << 8; 22 | _parsingInformation->bufferState = BufferState::NONE; 23 | _callback(_packetId); 24 | } 25 | } 26 | 27 | void PubCompPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 28 | (void)data; 29 | (void)currentBytePosition; 30 | } 31 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubCompPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class PubCompPacket : public Packet { 10 | public: 11 | explicit PubCompPacket(ParsingInformation* parsingInformation, OnPubCompInternalCallback callback); 12 | ~PubCompPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnPubCompInternalCallback _callback; 20 | 21 | uint8_t _bytePosition; 22 | char _packetIdMsb; 23 | uint16_t _packetId; 24 | }; 25 | } // namespace AsyncMqttClientInternals 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubRecPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "PubRecPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::PubRecPacket; 4 | 5 | PubRecPacket::PubRecPacket(ParsingInformation* parsingInformation, OnPubRecInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) 8 | , _bytePosition(0) 9 | , _packetIdMsb(0) 10 | , _packetId(0) { 11 | } 12 | 13 | PubRecPacket::~PubRecPacket() { 14 | } 15 | 16 | void PubRecPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 17 | char currentByte = data[(*currentBytePosition)++]; 18 | if (_bytePosition++ == 0) { 19 | _packetIdMsb = currentByte; 20 | } else { 21 | _packetId = currentByte | _packetIdMsb << 8; 22 | _parsingInformation->bufferState = BufferState::NONE; 23 | _callback(_packetId); 24 | } 25 | } 26 | 27 | void PubRecPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 28 | (void)data; 29 | (void)currentBytePosition; 30 | } 31 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubRecPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class PubRecPacket : public Packet { 10 | public: 11 | explicit PubRecPacket(ParsingInformation* parsingInformation, OnPubRecInternalCallback callback); 12 | ~PubRecPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnPubRecInternalCallback _callback; 20 | 21 | uint8_t _bytePosition; 22 | char _packetIdMsb; 23 | uint16_t _packetId; 24 | }; 25 | } // namespace AsyncMqttClientInternals 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubRelPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "PubRelPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::PubRelPacket; 4 | 5 | PubRelPacket::PubRelPacket(ParsingInformation* parsingInformation, OnPubRelInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) 8 | , _bytePosition(0) 9 | , _packetIdMsb(0) 10 | , _packetId(0) { 11 | } 12 | 13 | PubRelPacket::~PubRelPacket() { 14 | } 15 | 16 | void PubRelPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 17 | char currentByte = data[(*currentBytePosition)++]; 18 | if (_bytePosition++ == 0) { 19 | _packetIdMsb = currentByte; 20 | } else { 21 | _packetId = currentByte | _packetIdMsb << 8; 22 | _parsingInformation->bufferState = BufferState::NONE; 23 | _callback(_packetId); 24 | } 25 | } 26 | 27 | void PubRelPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 28 | (void)data; 29 | (void)currentBytePosition; 30 | } 31 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PubRelPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class PubRelPacket : public Packet { 10 | public: 11 | explicit PubRelPacket(ParsingInformation* parsingInformation, OnPubRelInternalCallback callback); 12 | ~PubRelPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnPubRelInternalCallback _callback; 20 | 21 | uint8_t _bytePosition; 22 | char _packetIdMsb; 23 | uint16_t _packetId; 24 | }; 25 | } // namespace AsyncMqttClientInternals 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/PublishPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../Flags.hpp" 6 | #include "../ParsingInformation.hpp" 7 | #include "../Callbacks.hpp" 8 | 9 | namespace AsyncMqttClientInternals { 10 | class PublishPacket : public Packet { 11 | public: 12 | explicit PublishPacket(ParsingInformation* parsingInformation, OnMessageInternalCallback dataCallback, OnPublishInternalCallback completeCallback); 13 | ~PublishPacket(); 14 | 15 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 16 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 17 | 18 | private: 19 | ParsingInformation* _parsingInformation; 20 | OnMessageInternalCallback _dataCallback; 21 | OnPublishInternalCallback _completeCallback; 22 | 23 | void _preparePayloadHandling(uint32_t payloadLength); 24 | 25 | bool _dup; 26 | uint8_t _qos; 27 | bool _retain; 28 | 29 | uint8_t _bytePosition; 30 | char _topicLengthMsb; 31 | uint16_t _topicLength; 32 | bool _ignore; 33 | char _packetIdMsb; 34 | uint16_t _packetId; 35 | uint32_t _payloadLength; 36 | uint32_t _payloadBytesRead; 37 | }; 38 | } // namespace AsyncMqttClientInternals 39 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/SubAckPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "SubAckPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::SubAckPacket; 4 | 5 | SubAckPacket::SubAckPacket(ParsingInformation* parsingInformation, OnSubAckInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) 8 | , _bytePosition(0) 9 | , _packetIdMsb(0) 10 | , _packetId(0) { 11 | } 12 | 13 | SubAckPacket::~SubAckPacket() { 14 | } 15 | 16 | void SubAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 17 | char currentByte = data[(*currentBytePosition)++]; 18 | if (_bytePosition++ == 0) { 19 | _packetIdMsb = currentByte; 20 | } else { 21 | _packetId = currentByte | _packetIdMsb << 8; 22 | _parsingInformation->bufferState = BufferState::PAYLOAD; 23 | } 24 | } 25 | 26 | void SubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 27 | char status = data[(*currentBytePosition)++]; 28 | 29 | /* switch (status) { 30 | case 0: 31 | Serial.println("Success QoS 0"); 32 | break; 33 | case 1: 34 | Serial.println("Success QoS 1"); 35 | break; 36 | case 2: 37 | Serial.println("Success QoS 2"); 38 | break; 39 | case 0x80: 40 | Serial.println("Failure"); 41 | break; 42 | } */ 43 | 44 | _parsingInformation->bufferState = BufferState::NONE; 45 | _callback(_packetId, status); 46 | } 47 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/SubAckPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class SubAckPacket : public Packet { 10 | public: 11 | explicit SubAckPacket(ParsingInformation* parsingInformation, OnSubAckInternalCallback callback); 12 | ~SubAckPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnSubAckInternalCallback _callback; 20 | 21 | uint8_t _bytePosition; 22 | char _packetIdMsb; 23 | uint16_t _packetId; 24 | }; 25 | } // namespace AsyncMqttClientInternals 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/UnsubAckPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "UnsubAckPacket.hpp" 2 | 3 | using AsyncMqttClientInternals::UnsubAckPacket; 4 | 5 | UnsubAckPacket::UnsubAckPacket(ParsingInformation* parsingInformation, OnUnsubAckInternalCallback callback) 6 | : _parsingInformation(parsingInformation) 7 | , _callback(callback) 8 | , _bytePosition(0) 9 | , _packetIdMsb(0) 10 | , _packetId(0) { 11 | } 12 | 13 | UnsubAckPacket::~UnsubAckPacket() { 14 | } 15 | 16 | void UnsubAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { 17 | char currentByte = data[(*currentBytePosition)++]; 18 | if (_bytePosition++ == 0) { 19 | _packetIdMsb = currentByte; 20 | } else { 21 | _packetId = currentByte | _packetIdMsb << 8; 22 | _parsingInformation->bufferState = BufferState::NONE; 23 | _callback(_packetId); 24 | } 25 | } 26 | 27 | void UnsubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { 28 | (void)data; 29 | (void)currentBytePosition; 30 | } 31 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Packets/UnsubAckPacket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Arduino.h" 4 | #include "Packet.hpp" 5 | #include "../ParsingInformation.hpp" 6 | #include "../Callbacks.hpp" 7 | 8 | namespace AsyncMqttClientInternals { 9 | class UnsubAckPacket : public Packet { 10 | public: 11 | explicit UnsubAckPacket(ParsingInformation* parsingInformation, OnUnsubAckInternalCallback callback); 12 | ~UnsubAckPacket(); 13 | 14 | void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); 15 | void parsePayload(char* data, size_t len, size_t* currentBytePosition); 16 | 17 | private: 18 | ParsingInformation* _parsingInformation; 19 | OnUnsubAckInternalCallback _callback; 20 | 21 | uint8_t _bytePosition; 22 | char _packetIdMsb; 23 | uint16_t _packetId; 24 | }; 25 | } // namespace AsyncMqttClientInternals 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/ParsingInformation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AsyncMqttClientInternals { 4 | enum class BufferState : uint8_t { 5 | NONE = 0, 6 | REMAINING_LENGTH = 2, 7 | VARIABLE_HEADER = 3, 8 | PAYLOAD = 4 9 | }; 10 | 11 | struct ParsingInformation { 12 | BufferState bufferState; 13 | 14 | uint16_t maxTopicLength; 15 | char* topicBuffer; 16 | 17 | uint8_t packetType; 18 | uint16_t packetFlags; 19 | uint32_t remainingLength; 20 | }; 21 | } // namespace AsyncMqttClientInternals 22 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/AsyncMqttClient/Storage.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AsyncMqttClientInternals { 4 | struct PendingPubRel { 5 | uint16_t packetId; 6 | }; 7 | 8 | struct PendingAck { 9 | uint8_t packetType; 10 | uint8_t headerFlag; 11 | uint16_t packetId; 12 | }; 13 | } // namespace AsyncMqttClientInternals 14 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Marvin Roger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /wled00/src/dependencies/async-mqtt-client/README.md: -------------------------------------------------------------------------------- 1 | Async MQTT client for ESP8266 and ESP32 (Github: https://github.com/marvinroger/async-mqtt-client) 2 | ============================= 3 | 4 | [![Build Status](https://img.shields.io/travis/marvinroger/async-mqtt-client/master.svg?style=flat-square)](https://travis-ci.org/marvinroger/async-mqtt-client) 5 | 6 | An Arduino for ESP8266 and ESP32 asynchronous [MQTT](http://mqtt.org/) client implementation, built on [me-no-dev/ESPAsyncTCP (ESP8266)](https://github.com/me-no-dev/ESPAsyncTCP) | [me-no-dev/AsyncTCP (ESP32)](https://github.com/me-no-dev/AsyncTCP) . 7 | ## Features 8 | 9 | * Compliant with the 3.1.1 version of the protocol 10 | * Fully asynchronous 11 | * Subscribe at QoS 0, 1 and 2 12 | * Publish at QoS 0, 1 and 2 13 | * SSL/TLS support 14 | * Available in the [PlatformIO registry](http://platformio.org/lib/show/346/AsyncMqttClient) 15 | 16 | ## Requirements, installation and usage 17 | 18 | The project is documented in the [/docs folder](docs). 19 | -------------------------------------------------------------------------------- /wled00/src/dependencies/dmx/ESPDMX.h: -------------------------------------------------------------------------------- 1 | // - - - - - 2 | // ESPDMX - A Arduino library for sending and receiving DMX using the builtin serial hardware port. 3 | // ESPDMX.cpp: Library implementation file 4 | // 5 | // Copyright (C) 2015 Rick 6 | // This work is licensed under a GNU style license. 7 | // 8 | // Last change: Marcel Seerig 9 | // 10 | // Documentation and samples are available at https://github.com/Rickgg/ESP-Dmx 11 | // - - - - - 12 | 13 | #include 14 | 15 | 16 | #ifndef ESPDMX_h 17 | #define ESPDMX_h 18 | 19 | // ---- Methods ---- 20 | 21 | class DMXESPSerial { 22 | public: 23 | void init(); 24 | void init(int MaxChan); 25 | uint8_t read(int Channel); 26 | void write(int channel, uint8_t value); 27 | void update(); 28 | void end(); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /wled00/src/dependencies/dmx/SparkFunDMX.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | SparkFunDMX.h 3 | Arduino Library for the SparkFun ESP32 LED to DMX Shield 4 | Andy England @ SparkFun Electronics 5 | 7/22/2019 6 | 7 | Development environment specifics: 8 | Arduino IDE 1.6.4 9 | 10 | This code is released under the [MIT License](http://opensource.org/licenses/MIT). 11 | Please review the LICENSE.md file included with this example. If you have any questions 12 | or concerns with licensing, please contact techsupport@sparkfun.com. 13 | Distributed as-is; no warranty is given. 14 | ******************************************************************************/ 15 | 16 | #include 17 | 18 | 19 | #ifndef SparkFunDMX_h 20 | #define SparkFunDMX_h 21 | 22 | #define DMX_SEND_ONLY // this disables DMX sending features, and saves us two GPIO pins 23 | 24 | // ---- Methods ---- 25 | 26 | class SparkFunDMX { 27 | public: 28 | void initWrite(int maxChan); 29 | #if !defined(DMX_SEND_ONLY) 30 | void initRead(int maxChan); 31 | uint8_t read(int Channel); 32 | #endif 33 | void write(int channel, uint8_t value); 34 | void update(); 35 | private: 36 | const uint8_t _startCodeValue = 0xFF; 37 | const bool _READ = true; 38 | const bool _WRITE = false; 39 | bool _READWRITE; 40 | }; 41 | 42 | #endif -------------------------------------------------------------------------------- /wled00/src/dependencies/espalexa/EspalexaDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef EspalexaDevice_h 2 | #define EspalexaDevice_h 3 | 4 | #include "Arduino.h" 5 | #include 6 | 7 | class EspalexaDevice; 8 | 9 | typedef std::function BrightnessCallbackFunction; 10 | typedef std::function DeviceCallbackFunction; 11 | typedef std::function ColorCallbackFunction; 12 | 13 | enum class EspalexaColorMode : uint8_t { none = 0, ct = 1, hs = 2, xy = 3 }; 14 | enum class EspalexaDeviceType : uint8_t { onoff = 0, dimmable = 1, whitespectrum = 2, color = 3, extendedcolor = 4 }; 15 | enum class EspalexaDeviceProperty : uint8_t { none = 0, on = 1, off = 2, bri = 3, hs = 4, ct = 5, xy = 6 }; 16 | 17 | class EspalexaDevice { 18 | private: 19 | String _deviceName; 20 | BrightnessCallbackFunction _callback = nullptr; 21 | DeviceCallbackFunction _callbackDev = nullptr; 22 | ColorCallbackFunction _callbackCol = nullptr; 23 | uint8_t _val, _val_last, _sat = 0; 24 | uint16_t _hue = 0, _ct = 0; 25 | float _x = 0.5f, _y = 0.5f; 26 | uint32_t _rgb = 0; 27 | uint8_t _id = 0; 28 | EspalexaDeviceType _type; 29 | EspalexaDeviceProperty _changed = EspalexaDeviceProperty::none; 30 | EspalexaColorMode _mode = EspalexaColorMode::xy; 31 | 32 | public: 33 | EspalexaDevice(); 34 | ~EspalexaDevice(); 35 | EspalexaDevice(String deviceName, BrightnessCallbackFunction bcb, uint8_t initialValue =0); 36 | EspalexaDevice(String deviceName, DeviceCallbackFunction dcb, EspalexaDeviceType t =EspalexaDeviceType::dimmable, uint8_t initialValue =0); 37 | EspalexaDevice(String deviceName, ColorCallbackFunction ccb, uint8_t initialValue =0); 38 | 39 | String getName(); 40 | uint8_t getId(); 41 | EspalexaDeviceProperty getLastChangedProperty(); 42 | uint8_t getValue(); 43 | uint8_t getLastValue(); //last value that was not off (1-255) 44 | bool getState(); 45 | uint8_t getPercent(); 46 | uint8_t getDegrees(); 47 | uint16_t getHue(); 48 | uint8_t getSat(); 49 | uint16_t getCt(); 50 | uint32_t getKelvin(); 51 | float getX(); 52 | float getY(); 53 | uint32_t getRGB(); 54 | uint8_t getR(); 55 | uint8_t getG(); 56 | uint8_t getB(); 57 | uint8_t getW(); 58 | EspalexaColorMode getColorMode(); 59 | EspalexaDeviceType getType(); 60 | 61 | void setId(uint8_t id); 62 | void setPropertyChanged(EspalexaDeviceProperty p); 63 | void setValue(uint8_t bri); 64 | void setState(bool onoff); 65 | void setPercent(uint8_t perc); 66 | void setName(String name); 67 | void setColor(uint16_t ct); 68 | void setColor(uint16_t hue, uint8_t sat); 69 | void setColorXY(float x, float y); 70 | void setColor(uint8_t r, uint8_t g, uint8_t b); 71 | 72 | void doCallback(); 73 | }; 74 | 75 | #endif -------------------------------------------------------------------------------- /wled00/src/dependencies/espalexa/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Christian Schwinne 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /wled00/src/dependencies/network/Network.cpp: -------------------------------------------------------------------------------- 1 | #include "Network.h" 2 | 3 | IPAddress NetworkClass::localIP() 4 | { 5 | IPAddress localIP; 6 | #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET) 7 | localIP = ETH.localIP(); 8 | if (localIP[0] != 0) { 9 | return localIP; 10 | } 11 | #endif 12 | localIP = WiFi.localIP(); 13 | if (localIP[0] != 0) { 14 | return localIP; 15 | } 16 | 17 | return INADDR_NONE; 18 | } 19 | 20 | IPAddress NetworkClass::subnetMask() 21 | { 22 | #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET) 23 | if (ETH.localIP()[0] != 0) { 24 | return ETH.subnetMask(); 25 | } 26 | #endif 27 | if (WiFi.localIP()[0] != 0) { 28 | return WiFi.subnetMask(); 29 | } 30 | return IPAddress(255, 255, 255, 0); 31 | } 32 | 33 | IPAddress NetworkClass::gatewayIP() 34 | { 35 | #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET) 36 | if (ETH.localIP()[0] != 0) { 37 | return ETH.gatewayIP(); 38 | } 39 | #endif 40 | if (WiFi.localIP()[0] != 0) { 41 | return WiFi.gatewayIP(); 42 | } 43 | return INADDR_NONE; 44 | } 45 | 46 | bool NetworkClass::isConnected() 47 | { 48 | #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET) 49 | return (WiFi.localIP()[0] != 0 && WiFi.status() == WL_CONNECTED) || ETH.localIP()[0] != 0; 50 | #else 51 | return (WiFi.localIP()[0] != 0 && WiFi.status() == WL_CONNECTED); 52 | #endif 53 | } 54 | 55 | bool NetworkClass::isEthernet() 56 | { 57 | #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET) 58 | return (ETH.localIP()[0] != 0); 59 | #endif 60 | return false; 61 | } 62 | 63 | NetworkClass Network; -------------------------------------------------------------------------------- /wled00/src/dependencies/network/Network.h: -------------------------------------------------------------------------------- 1 | #ifdef ESP8266 2 | #include 3 | #else // ESP32 4 | #include 5 | #include 6 | #endif 7 | 8 | #ifndef Network_h 9 | #define Network_h 10 | 11 | class NetworkClass 12 | { 13 | public: 14 | IPAddress localIP(); 15 | IPAddress subnetMask(); 16 | IPAddress gatewayIP(); 17 | bool isConnected(); 18 | bool isEthernet(); 19 | }; 20 | 21 | extern NetworkClass Network; 22 | 23 | #endif -------------------------------------------------------------------------------- /wled00/src/dependencies/time/DS1307RTC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DS1307RTC.h - library for DS1307 RTC 3 | * This library is intended to be uses with Arduino Time library functions 4 | */ 5 | 6 | #ifndef DS1307RTC_h 7 | #define DS1307RTC_h 8 | 9 | #include "TimeLib.h" 10 | 11 | // library interface description 12 | class DS1307RTC 13 | { 14 | // user-accessible "public" interface 15 | public: 16 | DS1307RTC() {} 17 | static void begin() { /*Wire.begin();*/ } // WLEDSR bugfix 18 | static time_t get(); 19 | static bool set(time_t t); 20 | static bool read(tmElements_t &tm); 21 | static bool write(tmElements_t &tm); 22 | static bool chipPresent() { return exists; } 23 | static unsigned char isRunning(); 24 | static void setCalibration(char calValue); 25 | static char getCalibration(); 26 | 27 | private: 28 | static bool exists; 29 | static uint8_t dec2bcd(uint8_t num); 30 | static uint8_t bcd2dec(uint8_t num); 31 | }; 32 | 33 | #ifdef RTC 34 | #undef RTC // workaround for Arduino Due, which defines "RTC"... 35 | #endif 36 | 37 | extern DS1307RTC RTC; 38 | 39 | #endif 40 | 41 | 42 | -------------------------------------------------------------------------------- /wled00/src/dependencies/time/LICENSE.txt: -------------------------------------------------------------------------------- 1 | https://github.com/PaulStoffregen/Time/ 2 | 3 | time.c - low level time and date functions 4 | Copyright (c) Michael Margolis 2009-2014 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | You should have received a copy of the GNU Lesser General Public 14 | License along with this library; if not, write to the Free Software 15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 1.0 6 Jan 2010 - initial release 18 | 1.1 12 Feb 2010 - fixed leap year calculation error 19 | 1.2 1 Nov 2010 - fixed setTime bug (thanks to Korman for this) 20 | 1.3 24 Mar 2012 - many edits by Paul Stoffregen: fixed timeStatus() to update 21 | status, updated examples for Arduino 1.0, fixed ARM 22 | compatibility issues, added TimeArduinoDue and TimeTeensy3 23 | examples, add error checking and messages to RTC examples, 24 | add examples to DS1307RTC library. 25 | 1.4 5 Sep 2014 - compatibility with Arduino 1.5.7 26 | -------------------------------------------------------------------------------- /wled00/src/dependencies/time/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Time", 3 | "description": "Time keeping library", 4 | "keywords": "Time, date, hour, minute, second, day, week, month, year, RTC", 5 | "authors": [ 6 | { 7 | "name": "Michael Margolis" 8 | }, 9 | { 10 | "name": "Paul Stoffregen", 11 | "email": "paul@pjrc.com", 12 | "url": "http://www.pjrc.com", 13 | "maintainer": true 14 | } 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/PaulStoffregen/Time" 19 | }, 20 | "version": "1.5", 21 | "homepage": "http://playground.arduino.cc/Code/Time", 22 | "frameworks": "Arduino", 23 | "examples": [ 24 | "examples/*/*.ino" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /wled00/src/dependencies/time/library.properties: -------------------------------------------------------------------------------- 1 | name=Time 2 | version=1.5 3 | author=Michael Margolis 4 | maintainer=Paul Stoffregen 5 | sentence=Timekeeping functionality for Arduino 6 | paragraph=Date and Time functions, with provisions to synchronize to external time sources like GPS and NTP (Internet). This library is often used together with TimeAlarms and DS1307RTC. 7 | category=Timing 8 | url=http://playground.arduino.cc/code/time 9 | architectures=* 10 | 11 | -------------------------------------------------------------------------------- /wled00/src/dependencies/timezone/LICENSE.md: -------------------------------------------------------------------------------- 1 | #Arduino Timezone Library v1.0 2 | https://github.com/JChristensen/Timezone 3 | LICENSE file 4 | Jack Christensen Mar 2012 5 | 6 | ![CC BY-SA](http://mirrors.creativecommons.org/presskit/buttons/88x31/png/by-sa.png) 7 | ##CC BY-SA 8 | Arduino Timezone Library by Jack Christensen is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to: 9 | Creative Commons 10 | 444 Castro Street, Suite 900 11 | Mountain View, CA 94041 12 | -------------------------------------------------------------------------------- /wled00/src/dependencies/ws2812fx/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Harm Aldick 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /wled00/src/dependencies/ws2812fx/readme.txt: -------------------------------------------------------------------------------- 1 | https://github.com/kitesurfer1404/WS2812FX/ 2 | 3 | The WS2812FX implementation was heavily altered and differs from its master branch. 4 | Due to regular changes to the library code it is kept in the source dir for now. 5 | -------------------------------------------------------------------------------- /wled00/um_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "wled.h" 2 | /* 3 | * Registration and management utility for v2 usermods 4 | */ 5 | 6 | //Usermod Manager internals 7 | void UsermodManager::loop() { for (byte i = 0; i < numMods; i++) ums[i]->loop(); } 8 | void UsermodManager::handleOverlayDraw() { for (byte i = 0; i < numMods; i++) ums[i]->handleOverlayDraw(); } 9 | bool UsermodManager::handleButton(uint8_t b) { 10 | bool overrideIO = false; 11 | for (byte i = 0; i < numMods; i++) { 12 | if (ums[i]->handleButton(b)) overrideIO = true; 13 | } 14 | return overrideIO; 15 | } 16 | 17 | void UsermodManager::setup() { for (byte i = 0; i < numMods; i++) ums[i]->setup(); } 18 | void UsermodManager::connected() { for (byte i = 0; i < numMods; i++) ums[i]->connected(); } 19 | 20 | void UsermodManager::addToJsonState(JsonObject& obj) { for (byte i = 0; i < numMods; i++) ums[i]->addToJsonState(obj); } 21 | void UsermodManager::addToJsonInfo(JsonObject& obj) { for (byte i = 0; i < numMods; i++) ums[i]->addToJsonInfo(obj); } 22 | void UsermodManager::readFromJsonState(JsonObject& obj) { for (byte i = 0; i < numMods; i++) ums[i]->readFromJsonState(obj); } 23 | void UsermodManager::addToConfig(JsonObject& obj) { for (byte i = 0; i < numMods; i++) ums[i]->addToConfig(obj); } 24 | bool UsermodManager::readFromConfig(JsonObject& obj) { 25 | bool allComplete = true; 26 | for (byte i = 0; i < numMods; i++) { 27 | if (!ums[i]->readFromConfig(obj)) allComplete = false; 28 | } 29 | return allComplete; 30 | } 31 | void UsermodManager::onMqttConnect(bool sessionPresent) { for (byte i = 0; i < numMods; i++) ums[i]->onMqttConnect(sessionPresent); } 32 | bool UsermodManager::onMqttMessage(char* topic, char* payload) { 33 | for (byte i = 0; i < numMods; i++) if (ums[i]->onMqttMessage(topic, payload)) return true; 34 | return false; 35 | } 36 | 37 | /* 38 | * Enables usermods to lookup another Usermod. 39 | */ 40 | Usermod* UsermodManager::lookup(uint16_t mod_id) { 41 | for (byte i = 0; i < numMods; i++) { 42 | if (ums[i]->getId() == mod_id) { 43 | return ums[i]; 44 | } 45 | } 46 | return nullptr; 47 | } 48 | 49 | bool UsermodManager::add(Usermod* um) 50 | { 51 | if (numMods >= WLED_MAX_USERMODS || um == nullptr) return false; 52 | ums[numMods] = um; 53 | numMods++; 54 | return true; 55 | } 56 | 57 | byte UsermodManager::getModCount() {return numMods;} -------------------------------------------------------------------------------- /wled00/usermod_v2_empty.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wled.h" 4 | 5 | //This is an empty v2 usermod template. Please see the file usermod_v2_example.h in the EXAMPLE_v2 usermod folder for documentation on the functions you can use! 6 | 7 | class UsermodRenameMe : public Usermod { 8 | private: 9 | 10 | public: 11 | void setup() { 12 | 13 | } 14 | 15 | void loop() { 16 | 17 | } 18 | }; -------------------------------------------------------------------------------- /wled00/wled00.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * WLED Arduino IDE compatibility file. 3 | * 4 | * Where has everything gone? 5 | * 6 | * In April 2020, the project's structure underwent a major change. 7 | * Global variables are now found in file "wled.h" 8 | * Global function declarations are found in "fcn_declare.h" 9 | * 10 | * Usermod compatibility: Existing wled06_usermod.ino mods should continue to work. Delete usermod.cpp. 11 | * New usermods should use usermod.cpp instead. 12 | */ 13 | #include "wled.h" 14 | 15 | void setup() { 16 | WLED::instance().setup(); 17 | } 18 | 19 | void loop() { 20 | WLED::instance().loop(); 21 | } 22 | -------------------------------------------------------------------------------- /wled00/wled00.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------