Translations:Wb-mqtt-serial driver/13/en: различия между версиями

Материал из Wiren Board
(Новая страница: «To run the driver, edit the <code>/etc/wb-mqtt-serial.conf</code> file. An ordinary user can use the RS-485 method:RS-485:Настройка через веб-…»)
 
м (FuzzyBot переименовал страницу Translations:Драйвер wb-mqtt-serial/13/en в Translations:Wb-mqtt-serial driver/13/en без оставления перенаправления: Часть переводимой страницы Драйвер wb-mqtt-serial.)
 
(нет различий)

Текущая версия на 13:55, 28 января 2021

Определение сообщения (Wb-mqtt-serial driver)
Для работы драйвера нужно отредактировать файл <code>/etc/wb-mqtt-serial.conf</code>. Обычный пользователь может воспользоваться способом [[RS-485:Настройка через веб-интерфейс|RS-485:Настройка через веб-интерфейс]], который тоже приводит к правильному заполнению файла конфигурации. Однако отредактировать файл можно и вручную, для этого:
#Ознакомьтесь с инструкцией [[Special:MyLanguage/Просмотр файлов контроллера с компьютера|Просмотр файлов контроллера с компьютера]]
#Файл <code>/etc/wb-mqtt-serial.conf</code> имеет структуру ''порты (ports) -> устройства (devices)'': в файле есть описания физических портов контроллера, а внутри них - список устройств, которые подключены к этому порту.
#:Для каждого порта указываются настройки (скорость, чётность и т.п.), а также протокол (Modbus, RTU, etc.)
#:Для каждого устройства обязательно указывается его уникальный адрес на шине - ''slave_id''. Также можно указать другие необязательные параметры - смотрите полное описание формата [https://github.com/contactless/wb-homa-drivers/tree/master/wb-mqtt-serial в описании драйвера на нашем Github].
#Впишите конфигурацию для портов и подключённых устройств в файл, используя примеры ниже.
#Перезагрузите устройство ИЛИ выполните из консоли команду
#: <syntaxhighlight lang="bash">
service wb-mqtt-serial restart
</syntaxhighlight>
#:Она перезапустит драйвер, и подключённое устройство появится в веб-интерфейсе.
#Если устройство не появилось, выполните команду <syntaxhighlight lang="bash">tail /var/log/messages</syntaxhighlight> или откройте файл <code>/var/log/messages</code> и промотайте его до конца. Если там будет строчка такого типа:
#:<code>May  6 17:50:58 wirenboard user.notice modbus: FATAL: Error parsing config file: Failed to parse JSON: * Line <b>15</b>, Column 17</code>
#:- ищите ошибку в 15-й строке конфигурационного файла.

To run the driver, edit the /etc/wb-mqtt-serial.conf file. An ordinary user can use the RS-485 method:RS-485:configuration via the web interface, which also leads to the correct filling of the configuration file. However, you can edit the file manually. To do this:

  1. Read the instructionsHow to view controller files from your computer
  2. File /etc/wb-mqtt-serial.conf has the structure ports -> devices: there are descriptions of the physical ports of the controller in the file, and inside them there is a list of devices that are connected to this port.
    Settings (speed, parity, etc.) and protocol (Modbus, RTU, etc.) are specified for each port.
    Each device must have its unique address on the bus - slave_id. You can also specify other optional parameters - see the full description of the format in the driver description on our Github.
  3. Enter the configuration for the ports and connected devices in the file using the examples below.
  4. Restart the device OR run the command from the console
    service wb-mqtt-serial restart
    
    It will restart the driver and the connected device will appear in the web interface.
  5. If the device does not appear, run the following command
    tail /var/log/messages
    
    or open file /var/log/messages and scroll to the end. If there is a line like this one:
    May 6 17:50:58 wirenboard user.notice modbus: FATAL: Error parsing config file: Failed to parse JSON: * Line 15, Column 17
    - look for the error in the 15th line of the configuration file.