Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi





Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Rabbit-Semi | Unable to get SNMP working with snmpwalk


Advertise Here

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

Unable to get SNMP working with snmpwalk - bobk2ut - Nov 6 18:39:25 2009

I'm using Dynamic C 10.54 and just re-installed to make sure I hadn't corrupted a file along the way. I have other IP based applications working perfectly, but seem unable to get anywhere with SNMP.

I started with the SNMP1.C sample program and added just enough #defines to work with my wireless network based on my other working IP programs. Added the MIB and SNMP debugging flags, built without errors, then ran...

[201 p=65535] 43.6.
[202 p=201 ] 1.4.1.12807.3.1.1.
[183 p=202 ] 1.
[198 p=183 ] 1.
[203 p=198 ] 0 r=03 w=02 [short] 1001
[199 p=183 ] 2.
[200 p=199 ] 0 r=03 w=02 [long] 1000002
[196 p=183 ] 3.
[197 p=196 ] 0 r=03 w=02 [foct == 20]
[194 p=183 ] 4.
[195 p=194 ] 0 r=03 w=02 [str <= 20] "rw_str"
[192 p=183 ] 5.
[193 p=192 ] 0 r=03 w=02 [oct <= 22]
[190 p=183 ] 6.
[191 p=190 ] 0 r=03 w=02 [oid] 43.6.1.4.1.12807.3.1.1.
[188 p=183 ] 7.
[189 p=188 ] 0 r=03 w=02 [long] 168429234
[186 p=183 ] 8.
[187 p=186 ] 0 r=03 w=02 [long] 63
[184 p=202 ] 2.
[180 p=184 ] 1.
[185 p=180 ] 0 r=03 w=00 [short] 2001
[181 p=184 ] 2.
[182 p=181 ] 0 r=03 w=00 [long] 2000002
[178 p=184 ] 3.
[179 p=178 ] 0 r=03 w=00 [foct == 20]
[176 p=184 ] 4.
[177 p=176 ] 0 r=03 w=00 [str <= 20] "r_str"
[174 p=184 ] 5.
[175 p=174 ] 0 r=03 w=00 [oct <= 22]
[172 p=184 ] 6.
[173 p=172 ] 0 r=03 w=00 [oid] 43.6.1.4.1.12807.3.1.1.
MIB tree: used 656 out of 4096 bytes
Network default interface up at IP=192.168.1.222 mask=255.255.255.0

Interface table:

# IP addr. Mask Up Type MTU Flags Peer/router
-- --------------- --------------- --- ----- ---- ------ ---------------
0 192.168.1.222 255.255.255.0 yes eth 1489 * 192.168.1.2

Router table:
# Flags Address i/f Net/preference Mask/exp(sec)
-- ----- ------------- --- --------------- ---------------
0 P 192.168.1.2 0 0.0.0.0 0.0.0.0
So far, so good. I try to collect the enterprises tree with snmpwalk:

$ snmpwalk -v 1 -c public 192.168.1.222 enterprise
Timeout: No Response from 192.168.1.222
On the Rabbit debug window are these...

SNMP: bad initial sequence
SNMP: bad initial sequence
SNMP: bad initial sequence
SNMP: bad initial sequence
SNMP: bad initial sequence
SNMP: bad initial sequence
SNMP: tt = 3000 tick_ref = 3000 ms_ref = 34013
So either I've got something configured incorrectly or am using snmpwalk incorrectly. Any ideas?

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )


Re: Unable to get SNMP working with snmpwalk - Bob Applegate - Nov 7 21:50:37 2009

Works under Dynamic C 10.50. Doing some debugging inside the snmp
library, my suspicion is that the assembly language routines aren't
correctly interfacing to the C code. Does 10.54 "optimize"
differently than 10.50? Haven't tried moving the snmp library from
10.50 to 10.54 but doubt that'll do anything. Oh well looks like I'm
stuck with 10.50 for now.

Hopefully this is fixed in 10.56.

Bob

On Nov 6, 2009, at 6:37 PM, bobk2ut wrote:

