Эта страница является
переводом страницы
SNMP. Перевод выполнен на 100%.
iRidium for SNMP
a set of tools to create a visualization interface
The driver is developed to control equipment working via SNMP v1 protocol.
Description
iRidium for SNMP is a set of tools to create an interface to control Smart home or office on the basis ofequipement working via SNMP v.1 protocol. It realizes commands of SNMP protocol to change device settings.
The SNMP protocol allows you to get feedback from various devices, such as:
- sensors;
- video cameras;
- routers.
The driver does not support the "Get Next" command.
If several OIDs are received as feedback, indicate the required one in the "OID" field.
To determine the required OID with device parameters, use iReasoning MIB Browser.
Find the MIB table prepared by the device manufacturer for the browser or use the Trap Receiver to track incoming OIDs.
Variants of use
1. Event setting when registering in the device network. Anyone who enters the wi-fi network coverage area is registered in the network and a pre-configured router sends an SNMP notification to iRidium, where the script is already being processed. This scenario will help to determine when the device that you cannot ping appeared in the network (for example, devices running on iOS).
2. When a video camera (or any other sensor) is activated by motion, it sends a message to iRidium. Then you can set up the push notification “Outsider in the room” in the project and it will be sent to the phone.
3. Analysis of changes in weather temperature and heat sensor on the device. Create your own base with values of the sensor, which sends the temperature using the SNMP protocol, draw the trend of the changes (detailed information on trend creation is here). Track the changes or create an alert event.
Connection
Setting Equipment
1. Go to the settings of your equipment and select the SNMP v1 protocol.
2. Enter the SNMP Port (by default it is 161). It is required for receiving requests.
3.Enter the trap-port (by default it is 162). The device will use it to send SNMP trap.
4. Enter the group to read (it is 'public' by default).
5. Enter the group to write (it is "private" by default).
6. Enter the trap address. IP devices with the driver to which trap will be sent at request or when a device (sensor, router, camera) is triggered.
Attention! For security reasons, change the "Community" parameter from "public" to more complicated in the project and on devices.
Example of setting Activecam camera
1. Set up SNMP on the Activecam camera.
2. Set generation of the trap-package, the event at which a sending to our driver will occur.
You can add an SNMP driver by importing from a CSV file or manually filling in the data.
Import from a CSV file (*.csv)
Universal import from CSV File is the ability to import drivers from a table presented in CSV format.
You can read more about detailed instructions on creating a CSV file and importing it into IRidium Studio here.
Adding Driver Manually
Add SNMP driver to your project from iRidium database
- Launch iRidium studio and create a new project.
- Open the Devices sidebar and select the SNMP driver.
Enter the controller address in iRidium project otherwise it will not work.
Setting connection parameters
When the driver is added to a project, enter connection settings.
- Host - Controller IP-address
- Port - connection port to send data (it is 161 by default, the driver send requests to the agent).
- LocalPort - connection port to receive data (it is 162 by default, the agent send response to the driver).
If there are two drivers in the project, LocalPort must be different.
- Request tags at start - request at start (true/false).
- Interval between tag polls - an interval between tag requests. After a failure request a driver switched to a request of another type.
- Maximum number of tag polls - number of request attempts of each tag.
Commands & Feedbacks
Assign commands and feedback channels to graphic items:
- A command is assigned to a graphic item to send a value to a device.
- A feedback channel is assigned to a graphic item, to display the status of the variable
To assign a command or a channel to a graphic item use the drag&drop method.
To send a command, drag'n'drop it on a graphic item. To display feedback drag'n'drop a feedback channel on a graphic item and select where to display Value:
Setting Commands and Feedbacks
To send a conmmand or a feedback channel, set the following fields:
- OID - object identifier;
- Type - type of command/feedback;
- Value Type - type of value;
- Community - sequence of symbols, describing belonging to a group, a sort of password.
To set a feedback channel, fill in the following fields:
- OID - object identifier.
- Get - a command to request data from a device:
- Value - feedback that returns a requested value;
- Trap - event feedback, it is activated when something happens.
- Community - sequence of symbols, describing belonging to a group, a sort of password.
Example of value request:
var device = IR.GetDevice("SNMP");
function get_feedback() // send 1 to a command of Get type (request a value)
{
device.Set("getsysUpTime", 1);
IR.Log("request value after 32");
}
IR.SetTimeout(32000, get_feedback); // do a function in 32 seconds.
Command and feedback must be written in one OID,
type of command: Get, type of feedback: Value.
Example of subscription to changes in tags:
IR.AddListener(IR.EVENT_TAG_CHANGE, device, function (n,v) {
IR.Log("EVENT_TAG_CHANGE " + n + " " + v);
});
Type of feedback: Trap.
Value Types
| type |
description
|
| Integer |
Integer number
|
| String |
String
|
| Null |
Variable without value (zero)
|
| OID |
Object ID
|
| IP4 |
IP-address
|
| Counter |
Counter is a nonnegative integer, its value gradually increases from 0 to 232-1 and then goes back to 0
|
| Time |
Counter that keeps track of time in centisecond from a starting point .
|