Arduino SNMP MIB

I just recently started playing around with Arduino boards and software. I found some work that had been done on Ethernet and SNMP (Agentuino). There was also a registered enterprise OID for Arduino but I could not find a MIB.

Attached is a first attempt of defining a MIB for simple access of the pins together with a modification of the Agentuino SNMP agent demo to show how it could be used. I have been using this with the MIB Browser from iReasoning Free MIB Browser / MIB Browser / SNMP Browser..

Please note that the demo does not implement all objects and the MIB is not complete.

I hope this may spawn a discussion of an extendable SNMP MIB for Arduino so that standard software for monitoring may be used for simple applications (eg temperature, on-off/open-closed state and other sensors).

Best regards, Mikael

Arduino.mib (4.61 KB)

Agent.ino (5 KB)

Just what i am looking for. Good work, please keep it up.

Where can I get the latest agentunio snmp agent code?

Thanks

Simon

Had a quick look and it is definitely a very good start.

A brain dump to get you busy for some hours :slight_smile:

What is missing is the type Arduino, is it an UNO, a DUE

ArduinoType OBJECT-TYPE
    SYNTAX OCTET STRING (SIZE(10))  // UNO GUE, TEENSY, LEONARDO, ...
    ACCESS read-only
    STATUS current
    DESCRIPTION "Arduino Type"
    ::= { system x }

They can have more RAM.

sysFreeMem OBJECT-TYPE
    SYNTAX INTEGER(0..32767)
    ACCESS read-only
    STATUS current
    DESCRIPTION "Free system memory [color=red]in KB[/color]"
    ::= { system 3 }

sysClockspeed ::= { system.4 }

system.sysEEPROM ::= { arduinoMIB.xxx }

arduinoMIB.experimental ::= { arduinoMIB.xxx } // always useful for people who want to experiment.

split OBJECT IDENTIFIER ::= { arduinoMIB 3 } in 2 :
ADC OBJECT IDENTIFIER ::= { arduinoMIB 3}
DIO OBJECT IDENTIFIER ::= { arduinoMIB 4}
DAC OBJECT IDENTIFIER ::= { arduinoMIB 5}

Better make an Array of it (does Argentuino support arrays??)

something like this:

ADC OBJECT IDENTIFIER ::= { arduinoMIB 3 }

ADCTable OBJECT-TYPE
    SYNTAX     SEQUENCE OF analogPin
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
        "A table of the analog pins"
    ::= { ADC 1 }

analogPin OBJECT-TYPE
    SYNTAX     analogPin
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
        ""
    INDEX  {analogPinIndex}
    ::= { analogPinTable 1 }

analogPin ::= SEQUENCE {
    analogPinIndex INTEGER,
    analogPinMaxValue INTEGER,   // or #bits ?
    analogPinCurValue INTEGER
    // register settings ...
}

Similar for digital IO - the advantage of 2 arrays is that you can number them independently

Note that the digital pins should include the analog ones. BTW an Arduino UNO has 8 analog pins

Furthermore you can add

These are ArduinoMib.communication or so?

  • serial ports (type HW/SW, pins, baudrate, )

  • SPI (...)

  • I2C (....)

  • Timers (settings)

arduinoMIB.sketch ::= { arduinoMIB.xxx } // should be an array to be prepared for multitasking!
-- name
-- date installed / written whatever
-- uptime

arduinoMIB.shield ::= { arduinoMIB.xxx } // should be an array to be prepared [don't know if possible]
-- name

Well... I think it's important to define a standard, and for future use I'd do something like .3 goes to analog, 3.1 analog 0 and .4 goes to digital. This way it would be easier to expand the MIB's to Mega 2560 and arduino due.