> I'm using Dynamic C 10.54 and just re-installed to make sure I
> hadn't corrupted a file along the way. I have other IP based
> applications working perfectly, but seem unable to get anywhere with
> SNMP.
>
> I started with the SNMP1.C sample program and added just enough
> #defines to work with my wireless network based on my other working
> IP programs. Added the MIB and SNMP debugging flags, built without
> errors, then ran...
>
> [201 p=65535] 43.6.
> [202 p=201 ] 1.4.1.12807.3.1.1.
> [183 p=202 ] 1.
> [198 p=183 ] 1.
> [203 p=198 ] 0 r=03 w=02 [short] 1001
> [199 p=183 ] 2.
> [200 p=199 ] 0 r=03 w=02 [long] 1000002
> [196 p=183 ] 3.
> [197 p=196 ] 0 r=03 w=02 [foct == 20]
> [194 p=183 ] 4.
> [195 p=194 ] 0 r=03 w=02 [str <= 20] "rw_str"
> [192 p=183 ] 5.
> [193 p=192 ] 0 r=03 w=02 [oct <= 22]
> [190 p=183 ] 6.
> [191 p=190 ] 0 r=03 w=02 [oid] 43.6.1.4.1.12807.3.1.1.
> [188 p=183 ] 7.
> [189 p=188 ] 0 r=03 w=02 [long] 168429234
> [186 p=183 ] 8.
> [187 p=186 ] 0 r=03 w=02 [long] 63
> [184 p=202 ] 2.
> [180 p=184 ] 1.
> [185 p=180 ] 0 r=03 w=00 [short] 2001
> [181 p=184 ] 2.
> [182 p=181 ] 0 r=03 w=00 [long] 2000002
> [178 p=184 ] 3.
> [179 p=178 ] 0 r=03 w=00 [foct == 20]
> [176 p=184 ] 4.
> [177 p=176 ] 0 r=03 w=00 [str <= 20] "r_str"
> [174 p=184 ] 5.
> [175 p=174 ] 0 r=03 w=00 [oct <= 22]
> [172 p=184 ] 6.
> [173 p=172 ] 0 r=03 w=00 [oid] 43.6.1.4.1.12807.3.1.1.
> MIB tree: used 656 out of 4096 bytes
> Network default interface up at IP=192.168.1.222 mask=255.255.255.0
>
> Interface table:
>
> # IP addr. Mask Up Type MTU Flags Peer/router
> -- --------------- --------------- --- ----- ---- ------
> ---------------
> 0 192.168.1.222 255.255.255.0 yes eth 1489 * 192.168.1.2
>
> Router table:
> # Flags Address i/f Net/preference Mask/exp(sec)
> -- ----- ------------- --- --------------- ---------------
> 0 P 192.168.1.2 0 0.0.0.0 0.0.0.0
>
> So far, so good. I try to collect the enterprises tree with snmpwalk:
>
> $ snmpwalk -v 1 -c public 192.168.1.222 enterprise
> Timeout: No Response from 192.168.1.222
>
> On the Rabbit debug window are these...
>
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: tt = 3000 tick_ref = 3000 ms_ref = 34013
>
> So either I've got something configured incorrectly or am using
> snmpwalk incorrectly. Any ideas?


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Unable to get SNMP working with snmpwalk - Dan Allen - Nov 7 22:31:18 2009

Try leaving off the "enterprise", i'm not 100% sure if it's enterprise, or
enterprises.

Secondly, the same exact code works on a different version of DC?

--Been there done that with some other libraries, you/we are at the mercy of
Rabbit unfortunately.
I'm "stuck" on 9.25 personally.

Dan...

On Sat, Nov 7, 2009 at 9:49 PM, Bob Applegate wrote:

