2026-05-19 2:46 AM
Hello,
I am working on an SNMP implementation using STM32H753ZI with the LwIP Ethernet stack.
Currently, SNMP v1 is working successfully, including trap generation and reception testing using Net-SNMP tools. I am able to send enterprise-specific traps from the STM32 device.
Below is the trap code currently working for SNMP v1:
void send_temp_fault_trap(void)
{
static const u32_t enterprise_oid_arr[] = {1,3,6,1,4,1,50598};
struct snmp_obj_id enterprise_oid;
enterprise_oid.len = LWIP_ARRAYSIZE(enterprise_oid_arr);
memcpy(enterprise_oid.id,enterprise_oid_arr,sizeof(enterprise_oid_arr));
ip_addr_t dst;
IP4_ADDR(&dst, 192,168,0,255);
snmp_trap_dst_ip_set(0, &dst);
snmp_trap_dst_enable(0, 1);
static const u32_t msg_oid_arr[] =
{
1,3,6,1,4,1,50898,10
};
static struct snmp_varbind vb;
static struct snmp_obj_id msg_oid;
static char msg[] = "System Working";
msg_oid.len = LWIP_ARRAYSIZE(msg_oid_arr);
memcpy(msg_oid.id,msg_oid_arr,sizeof(msg_oid_arr));
vb.next = NULL;
vb.oid = msg_oid;
vb.type = SNMP_ASN1_TYPE_OCTET_STRING;
vb.value = (void*)msg;
vb.value_len = strlen(msg); snmp_send_trap(&enterprise_oid,SNMP_GENTRAP_ENTERPRISE_SPECIFIC,MYTRAP_TEMP_FAULT,&vb);
printf("SNMP Trap Sent\r\n");
}Now I want to implement:
I have some questions regarding LwIP SNMP support on STM32:
I would appreciate guidance or reference examples for enabling SNMP v2c/v3 in STM32 + LwIP.
Thank you.
2026-05-19 2:52 AM
Remember that LwIP is an independent 3rd-party project - not specific to ST.
So don't limit your searching to just ST/STM32; eg,
https://www.nongnu.org/lwip/2_0_x/group__snmp.html
https://github.com/particle-iot/lwip-contrib/tree/master/examples/snmp/snmp_v3
etc - via: https://www.google.com/search?q=LwIP+SNMP
2026-05-19 3:16 AM
Additionally, I would like to understand how SNMP trap handling is implemented for SNMP v2c and SNMP v3 in LwIP.
Currently, for SNMP v1, I am using: snmp_send_trap();
Questions:
Is there a separate API available for:
SNMP v2c Trap
SNMP v2c Inform
SNMP v3 Trap/Notification
Does LwIP internally support SNMPv2-Trap-PDU and InformRequest-PDU generation?
Is there any example implementation available for sending SNMP v2c or SNMP v3 notifications from an STM32 device?
For SNMP v3 notifications:
how are authentication and privacy handled?
how is the SNMP engine ID configured?
how are users/security parameters registered?
Is the existing snmp_send_trap() API intended only for SNMP v1 traps, or can it also generate v2c/v3 notifications depending on configuration?
Any guidance, documentation references, or example code would be very helpful.
2026-05-19 3:23 AM - edited 2026-05-19 3:28 AM
@Midhul_Pk wrote:I would like to understand how SNMP trap handling is implemented for SNMP v2c and SNMP v3 in LwIP.
That would certainly be just down to LwIP - not specific to ST or STM32
@Midhul_Pk wrote:Any guidance, documentation references, or example code would be very helpful.
Again, look to the GNU project, and general resources for this
https://www.nongnu.org/lwip/2_1_x/index.html
https://lists.nongnu.org/mailman/listinfo/lwip-users
https://lwip.fandom.com/wiki/Further_lwIP_support
2026-05-19 3:48 AM
@Andrew Neil
The resources you given is not opening :