uClinux on LPC1788: how to useSNMP for remote management of embedded device

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by Vladimir Khusainov on Fri Feb 03 08:02:29 MST 2012
Here is a sample session showing some basic uses of SNMP for remote management of an LPC1788-based device. This session was run under uClinux on an Embedded Artist's LPC1788 board.

After reset, U-boot comes up from embedded Flash and proceeds to boot uClinux onto the board:

U-Boot 2010.03-linux-cortexm-1.4.0 (Feb 03 2012 - 17:57:09)

CPU  : LPC178x/7x series (Cortex-M3)
Board: EA-LPC1788 rev 1
DRAM:  32 MB
Flash:  4 MB
Starting kernel ...

Linux version 2.6.33-arm1 (psl@ocean.emcraft.com) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #4 Fri Feb 3 18:27:11 MSK 2012
init started: BusyBox v1.17.0 (2012-02-03 17:58:32 MSK)
~ #

From the shell prompt on the target, I start an SNMP agent:

~ # snmpd -C -c /etc/snmpd.conf -Le -fNET-SNMP version 5.6.1

Now, I am able to query my LPC1788 device remotely using standard SNMP tools. For instance,  here is how this is done from a Linux PC box:

[psl@ocean LPC]$ snmpget -v1 -c public .
SNMPv2-MIB::sysDescr.0 = STRING: Linux ea-lpc1788 2.6.33-arm1 #4 Fri Feb 3 18:27:11 MSK 2012 armv7ml

Back to the target, here is how I send a trap event to remote management tools:

~ # snmptrap -v 1 -c public '' '' 6 99 '55' s "I'm here"

When I check SNMP traps on the host, the trap from LPC1788 is reported as appropriate:

[root@pvr psl]# snmptrapd -C -c /home/work/psl/SF/release/snmptrapd.conf -Le -fNET-SNMP version 5.5
2012-02-03 18:35:08 UDP: []:55085->[]) TRAP, SNMP v1, community public
iso. Enterprise Specific Trap (99) Uptime: 0:00:00.05
iso. = STRING: "I'm here"

More info on how SNMP can be used with uClinux running on Cortex-M is available from documentation on www.emcraft.com