Hi,
i want do snmpget from my ATSAME70Q20 microcontroller to one of the snmp inverter device of which i know the ip address and oid of the parameter to be quieried.
I have enabled the macro
LWIP_UDP
LWIP_SNMP
oid is :1.3.6.1.4.1.20246.2.3.1.1.1.2.5.3.1.0
snmp device ip : 10.1.1.196
steps followed are :
calling lwip_init() function
initializing ethernet on board
char data[100]={"snmpget -d -v2 -c public 10.1.1.196 1.3.6.1.4.1.20246.2.3.1.1.1.2.5.3.1.0"};
udpecho_raw_pcb =udp_new();
err =udp_bind(udpecho_raw_pcb, IP_ADDR_ANY ,0);
err = udp_connect(udpecho_raw_pcb,snmp device IP Address,161);
if (err == ERR_OK) {
pkt_buf=pbuf_alloc(PBUF_TRANSPORT, buflen, PBUF_POOL);
if (!pkt_buf)
return ERR_MEM;
memcpy(pkt_buf->payload, data, buflen);
/* Sending packet by UDP protocol */
err = udp_sendto(udpecho_raw_pcb, pkt_buf,snmp device IP Address, 161);
udp_recv(udpecho_raw_pcb, snmp_recv, (void *)161);
}
i m not seeing any response from the device though udp_connect return success.
Am i missing any of the steps .
can some one share me the steps to be followed or some example code for doing snmpget and snmpwalk
Regards
Arun jyothi A S