> Works under Dynamic C 10.50. Doing some debugging inside the snmp library,
> my suspicion is that the assembly language routines aren't correctly
> interfacing to the C code. Does 10.54 "optimize" differently than 10.50?
> Haven't tried moving the snmp library from 10.50 to 10.54 but doubt that'll
> do anything. Oh well looks like I'm stuck with 10.50 for now.
>
> Hopefully this is fixed in 10.56.
>
> Bob
>
> On Nov 6, 2009, at 6:37 PM, bobk2ut wrote:
>
> I'm using Dynamic C 10.54 and just re-installed to make sure I hadn't
> corrupted a file along the way. I have other IP based applications working
> perfectly, but seem unable to get anywhere with SNMP.
>
> I started with the SNMP1.C sample program and added just enough #defines to
> work with my wireless network based on my other working IP programs. Added
> the MIB and SNMP debugging flags, built without errors, then ran...
>
> [201 p=65535] 43.6.
> [202 p=201 ] 1.4.1.12807.3.1.1.
> [183 p=202 ] 1.
> [198 p=183 ] 1.
> [203 p=198 ] 0 r=03 w=02 [short] 1001
> [199 p=183 ] 2.
> [200 p=199 ] 0 r=03 w=02 [long] 1000002
> [196 p=183 ] 3.
> [197 p=196 ] 0 r=03 w=02 [foct == 20]
> [194 p=183 ] 4.
> [195 p=194 ] 0 r=03 w=02 [str <= 20] "rw_str"
> [192 p=183 ] 5.
> [193 p=192 ] 0 r=03 w=02 [oct <= 22]
> [190 p=183 ] 6.
> [191 p=190 ] 0 r=03 w=02 [oid] 43.6.1.4.1.12807.3.1.1.
> [188 p=183 ] 7.
> [189 p=188 ] 0 r=03 w=02 [long] 168429234
> [186 p=183 ] 8.
> [187 p=186 ] 0 r=03 w=02 [long] 63
> [184 p=202 ] 2.
> [180 p=184 ] 1.
> [185 p=180 ] 0 r=03 w=00 [short] 2001
> [181 p=184 ] 2.
> [182 p=181 ] 0 r=03 w=00 [long] 2000002
> [178 p=184 ] 3.
> [179 p=178 ] 0 r=03 w=00 [foct == 20]
> [176 p=184 ] 4.
> [177 p=176 ] 0 r=03 w=00 [str <= 20] "r_str"
> [174 p=184 ] 5.
> [175 p=174 ] 0 r=03 w=00 [oct <= 22]
> [172 p=184 ] 6.
> [173 p=172 ] 0 r=03 w=00 [oid] 43.6.1.4.1.12807.3.1.1.
> MIB tree: used 656 out of 4096 bytes
> Network default interface up at IP=192.168.1.222 mask=255.255.255.0
>
> Interface table:
>
> # IP addr. Mask Up Type MTU Flags Peer/router
> -- --------------- --------------- --- ----- ---- ------ ---------------
> 0 192.168.1.222 255.255.255.0 yes eth 1489 * 192.168.1.2
>
> Router table:
> # Flags Address i/f Net/preference Mask/exp(sec)
> -- ----- ------------- --- --------------- ---------------
> 0 P 192.168.1.2 0 0.0.0.0 0.0.0.0
>
> So far, so good. I try to collect the enterprises tree with snmpwalk:
>
> $ snmpwalk -v 1 -c public 192.168.1.222 enterprise
> Timeout: No Response from 192.168.1.222
>
> On the Rabbit debug window are these...
>
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: bad initial sequence
> SNMP: tt = 3000 tick_ref = 3000 ms_ref = 34013
>
> So either I've got something configured incorrectly or am using snmpwalk
> incorrectly. Any ideas?
>
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Unable to get SNMP working with snmpwalk - Bob Applegate - Nov 8 7:48:56 2009

Hi Dan,

"enterprises" works; I think I pulled that from a page you produced
for someone last year to show the command and the expected results.
The documentation you've produced in the past was a huge help. I saw
you were using 9.25 which got me thinking about compiler versions.

I haven't run a diff on the sample application SNP1.C between the
10.54 and 10.50 directories to see if they are identical, so I need to
do that and also check the snmp library fro changes.

It would be easier to debug/fix if they had meaningful comments. I've
written code professionally for over 27 years and if I produced code
with so few comments it would surely be rejected at any code review.
The fact that Rabbit uses assembly language to implement libraries
that are traditionally written entirely in C (or other high level
languages) is a bit annoying too. I can see exactly which assembly
language function returns apparently incorrect data yet there is no
explanation of what it's supposed to do. I also noted that they show
the SNMP library works with 10.54... I guess "works" means it was able
to compile.

