Rule Examples/en: различия между версиями

Новая страница: «When you turn on the switch a command will be sent: (Set Brightness ch. 00=0xff) for Uniel UCH-M141: <pre> FF FF 0A 01 FF 00 00 0A </pre>»
(Новая страница: «1. Port setting»)
(Новая страница: «When you turn on the switch a command will be sent: (Set Brightness ch. 00=0xff) for Uniel UCH-M141: <pre> FF FF 0A 01 FF 00 00 0A </pre>»)
Строка 676: Строка 676:
1. Port setting  
1. Port setting  


<div lang="ru" dir="ltr" class="mw-content-ltr">
To configure the / dev/ttyNSC0 port to 9600 speed, run the following command
Для настройки порта /dev/ttyNSC0 на скорость 9600 надо выполнить следующую команду
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<pre>
<pre>
stty -F /dev/ttyNSC0 ospeed 9600 ispeed 9600 raw clocal -crtscts -parenb -echo cs8
stty -F /dev/ttyNSC0 ospeed 9600 ispeed 9600 raw clocal -crtscts -parenb -echo cs8
</pre>
</pre>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
2. Sending a command
2. Отправка команды
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
Sending data is done with the following shell command:
Отправка данных делается следующей шелл-командой:
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<pre>
<pre>
/usr/bin/printf '\xFF\xFF\x0A\x01\xD1\x06\x00\xE2' >/dev/ttyNSC0
/usr/bin/printf '\xFF\xFF\x0A\x01\xD1\x06\x00\xE2' >/dev/ttyNSC0
</pre>
</pre>
где "\xFF\xFF\x0A\x01\xD1\x06\x00\xE2" - это запись команды "FF FF 0A 01 D1 06 00 E2".
where "\xFF\xFF\x0A\x01\xD1\x06\x00\xE2" - is the entry of a "FF FF 0A 01 D1 06 00 E2" command.
</div>




<div lang="ru" dir="ltr" class="mw-content-ltr">
3. Create the new rules file <code>/etc/wb-rules/rs485_cmd.js</code> in the rules engine
3. Создадим в движке правил новый файл с правилами <code>/etc/wb-rules/rs485_cmd.js</code>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
The file can be edited with vim, nano, or mcedit in an ssh session on the device, or it can be downloaded with SCP.
Файл можно редактировать с помощью vim, nano или mcedit в сеансе ssh на устройстве, либо залить его с помощью SCP.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<pre>
<pre>
root@wirenboard:~# mcedit  /etc/wb-rules/rs485_cmd.js
root@wirenboard:~# mcedit  /etc/wb-rules/rs485_cmd.js
</pre>
</pre>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div lang="ru" dir="ltr" class="mw-content-ltr">
translator, wb_editors
4293

правки