Description
Is your feature request related to a problem?
ESP-IDF could really use first class SNMP support. SNMP isn't sexy, but it's sticking around, and remains one of the most common ways to monitor network devices and simpler network-connected embedded devices (UPS, switches, NAS, printers, etc.). For a network appliance style IoT device, it's squarely in ESP's wheelhouse. If somebody makes a critical piece of IT-adjacent infrastructure with an ESP at its center, SNMP is a good/robust way for 3rd parties to monitor it.
Describe the solution you'd like.
Ideally this would include a basic working demo. ESP-IDF still supports lwIP; which itself supports SNMP. It's mostly working despite not being officially supported (see below).
Describe alternatives you've considered.
For production networks, I'm really not seeing anything that's vendor agnostic and well-supported. Feel free to discuss alternatives, but I'm not seeing any of the newer IoT style protocols that are "sticking around" with the staying power that SNMP has.
Additional context.
The following is enough to get LWIP compiled in with SNMP support.
#Add LWIP as a source
# Glob all *.c files under the lwip api directory
file(GLOB_RECURSE SNMP_SOURCES "${IDF_PATH}/components/lwip/lwip/src/apps/snmp/*.c" )
idf_component_register(
SRCS ${app_sources} ${SNMP_SOURCES}
INCLUDE_DIRS "." "${IDF_PATH}/components/lwip/lwip/src/apps/snmp/"
)
#LWIP Options override
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIB2_STATS=1 -DLWIP_SNMP=1 -DSNMP_USE_RAW=0 -DSNMP_USE_NETCONN=1 -DSNMP_LWIP_MIB2=1")
Combined with the ESP-IDF menuconfig items for enabling the LWIP thread support, it works (mostly) right now.
There is a bug of some sort where invalid IDs can cause a kernel panic inside ESP's ports.c
, but for the sunny day messages to valid or mostly-valid OIDs, ESP-IDF is working with LWIP's SNMP.
Otherwise, lwIP runs "out of the box" as described here:
https://www.nongnu.org/lwip/2_0_x/group__snmp.html