What happens if you do a SNMP GET on that single OID? (.1.3.6.1.2.1.1.5.0) The app note also mentions updating SNMPGetNextIndex for dynamic variables. "Make corresponding changes in the SNMPGetVar(), SNMPGetNextIndex() and SNMPSetVar() callback functions to accommodate these new dynamic or sequence variable IDs. Map them to the respective variable=92s RAM value." On 5/25/2011 10:44 AM, Harold Hallikainen wrote: > I'm just getting started with snmp. I've got the Microchip code in my > application and can do snmpwalk to see everything. > > So, I modified snmp.mib so say: > > ***********************************************************************= ***** > * MIB-2 SYSTEM MIB > ***********************************************************************= ***** > $DeclareVar(SYS_NAME, ASCII_STRING, SINGLE, READONLY, 43.6.1.2.1.1.5) > //$StaticVar(SYS_NAME, Microchip) > $DynamicVar(SYS_NAME, 0) > > > > > I then ran > > mib2bib -I=3D..\ /q /b=3D..\WebPages\ snmp.mib > > > > to create > Output BIB File: ProjectDirectory\WebPages\snmp.bib > Output Inc File: ProjectDirecotry\mib.h > > I then ran the MPFS Generator to put snmp.bib in the file system. > > I modified CustomSnmpApp.c to add this : > > BOOL SNMPGetVar(SNMP_ID var, SNMP_INDEX index, BYTE* ref, SNMP_VAL* val= ) > { > BYTE myRef; > DWORD_VAL dwvHigh, dwvLow; > DWORD dw; > DWORD dw10msTicks; > > myRef =3D *ref; > > switch(var){ > ... > case SYS_NAME: > val->byte=3DModelString[myRef++]; // send next byte of string > if(ModelString[myRef]=3D=3D0) myRef=3DSNMP_END_OF_VAR; // end of = string, > mark it > *ref=3DmyRef; > return TRUE; > break; > > > > > > When I run snmpwalk, I get this: > > snmpwalk -v 1 -c public 192.168.1.159 .iso > SNMPv2-MIB::sysDescr.0 =3D STRING: PIC > SNMPv2-MIB::sysObjectID.0 =3D OID: SNMPv2-SMI::enterprises.17095 > DISMAN-EVENT-MIB::sysUpTimeInstance =3D Timeticks: (2384) 0:00:23.84 > SNMPv2-MIB::sysContact.0 =3D STRING: admin > SNMPv2-MIB::sysName.0 =3D STRING: office > SNMPv2-MIB::sysLocation.0 =3D STRING: office > SNMPv2-MIB::sysServices.0 =3D INTEGER: 7 > SNMPv2-SMI::enterprises.17095.1.1.0 =3D STRING: "SNMPv2c Agent" > SNMPv2-SMI::enterprises.17095.1.2.0 =3D STRING: "v5.20" > SNMPv2-SMI::enterprises.17095.1.3.0 =3D STRING: "Apr 2009" > SNMPv2-SMI::enterprises.17095.2.1.1.1.0 =3D INTEGER: 0 > SNMPv2-SMI::enterprises.17095.2.1.1.1.1 =3D INTEGER: 1 > SNMPv2-SMI::enterprises.17095.2.1.1.2.0 =3D INTEGER: 0 > SNMPv2-SMI::enterprises.17095.2.1.1.2.1 =3D INTEGER: 0 > SNMPv2-SMI::enterprises.17095.2.1.1.3.0 =3D IpAddress: 0.0.0.0 > SNMPv2-SMI::enterprises.17095.2.1.1.3.1 =3D IpAddress: 0.0.0.0 > SNMPv2-SMI::enterprises.17095.2.1.1.4.0 =3D Hex-STRING: 00 > SNMPv2-SMI::enterprises.17095.2.1.1.4.1 =3D Hex-STRING: 00 > SNMPv2-SMI::enterprises.17095.3.1.0 =3D INTEGER: 0 > SNMPv2-SMI::enterprises.17095.3.2.0 =3D INTEGER: 0 > SNMPv2-SMI::enterprises.17095.3.3.0 =3D INTEGER: 0 > SNMPv2-SMI::enterprises.17095.3.4.0 =3D INTEGER: 0 > End of MIB > > > > > sysName picked up sysLocation instead of sending ModelString. When I set = a > breakpoint after case SYS_NAME:, it never gets hit. > > So... clearly I'm doing something wrong! Can anyone tell what it is based > on the description I've given? > > THANKS! > > > Harold > > > =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .