diff --git a/Doxygen b/Doxygen index ce3141a11..3e2f5875f 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2021.11.0b1 +PROJECT_NUMBER = 2021.11.0b2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index 6151e6a24..5d957c707 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ESPHOME_PATH = ../esphome -ESPHOME_REF = 2021.11.0b1 +ESPHOME_REF = 2021.11.0b2 .PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify diff --git a/_static/version b/_static/version index b41257863..5afa20f56 100644 --- a/_static/version +++ b/_static/version @@ -1 +1 @@ -2021.11.0b1 \ No newline at end of file +2021.11.0b2 \ No newline at end of file diff --git a/changelog/2021.11.0.rst b/changelog/2021.11.0.rst index 951723dcd..c1c06cc3c 100644 --- a/changelog/2021.11.0.rst +++ b/changelog/2021.11.0.rst @@ -50,6 +50,14 @@ Breaking Changes - Add restore_mode to rotary_encoder :esphomepr:`2643` by :ghuser:`niklasweber` (breaking-change) - Neopixelbus redo method definitions :esphomepr:`2616` by :ghuser:`OttoWinter` (new-feature) (breaking-change) +Beta fixes +^^^^^^^^^^ + +- Fix template number initial value being NaN :esphomepr:`2692` by :ghuser:`jesserockz` +- [remote_transmitter] accurate pulse timing for ESP8266 :esphomepr:`2476` by :ghuser:`CarlosGS` +- Uart debugging support :esphomepr:`2478` by :ghuser:`mmakaay` +- Enable addressable light power supply based on raw values :esphomepr:`2690` by :ghuser:`oxan` + All changes ^^^^^^^^^^^ @@ -137,6 +145,10 @@ All changes - Make OTA function switchable in web_server component :esphomepr:`2685` by :ghuser:`lazlyhu` - Implement Improv via Serial component :esphomepr:`2423` by :ghuser:`jesserockz` (new-integration) - [ms5611]: Re-implement conversion from ADC readings to sensor values :esphomepr:`2665` by :ghuser:`anatoly-savchenkov` +- Fix template number initial value being NaN :esphomepr:`2692` by :ghuser:`jesserockz` +- [remote_transmitter] accurate pulse timing for ESP8266 :esphomepr:`2476` by :ghuser:`CarlosGS` +- Uart debugging support :esphomepr:`2478` by :ghuser:`mmakaay` +- Enable addressable light power supply based on raw values :esphomepr:`2690` by :ghuser:`oxan` Past Changelogs --------------- diff --git a/components/uart.rst b/components/uart.rst index 3c30a1129..beb68c4da 100644 --- a/components/uart.rst +++ b/components/uart.rst @@ -58,6 +58,7 @@ Configuration variables: - **parity** (*Optional*): The parity used on the UART bus. Options: ``NONE``, ``EVEN``, ``ODD``. Defaults to ``NONE``. - **stop_bits** (*Optional*, int): The number of stop bits to send. Options: 1, 2. Defaults to 1. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID for this UART hub if you need multiple UART hubs. +- **debug** (*Optional*, mapping): Options for debugging communication on the UART hub, see :ref:`uart-debugging`. ESP32 options: @@ -110,6 +111,70 @@ This :ref:`Action ` sends a defined UART signal to the given UART id: my_second_uart data: 'other data' +.. _uart-debugging: + +Debugging +--------- + +If you need insight in the communication that is being sent and/or received over a UART bus, then you can make use +of the debugging feature. + +.. code-block:: yaml + + # Example configuration entry + uart: + baud_rate: 115200 + debug: + direction: BOTH + dummy_receiver: false + after: + bytes: 60 + sequence: + - lambda: UARTDebug::log_hex(direction, bytes, ':'); + +- **direction** (*Optional*, enum): The direction of communication to debug, one of: "RX" (receive, incoming), + "TX" (send, outgoing) or "BOTH". Defaults to "BOTH". +- **dummy_receiver** (*Optional*, boolean): Whether or not to enable the dummy receiver feature. The debugger + will only accumulate bytes that are actually read or sent by a UART device component. This feature is + useful when you want to debug all incoming communication, while no UART device component is configured + for the UART bus (yet). This is especially useful for developers. Normally you'd want to leave this + option disabled. Defaults to false. +- **after** (*Optional*, mapping): The debugger accumulates bytes of communication. This option defines when + to trigger publishing the accumulated bytes. The possible options are: + + - **bytes** (*Optional*, int): Trigger after accumulating the specified number of bytes. Defaults to 256. + - **timeout** (*Optional*, :ref:`config-time`): Trigger after no communication has been seen during the + specified timeout, while one or more bytes have been accumulated. Defaults to 100ms. + - **sequence** (*Optional*, string or list of bytes): Trigger after the specified sequence of bytes is + detected in the communication. + +- **sequence** (*Required*, :ref:`config-action`): Action(s) to perform for publishing debugging data. The + actions can make use of the following variables: + + - **direction**: ``uart::UART_DIRECTION_RX`` or ``uart::UART_DIRECTION_TX`` + - **bytes**: ``std::vector`` containing the accumulated bytes + +**Helper functions for logging** + +Helper functions are provided to make logging of debug data in various formats easy: + +- **UARTDebug::log_hex(direction, bytes, char separator)** Log the bytes as hex values, separated by the provided + separator character. +- **UARTDebug::log_string(direction, bytes)** Log the bytes as string values, escaping unprintable characters. +- **UARTDebug::log_int(direction, bytes, char separator)** Log the bytes as integer values, separated by the provided + separator character. +- **UARTDebug::log_binary(direction, bytes, char separator)** Log the bytes as `` ()`` values, + separated by the provided separator character. + +**Logger buffer size** + +Beware that the ``logger`` component uses a limited buffer size of 512 bytes by default. If the UART +debugger log lines become too long, then you will notice that they end up truncated in the log output. + +In that case, either make sure that the debugger outputs less data per log line (e.g. by setting the +``after.bytes`` option to a lower value) or increase the logger buffer size using the logger +``tx_buffer_size`` option. + See Also -------- diff --git a/conf.py b/conf.py index 55247a73a..06c78b949 100644 --- a/conf.py +++ b/conf.py @@ -69,7 +69,7 @@ author = "Otto Winter" # The short X.Y version. version = "2021.11" # The full version, including alpha/beta/rc tags. -release = "2021.11.0b1" +release = "2021.11.0b2" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.