12 063
правки
(Новая страница: «=== Adding devices ===») |
|||
(не показано 13 промежуточных версий этого же участника) | |||
Строка 2: | Строка 2: | ||
{{DISPLAYTITLE:Начальное конфигурирование устройств через web-интерфейс}} | {{DISPLAYTITLE:Начальное конфигурирование устройств через web-интерфейс}} | ||
For general information on connecting RS-485 devices to the controller, see page [[ | For general information on connecting RS-485 devices to the controller, see page [[RS-485/en|RS-485]]. | ||
Строка 19: | Строка 19: | ||
=== Adding devices === | === Adding devices === | ||
Go to ''List of devices'' below. Press the ''+ Serial Device'' button to add a device. Select the type of device (usually corresponds to the model of the device) and specify its address (usually indicated by the documentation for the device, for devices of our production is indicated on the body label in decimal format): [[File:modbus_address_mr14.png|400px|thumb|center|Modbus-address, set by default]] The device address is specified either in hexadecimal (starts with 0x..), or in decimal (as a normal number). Then be sure to click the blue ''Save'' button at the top of the page.[[File:rs-485-setup-device-settings.png|thumb|center|500 px|The device type [[WB-MRM2/en |WB-MRM2]] WB-MRM2 is selected and the decimal address ''130'' is set ]] | |||
=== | === Checking the operation === | ||
To check the operation of the device, go to the ''Devices'' page. It should display the unit corresponding to the connected device. In our example,a block ''WB-MRM2 130'' appeared (template name - DEVICE_TYPE_ADDRESS) with two buttons to control the relay, two input indicators for buttons and push counters. You can press the button - the relay on the connected device will switch. | |||
[[File:rs-485-setup-device-connected.png|thumb|center|500 px|The display of the connected [[Special:MyLanguage/WB-MRM2|WB-MRM2]] device with a ''130'' address on the ''Devices'' page. You can press buttons and control the relay on the device]] | |||
=== | === Adding a widget === | ||
''' | '''For web interface version 1.x''' | ||
To add a control button to the ''Home page'' and name it according to its purpose (for example, ''The light in the corridor''), you need to create a widget. To do this, go to the ''Widgets'' page and click the green ''add widget'' button. Then you need to enter the widget parameters: the name (as it is called in the interface), the room (the group to which the widget is attached; used to organize when there are many widgets - if not enough, you can choose any), and the type of widget - in our case, the relay controls the lighting, so choose ''Light Control Relay''. After that, there is another option - you need to choose which device corresponds to the widget. All available devices of the selected type are shown in the list, their names are given in accordance with the terminology of [[MQTT|MQTT]]. At the end, click ''Submit'' - the new widget will appear on the ''Widgets'' page. | |||
[[File:rs-485-setup-add-widget.png|thumb|center|500 px|Creating a light control widget based on Relay 1 of the connected [[Special:MyLanguage/WB-MRM2|WB-MRM2]] device]] | |||
=== | === Additional device settings === | ||
Additional device parameters can be set via the ''Properties'' button. Additional device configuration fields can be displayed in the drop-down menu. | |||
[[File:Web-Interface-Device-Props.png|thumb|center|700 px| | [[File:Web-Interface-Device-Props.png|thumb|center|700 px| Configuring the display of additional parameters]] | ||
The setup section (List of setup commands) is used to initialize certain device registers before operation. As an example, write the value 0 in the holding register of the WB-MR14 relay module to set the button control mode without locking for all inputs of the module. Click on the ''Properties'' button and select The list of setup commands checkbox. Click the ''Properties'' button again to hide the drop-down list.[[File:Setup-section.png|800px|thumb|center|Add 'setup' partition of the device]] | |||
Press the ''Save'' button and make sure that the module operates in the control mode of push-button switches. The device will have A list of setup commands section. Press the ''+Setup command'' button and proceed to creating the setup command. We need to specify the command name, the number of the Modbus register and the triggering value. '''Setup-initialization is performed once after the driver is loaded'''.[[Файл:Setup_commands_list.png|600px|thumb|center|Adding setup-partition of the device]] | |||
=== | === Setting the polling period === | ||
The driver ([[https://github.com/contactless/wb-homa-drivers/tree/master/wb-mqtt-serial wb-mqtt-serial|https://github.com/contactless/wb-homa-drivers/tree/master/wb-mqtt-serial wb-mqtt-serial]]) allows you to determine what speed certain channels of the device will be polled at. This parameter is called Desired poll interval and is specified in milliseconds. Common to all the polling interval is specified by the Desired poll interval in the configuration of the port. If you do not override this setting in other devices or other channels, this value will be used for each channel. If the polling rate is set for a particular device, then it will be used for all channels of this device, again, if a channel does not have its own polling interval. The priority of intervals looks like this: channel-> device -> port. For example, if we have multiple relay module inputs that are time-critical, we can set a minimum interval of 1 MS for them. By default, there is no field in the web interface to change this property -- it must be added. First, we specify the channel whose property we want to override by clicking the ''+Item button''. The control name and address can be found in the device template file [[Файл:Channel_name_address.png|400px|thumb|left|The fragment of the detailed description of the device channel from the template file in the directory /usr/share/wb-mqtt-serial/templates]] In the 'Control name' field we substitute the value of the variable "name", Address -- "address". This way we fill in fields Control type and Register type. [[Файл:Channel_props_poll.png|400px|thumb|center|Add the polling interval property for the device channel]] Click on the Properties button of the corresponding channel and put a check mark in the Desired poll interval (ms), as shown in the figure. The result is the following set of fields: [[Файл:Channel_settings.png|600px|thumb|center|A set of fields that define the properties of a particular channel. The Desired poll interval (ms) field defines the interval between two parameter polls]] | |||
To save, click the Save button at the top of the page. | |||
правки