Skip to main content

iRidi for SNMP

Tools for creating a visualization interface

The driver is designed to control equipment using the SNMP v1 protocol.

Tip

**Example: *iRidi SNMP Driver

Description

iRidi for SNMP is a set of tools for creating a home or office control interface based on equipment using the SNMP v.1 protocol. It implements SNMP protocol commands to change device settings

SNMP lets you receive event notifications from various devices, such as:

  • sensors;
  • video cameras;
  • routers.
Note

This driver does not support the "Get Next" command. If feedback contains multiple OIDs, specify the required one in the "OID" field.

To identify the required OID for device parameters, use iReasoning MIB Browser.

Find the device manufacturer's MIB table for the browser, or use Trap Receiver to monitor incoming OIDs.

Use cases​

  1. Configure an event when a device joins the network. When someone enters the Wi-Fi network's coverage area, their device joins the network, and a preconfigured router sends an SNMP notification to iRidium, where a routine runs. This routine helps detect a device joining the network when you cannot ping it (for example, an iOS device).

  2. When a video camera (or any other sensor) detects motion, it sends a message to iRidium. You can then configure the project to send an "Intruder in the room" push notification to a phone.

  3. Analyze changes in outdoor temperature or a device's temperature sensor readings. Create your own database of readings from a sensor that sends temperature over SNMP, and plot a trend (detailed instructions are available here). Monitor changes or create a notification event.

Connection​

Equipment setup​

  1. Open your equipment settings and select the SNMP v1 protocol. 2. Specify SNMP Port (161 by default), which is required to receive requests.
  2. Specify the trap-port (162 by default), which the device uses to send SNMP traps.
  3. Specify the read community (public by default).
  4. Specify the write community (private by default).
  5. Specify the trap address: the IP address of the device running the driver, to which traps will be sent upon a request or an event on the device (sensor, router, or camera).
Important

Warning! For security, change the "Community" parameter from public to a more complex value in both the project and the devices.

Activecam camera setup example

  1. Configure SNMP on the Activecam camera.

SNMP_Camera_setting.png

  1. Configure trap packet generation: the event that triggers sending a packet to our driver.

SNMP_Camera_2.png

You can add the SNMP driver by importing a CSV file or entering the data manually.

Importing a CSV file (*.csv)​

Universal import from CSV File lets you import drivers from a table in CSV format.

For detailed instructions on creating a CSV file and importing it into iRidi Studio, follow this link.

Adding the driver manually​

Add the SNMP driver to the project from the iRidi database:

  1. Start iRidi Studio and create a new iRidi project
  2. Open the Devices side panel and select the SNMP driver.

SNMP1.png

Specify the controller address in the iRidi project; otherwise, it will not work.

Configuring connection parameters​

Configure connection settings after adding the driver.

Set_driver_22.png

  • Host - the device's IP address.
  • Port - the device connection port for sending data (161 by default; the driver sends requests to the agent).
  • Local Port - the device connection port for receiving data (162 by default; the agent sends a response to the driver).
Note

Two drivers in one project must have different Local Port values.

  • Request tags at start - poll at startup (true/false).
  • Interval between tag polls - the interval between tag polls. After an unsuccessful poll, the driver switches to polling another tag.
  • Maximum number of tag polls - the number of attempts to poll each tag.

Commands & Feedbacks​

Bind commands and feedback channels to graphical items to control the equipment:

  • Bind a command to a graphical item.
  • Bind a feedback channel to a graphical item to display the variable's state

To link a command or channel to a graphic item, use drag&drop - dragging an object onto another.

To send a command, drag it onto a graphical item. To display feedback, drag the channel onto a graphical item and specify where to display its Value:

SendValue.png

Configuring Commands and Feedbacks​

To configure a command, set the following fields:

  • OID - the numeric object identifier;
  • Type - the command/feedback type;
  • Value Type - the value type;
  • Community - a string specifying community membership, similar to a password.

To configure feedback, set the following fields:

  • OID - the numeric object identifier.
  • Get - a command to request data from the device:
  • Value - feedback that returns the requested value;
  • Trap - event feedback, triggered when something happens.
  • Community - a string specifying community membership, similar to a password.

Example of requesting values:


var device = IR.GetDevice("SNMP");
function get_feedback() // отправка единицы в команду с типом Get (запросить значение).
{
device.Set("getsysUpTime", 1);
IR.Log("request value after 32");
}

IR.SetTimeout(32000, get_feedback); // выполнить функцию через 32 секунды.

Note

The command and feedback must use the same OID, with command type Get and feedback type Value.

Example of subscribing to tag value changes:


IR.AddListener(IR.EVENT_TAG_CHANGE, device, function (n,v) {
IR.Log("EVENT_TAG_CHANGE " + n + " " + v);
});

Note

Feedback type: Trap.

Value Types

TypeDescription
IntegerInteger
StringString
NullA variable with no value (zero)
OIDObject identifier
IP4IP address
CounterA counter: a nonnegative integer that increases monotonically from 0 to 2^32-1, then returns to 0
TimeA counter that measures time in hundredths of a second from a starting point