lpcware

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:

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

CPU  : LPC178x/7x series (Cortex-M3)
Freqs: SYSTICK=108MHz,EMCCLK=54MHz,PCLK=54MHz
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)
~ #
</code>

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

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

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:

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

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

<code>
~ # snmptrap -v 1 -c public 172.17.0.212 '1.2.3.4.5.6' '192.193.194.195' 6 99 '55' 1.11.12.13.14.15 s "I'm here"
</code>

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

<code>
[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 192.193.194.195(via UDP: [172.17.3.109]:55085->[172.17.0.212]) TRAP, SNMP v1, community public
iso.2.3.4.5.6 Enterprise Specific Trap (99) Uptime: 0:00:00.05
iso.11.12.13.14.15 = STRING: "I'm here"
</code>

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

Outcomes