Skip to content

Commit 0a6ad81

Browse files
authored
ESPNow fixes (#5658)
1 parent 79f7290 commit 0a6ad81

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

content/components/espnow.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ params:
77
image: esp-now.svg
88
---
99

10-
This component allows ESPHome to communicate with esp32 devices in a simple and unrestricted way.
10+
The ESPNow component allows ESPHome to communicate with esp32 devices in a simple and unrestricted way.
1111
It enables the option to interact with other esp32 devices over the Espressif's ESP-NOW protocol, see
12-
[documentation](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_now.html)
12+
[documentation](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_now.html).
13+
It can be used with the [Packet Transport Component](/components/packet_transport) to broadcast
14+
sensor data, see [ESP-NOW Packet Transport Platform](/components/packet_transport/espnow).
1315

1416
> [!NOTE]
1517
> Broadcasting data is not recommended, this will also reach devices not controlled by you that use the esp-now protocol.
@@ -213,3 +215,4 @@ automatically add any peer that data is sent to.
213215
## See Also
214216

215217
- {{< apiref "espnow/espnow.h" "espnow/espnow.h" >}}
218+
- {{< docref "/components/packet_transport/espnow" >}}

content/components/packet_transport/espnow.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ params:
99

1010
{{< anchor "espnow-packet-transport" >}}
1111

12-
The [Packet Transport Component](#packet-transport) platform allows ESPHome nodes to directly communicate with each over a communication channel. The ESP-NOW implementation of the platform uses ESP-NOW as a communication medium. See the [Packet Transport Component](#packet-transport) and {{< docref "/components/espnow" >}} for more information.
12+
The [Packet Transport Component](#packet-transport) platform allows ESPHome nodes to directly communicate with each
13+
over a communication channel. The ESP-NOW implementation of the platform uses ESP-NOW as a communication medium.
14+
See the [Packet Transport Component](#packet-transport) and {{< docref "/components/espnow" >}} for more information.
1315

14-
ESP-NOW provides low-latency, low-power wireless communication between ESP32 devices without requiring a Wi-Fi connection. This makes it ideal for battery-powered sensors or applications where Wi-Fi overhead would impact performance.
16+
ESP-NOW provides low-latency, low-power wireless communication between ESP32 devices without requiring a Wi-Fi
17+
connection. This makes it ideal for battery-powered sensors or applications where Wi-Fi overhead would impact
18+
performance.
1519

1620
> **Note:**
17-
> ESP-NOW communication occurs independently of Wi-Fi. Devices can communicate via ESP-NOW even when Wi-Fi is disabled, making it suitable for power-sensitive applications.
21+
> ESP-NOW communication occurs independently of Wi-Fi. Devices can communicate via ESP-NOW even when Wi-Fi is
22+
> disabled, making it suitable for power-sensitive applications.
1823
1924
## Example Configuration
2025

@@ -44,7 +49,7 @@ sensor:
4449
- **espnow_id** (**Required**, [ID](#config-id)): The esp-now ID to use for transport.
4550
- **peer_address** (*Optional*, MAC Address): MAC address to send packets to. This can be either a specific
4651
peer address for point-to-point communication, or the broadcast address. Default FF:FF:FF:FF:FF:FF
47-
- All other options from the [Packet Transport Component](#packet-transport)
52+
- All other options from the [Packet Transport Component](/components/packet_transport)
4853
4954
> **Note:**
5055
> Peers must be registered with the {{< docref "/components/espnow" >}} component before
@@ -64,10 +69,12 @@ packet_transport:
6469
- sensor_id
6570
```
6671

67-
All devices with the broadcast address (`FF:FF:FF:FF:FF:FF`) registered as a peer will receive the packets. This is useful for hub-and-spoke topologies where multiple devices monitor a single sensor source.
72+
All devices with the broadcast address (`FF:FF:FF:FF:FF:FF`) registered as a peer will receive the packets.
73+
This is useful for hub-and-spoke topologies where multiple devices monitor a single sensor source.
6874

6975
> **Warning:**
70-
> Using broadcast mode increases ESP-NOW traffic on the radio channel, which may impact performance of other ESP-NOW devices in range. Use specific peer addresses whenever possible to minimize interference.
76+
> Using broadcast mode increases ESP-NOW traffic on the radio channel, which may impact performance of other
77+
> ESP-NOW devices in range. Use specific peer addresses whenever possible to minimize interference.
7178

7279
### Unicast Mode
7380

@@ -79,7 +86,8 @@ packet_transport:
7986
- sensor_id
8087
```
8188

82-
Only the specified peer receives the packets. This is more efficient for point-to-point communication and reduces radio channel congestion for neighboring ESP-NOW devices.
89+
Only the specified peer receives the packets. This is more efficient for point-to-point communication and reduces
90+
radio channel congestion for neighboring ESP-NOW devices.
8391

8492
## Simple Example
8593

@@ -90,11 +98,11 @@ This example shows two devices exchanging sensor data over ESP-NOW with encrypti
9098
```yaml
9199
espnow:
92100
peers:
93-
- mac_address: "AA:BB:CC:DD:EE:01" # Device 2
101+
- "AA:BB:CC:DD:EE:01" # Consumer mac address
94102
95103
packet_transport:
96104
- platform: espnow
97-
peer_address: "AA:BB:CC:DD:EE:01" # Send to Device 2
105+
peer_address: "AA:BB:CC:DD:EE:01" # Consumer mac address
98106
encryption: "MySecretKey123"
99107
sensors:
100108
- outdoor_temp
@@ -111,13 +119,13 @@ sensor:
111119
```yaml
112120
espnow:
113121
peers:
114-
- mac_address: "AA:BB:CC:DD:EE:00" # Device 1
122+
- "AA:BB:CC:DD:EE:00" # Provider mac address
115123
116124
packet_transport:
117125
- platform: espnow
118126
encryption: "MySecretKey123"
119127
providers:
120-
- name: temp-sensor
128+
- name: temp-sensor # Provider device name
121129
122130
sensor:
123131
- platform: packet_transport
@@ -136,7 +144,9 @@ This example shows a central hub receiving sensor data from multiple remote devi
136144
```yaml
137145
espnow:
138146
peers:
139-
- mac_address: "FF:FF:FF:FF:FF:FF"
147+
- "AA:BB:CC:DD:EE:01" # room-sensor-1 mac address
148+
- "AA:BB:CC:DD:EE:02" # room-sensor-2 mac address
149+
- "AA:BB:CC:DD:EE:03" # outdoor-sensor mac address
140150
141151
packet_transport:
142152
- platform: espnow
@@ -167,12 +177,9 @@ sensor:
167177

168178
```yaml
169179
espnow:
170-
peers:
171-
- mac_address: "FF:FF:FF:FF:FF:FF"
172180
173181
packet_transport:
174182
- platform: espnow
175-
peer_address: "FF:FF:FF:FF:FF:FF"
176183
encryption: "HubSecret123"
177184
sensors:
178185
- temperature
@@ -185,7 +192,7 @@ sensor:
185192

186193
## See Also
187194

188-
- [Packet Transport Component](#packet-transport)
195+
- [Packet Transport Component](/components/packet_transport)
189196
- {{< docref "/components/espnow" >}}
190197
- {{< docref "/components/binary_sensor/packet_transport" >}}
191198
- {{< docref "/components/sensor/packet_transport" >}}

0 commit comments

Comments
 (0)