Now I've got to see if my http and other code written/tested with
10.54 works when I back-port to 10.50 :(

Bob
On Nov 7, 2009, at 10:30 PM, Dan Allen wrote:

> Try leaving off the "enterprise", i'm not 100% sure if it's
> enterprise, or enterprises.
>
> Secondly, the same exact code works on a different version of DC?
>
> --Been there done that with some other libraries, you/we are at the
> mercy of Rabbit unfortunately.
> I'm "stuck" on 9.25 personally.
>
> Dan...
> On Sat, Nov 7, 2009 at 9:49 PM, Bob Applegate
> wrote:
>
> Works under Dynamic C 10.50. Doing some debugging inside the snmp
> library, my suspicion is that the assembly language routines aren't
> correctly interfacing to the C code. Does 10.54 "optimize"
> differently than 10.50? Haven't tried moving the snmp library from
> 10.50 to 10.54 but doubt that'll do anything. Oh well looks like
> I'm stuck with 10.50 for now.
> Hopefully this is fixed in 10.56.
>
> Bob
>
> On Nov 6, 2009, at 6:37 PM, bobk2ut wrote:
>
>>
>> I'm using Dynamic C 10.54 and just re-installed to make sure I
>> hadn't corrupted a file along the way. I have other IP based
>> applications working perfectly, but seem unable to get anywhere
>> with SNMP.
>>
>> I started with the SNMP1.C sample program and added just enough
>> #defines to work with my wireless network based on my other working
>> IP programs. Added the MIB and SNMP debugging flags, built without
>> errors, then ran...
>>
>> [201 p=65535] 43.6.
>> [202 p=201 ] 1.4.1.12807.3.1.1.
>> [183 p=202 ] 1.
>> [198 p=183 ] 1.
>> [203 p=198 ] 0 r=03 w=02 [short] 1001
>> [199 p=183 ] 2.
>> [200 p=199 ] 0 r=03 w=02 [long] 1000002
>> [196 p=183 ] 3.
>> [197 p=196 ] 0 r=03 w=02 [foct == 20]
>> [194 p=183 ] 4.
>> [195 p=194 ] 0 r=03 w=02 [str <= 20] "rw_str"
>> [192 p=183 ] 5.
>> [193 p=192 ] 0 r=03 w=02 [oct <= 22]
>> [190 p=183 ] 6.
>> [191 p=190 ] 0 r=03 w=02 [oid] 43.6.1.4.1.12807.3.1.1.
>> [188 p=183 ] 7.
>> [189 p=188 ] 0 r=03 w=02 [long] 168429234
>> [186 p=183 ] 8.
>> [187 p=186 ] 0 r=03 w=02 [long] 63
>> [184 p=202 ] 2.
>> [180 p=184 ] 1.
>> [185 p=180 ] 0 r=03 w=00 [short] 2001
>> [181 p=184 ] 2.
>> [182 p=181 ] 0 r=03 w=00 [long] 2000002
>> [178 p=184 ] 3.
>> [179 p=178 ] 0 r=03 w=00 [foct == 20]
>> [176 p=184 ] 4.
>> [177 p=176 ] 0 r=03 w=00 [str <= 20] "r_str"
>> [174 p=184 ] 5.
>> [175 p=174 ] 0 r=03 w=00 [oct <= 22]
>> [172 p=184 ] 6.
>> [173 p=172 ] 0 r=03 w=00 [oid] 43.6.1.4.1.12807.3.1.1.
>> MIB tree: used 656 out of 4096 bytes
>> Network default interface up at IP=192.168.1.222 mask=255.255.255.0
>>
>> Interface table:
>>
>> # IP addr. Mask Up Type MTU Flags Peer/router
>> -- --------------- --------------- --- ----- ---- ------
>> ---------------
>> 0 192.168.1.222 255.255.255.0 yes eth 1489 * 192.168.1.2
>>
>> Router table:
>> # Flags Address i/f Net/preference Mask/exp(sec)
>> -- ----- ------------- --- --------------- ---------------
>> 0 P 192.168.1.2 0 0.0.0.0 0.0.0.0
>>
>> So far, so good. I try to collect the enterprises tree with snmpwalk:
>>
>> $ snmpwalk -v 1 -c public 192.168.1.222 enterprise
>> Timeout: No Response from 192.168.1.222
>>
>> On the Rabbit debug window are these...
>>
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: tt = 3000 tick_ref = 3000 ms_ref = 34013
>>
>> So either I've got something configured incorrectly or am using
>> snmpwalk incorrectly. Any ideas?
>>


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Unable to get SNMP working with snmpwalk - Bob Applegate - Nov 9 20:17:06 2009

PROBLEM FIXED!!!

Rabbit Tech Support found the problem. I've tested it with my app and
their sample SNMP1.C and it certainly works much better.

In Snmp.lib there is a function named _snmp_handler. Near the top is
a bit of assembly language code that needs to change to this:
// Compute segmented address from g->data2.
#asm
ld iy,(sp+@sp+g)
ld bcde,(iy+[ll_Gather]+data2) ; bcde = ll_Gather.data2
(char far *)
call dkcLongLogicalToPhysical ; bcde = 32-bit physical
address
ld hl,de
ld a, c ; ahl contains 24-bit
linear address
_LIN2SEG ; JK/HL is now segmented
address
ld (sp+@sp+start),hl ; xpc window address in
'start'
ex jk,hl
ld (_snmp+[snmp_globals]+xpcget),hl
#endasm

Save the file, rebuild your SNMP based application and it should work
with the 10.54 development tools. They're going to roll the fix into
a future version of the tools, but this is easy to fix for those of
you using 10.54. I haven't used 10.56 so can't speak for that. Note
that 10.50 works as-is, so this patch isn't needed there.

Thanks to Rabbit for the quick solution!

Bob
On Nov 7, 2009, at 9:49 PM, Bob Applegate wrote:

> Works under Dynamic C 10.50. Doing some debugging inside the snmp
> library, my suspicion is that the assembly language routines aren't
> correctly interfacing to the C code. Does 10.54 "optimize"
> differently than 10.50? Haven't tried moving the snmp library from
> 10.50 to 10.54 but doubt that'll do anything. Oh well looks like
> I'm stuck with 10.50 for now.
> Hopefully this is fixed in 10.56.
>
> Bob
>
> On Nov 6, 2009, at 6:37 PM, bobk2ut wrote:
>
>>
>> I'm using Dynamic C 10.54 and just re-installed to make sure I
>> hadn't corrupted a file along the way. I have other IP based
>> applications working perfectly, but seem unable to get anywhere
>> with SNMP.
>>
>> I started with the SNMP1.C sample program and added just enough
>> #defines to work with my wireless network based on my other working
>> IP programs. Added the MIB and SNMP debugging flags, built without
>> errors, then ran...
>>
>> [201 p=65535] 43.6.
>> [202 p=201 ] 1.4.1.12807.3.1.1.
>> [183 p=202 ] 1.
>> [198 p=183 ] 1.
>> [203 p=198 ] 0 r=03 w=02 [short] 1001
>> [199 p=183 ] 2.
>> [200 p=199 ] 0 r=03 w=02 [long] 1000002
>> [196 p=183 ] 3.
>> [197 p=196 ] 0 r=03 w=02 [foct == 20]
>> [194 p=183 ] 4.
>> [195 p=194 ] 0 r=03 w=02 [str <= 20] "rw_str"
>> [192 p=183 ] 5.
>> [193 p=192 ] 0 r=03 w=02 [oct <= 22]
>> [190 p=183 ] 6.
>> [191 p=190 ] 0 r=03 w=02 [oid] 43.6.1.4.1.12807.3.1.1.
>> [188 p=183 ] 7.
>> [189 p=188 ] 0 r=03 w=02 [long] 168429234
>> [186 p=183 ] 8.
>> [187 p=186 ] 0 r=03 w=02 [long] 63
>> [184 p=202 ] 2.
>> [180 p=184 ] 1.
>> [185 p=180 ] 0 r=03 w=00 [short] 2001
>> [181 p=184 ] 2.
>> [182 p=181 ] 0 r=03 w=00 [long] 2000002
>> [178 p=184 ] 3.
>> [179 p=178 ] 0 r=03 w=00 [foct == 20]
>> [176 p=184 ] 4.
>> [177 p=176 ] 0 r=03 w=00 [str <= 20] "r_str"
>> [174 p=184 ] 5.
>> [175 p=174 ] 0 r=03 w=00 [oct <= 22]
>> [172 p=184 ] 6.
>> [173 p=172 ] 0 r=03 w=00 [oid] 43.6.1.4.1.12807.3.1.1.
>> MIB tree: used 656 out of 4096 bytes
>> Network default interface up at IP=192.168.1.222 mask=255.255.255.0
>>
>> Interface table:
>>
>> # IP addr. Mask Up Type MTU Flags Peer/router
>> -- --------------- --------------- --- ----- ---- ------
>> ---------------
>> 0 192.168.1.222 255.255.255.0 yes eth 1489 * 192.168.1.2
>>
>> Router table:
>> # Flags Address i/f Net/preference Mask/exp(sec)
>> -- ----- ------------- --- --------------- ---------------
>> 0 P 192.168.1.2 0 0.0.0.0 0.0.0.0
>>
>> So far, so good. I try to collect the enterprises tree with snmpwalk:
>>
>> $ snmpwalk -v 1 -c public 192.168.1.222 enterprise
>> Timeout: No Response from 192.168.1.222
>>
>> On the Rabbit debug window are these...
>>
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: bad initial sequence
>> SNMP: tt = 3000 tick_ref = 3000 ms_ref = 34013
>>
>> So either I've got something configured incorrectly or am using
>> snmpwalk incorrectly. Any ideas?
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )