crcorrea / agentuino

Automatically exported from code.google.com/p/agentuino
0 stars 0 forks source link

Community string check fails #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In SNMP example i've changed 
api_status = Agentuino.begin();
to
api_status = Agentuino.begin("com1","com2",161);

After that, for example:
c:\usr\bin>snmpget -v 1 -c com1 192.168.1.177 1.3.6.1.2.1.1.6.0
SNMPv2-MIB::sysLocation.0 = STRING: Nova Scotia, CA

c:\usr\bin>snmpget -v 1 -c commm 192.168.1.177 1.3.6.1.2.1.1.6.0
Timeout: No Response from 192.168.1.177.

And in serial monitor it looks like this:
SNMP Agent Initalized...
UDP Packet Received Start.. RAM:6701
sysLocation...Nova Scotia, CA 15
UDP €WUýü

And arduino totally hangs up. How can I fix that?

Original issue reported on code.google.com by dimvas2...@gmail.com on 1 Nov 2012 at 5:32

GoogleCodeExporter commented 8 years ago
The error is on line number 76 in Agent.pde

The correct syntax is:

  if ( (pdu.type == SNMP_PDU_GET || pdu.type == SNMP_PDU_GET_NEXT || pdu.type == SNMP_PDU_SET)
    && pdu.error == SNMP_ERR_NO_ERROR && api_status == SNMP_API_STAT_SUCCESS ) {

Original comment by petr.dom...@gmail.com on 27 Jul 2013 at 8:46