esp32: add espnow documentation and defconfig.

Added documentation for espnow and a default defconfig to illustrate
the use of espnow for udp communication.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
This commit is contained in:
Laczen JMS 2025-02-01 10:18:22 +01:00 committed by Tiago Medicci Serrano
parent eba0362bde
commit 6b5fccb32c
2 changed files with 129 additions and 7 deletions

View file

@ -305,10 +305,10 @@ the following output is expected::
nsh> cap
cap_main: Hardware initialized. Opening the capture device: /dev/capture0
cap_main: Number of samples: 0
pwm duty cycle: 50 %
pwm frequence: 50 Hz
pwm duty cycle: 50 %
pwm frequence: 50 Hz
pwm duty cycle: 50 %
pwm frequence: 50 Hz
pwm duty cycle: 50 %
pwm frequence: 50 Hz
coremark
--------
@ -384,6 +384,30 @@ elf
This configuration uses apps/examples/elf in order to test the ELF loader.
It can be tested by executing the ``elf`` application.
espnow
------
A ``espnow`` setup can be used to create a 6lowpan network of esp32 nodes.
A sample configuration is found in ``esp32-devkitc:espnow``. The node
address can be changed under ``ESP32 Peripherals`` option ``Espnow``. To
test the communication using ``udpserver`` and ``udpclient`` two nodes
need to be prepared using e.g. node address ``0x0a`` and ``0x0b``.
On node ``0x0a`` the server can be started using:
``nsh> ifup wpan0``
``ifup wpan0..OK``
``nsh> udpserver &``
On node ``0x0b`` the client can be started using:
``nsh> ifup wpan0``
``ifup wpan0..OK``
``nsh> udpclient fe80::ff:fe00:a``
The client node will show that the messages are sent while the server
shows that messages are received.
i2schar
-------
@ -1088,7 +1112,7 @@ you can confirm it is working this way::
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5666 bytes 547514 (547.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp0s20f3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.4 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 xxxx::xxxx:xxx:xxxx:xx prefixlen 64 scopeid 0x20<link>
@ -1097,7 +1121,7 @@ you can confirm it is working this way::
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 37079 bytes 23604536 (23.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=3.28 ms
@ -1105,7 +1129,7 @@ you can confirm it is working this way::
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=2.63 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=18.9 ms
64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=4.82 ms
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=111 time=63.0 ms

View file

@ -0,0 +1,98 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_ARCH_LEDS is not set
# CONFIG_NDEBUG is not set
# CONFIG_NET_UDP_CHECKSUMS is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="xtensa"
CONFIG_ARCH_BOARD="esp32-devkitc"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
CONFIG_ARCH_CHIP="esp32"
CONFIG_ARCH_CHIP_ESP32=y
CONFIG_ARCH_CHIP_ESP32WROVER=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_DEFAULT_TASK_STACKSIZE=4096
CONFIG_DEV_URANDOM=y
CONFIG_DRIVERS_IEEE80211=y
CONFIG_DRIVERS_WIRELESS=y
CONFIG_ESP32_ESPNOW_PKTRADIO=y
CONFIG_ESP32_ESPNOW_PKTRADIO_NODE_ADDR_0=0x0a
CONFIG_ESP32_SPIFLASH=y
CONFIG_ESP32_SPIFLASH_SPIFFS=y
CONFIG_ESP32_STORAGE_MTD_SIZE=0x80000
CONFIG_ESP32_UART0=y
CONFIG_ESP32_WIFI=y
CONFIG_EXAMPLES_UDP=y
CONFIG_EXAMPLES_UDP_DEVNAME="wpan0"
CONFIG_EXAMPLES_UDP_IPv6=y
CONFIG_EXAMPLES_UDP_SERVER1=y
CONFIG_EXAMPLES_UDP_TARGET2=y
CONFIG_FS_PROCFS=y
CONFIG_IDLETHREAD_STACKSIZE=3072
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LINE_MAX=300
CONFIG_MM_REGIONS=3
CONFIG_NAME_MAX=48
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSCLIENT_NAMESIZE=64
CONFIG_NETDEV_LATEINIT=y
CONFIG_NETDEV_PHY_IOCTL=y
CONFIG_NETDEV_TELNET=y
CONFIG_NETDEV_WIRELESS_IOCTL=y
CONFIG_NETUTILS_CJSON=y
CONFIG_NET_6LOWPAN=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_PKTSIZE=1518
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_IPv6=y
CONFIG_NET_PREALLOC_DEVIF_CALLBACKS=32
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCP_DELAYED_ACK=y
CONFIG_NET_TCP_WRITE_BUFFERS=y
CONFIG_NET_UDP=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
CONFIG_PREALLOC_TIMERS=4
CONFIG_PTHREAD_MUTEX_TYPES=y
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SIG_DEFAULT=y
CONFIG_SPI=y
CONFIG_SPIFFS_NAME_MAX=48
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSLOG_BUFFER=y
CONFIG_SYSLOG_CONSOLE=y
CONFIG_SYSTEM_ARGTABLE3=y
CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_PKTRADIO=y
CONFIG_WIRELESS_WAPI=y
CONFIG_WIRELESS_WAPI_CMDTOOL=y
CONFIG_WIRELESS_WAPI_INITCONF=y