Skip to content

Commit

Permalink
esp32: Add support for espnow based pktradio
Browse files Browse the repository at this point in the history
Espnow is a connectionless WiFi communication protocol that can be used
to exchange information between esp nodes.

A espnow pktradio driver is proposed that allows building a 6lowpan
network of nodes.

The driver has been evaluated using udpclient & server running on
different devices.

Solves apache#15347

Signed-off-by: Laczen JMS <[email protected]>
  • Loading branch information
Laczen committed Feb 4, 2025
1 parent c1f9c73 commit b608d39
Show file tree
Hide file tree
Showing 5 changed files with 1,882 additions and 0 deletions.
94 changes: 94 additions & 0 deletions arch/xtensa/src/esp32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,100 @@ config ESP32_WIRELESS
---help---
Enable Wireless support

config ESP32_ESPNOW_PKTRADIO
bool "ESPNOW packet radio support"
select ESP32_WIRELESS
depends on WIRELESS_PKTRADIO
default n
---help---
Enable using espnow for packet radio

if ESP32_ESPNOW_PKTRADIO

config ESP32_ESPNOW_PKTRADIO_PANID
hex "ESPNOW node panid"
range 0x0 0xffff
default 0x0
---help---
PANID for espnow packet radio

if PKTRADIO_ADDRLEN = 1

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_0
hex "ESPNOW node address"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

endif #PKTRADIO_ADDRLEN = 1

if PKTRADIO_ADDRLEN > 1

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_0
hex "ESPNOW node address[0]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_1
hex "ESPNOW node address[1]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

if PKTRADIO_ADDRLEN > 2

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_2
hex "ESPNOW node address[2]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_3
hex "ESPNOW node address[3]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_4
hex "ESPNOW node address[4]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_5
hex "ESPNOW node address[5]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_6
hex "ESPNOW node address[6]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

config ESP32_ESPNOW_PKTRADIO_NODE_ADDR_7
hex "ESPNOW node address[7]"
range 0x0 0xff
default 0x0
---help---
Node address for espnow packet radio

endif #PKTRADIO_ADDRLEN > 2

endif #PKTRADIO_ADDRLEN > 1

endif #ESP32_ESPNOW_PKTRADIO

config ESP32_WIFI
bool "Wi-Fi"
default n
Expand Down
5 changes: 5 additions & 0 deletions arch/xtensa/src/esp32/Wireless.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ ifeq ($(CONFIG_ESP32_WIFI),y)
CHIP_CSRCS += esp32_wlan.c esp32_wifi_utils.c esp32_wifi_adapter.c
EXTRA_LIBS += -lcore -lnet80211 -lpp

ifeq ($(CONFIG_ESP32_ESPNOW_PKTRADIO),y)
CHIP_CSRCS += esp32_espnow_pktradio.c
EXTRA_LIBS += -lespnow
endif

ifeq ($(CONFIG_WPA_WAPI_PSK),y)
EXTRA_LIBS += -lwapi
endif
Expand Down
Loading

0 comments on commit b608d39

Please sign in to comment.