Перейти к содержанию

Навигация

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

Новая страница: «defineRule("_system_buzzer_onof", { whenChanged: "buzzer/enabled", then: function (newValue, devName, cellName) { if ( dev.buzzer.enabled) { _buzzer_set_params(); runShellCommand("echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable"); } else { runShellCommand("echo 0 > /sys/class/pwm/pwmchip0/pwm2/enable"); } } });»
(Новая страница: «<pre> /usr/bin/printf '\xFF\xFF\x0A\x01\xD1\x06\x00\xE2' >/dev/ttyNSC0 </pre> where "\xFF\xFF\x0A\x01\xD1\x06\x00\xE2" - is the entry of a "FF FF 0A 01 D1 06 00 E2" command.»)
Метки: правка с мобильного устройства правка из мобильной версии
(Новая страница: «defineRule("_system_buzzer_onof", { whenChanged: "buzzer/enabled", then: function (newValue, devName, cellName) { if ( dev.buzzer.enabled) { _buzzer_set_params(); runShellCommand("echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable"); } else { runShellCommand("echo 0 > /sys/class/pwm/pwmchip0/pwm2/enable"); } } });»)
Строка 723: Строка 723:
There should be no error messages in the log (exit via control-c)
There should be no error messages in the log (exit via control-c)


<div lang="ru" dir="ltr" class="mw-content-ltr">
A new device "Send custom command to RS-485 port" should appear in the Devices section of the web interface.
В веб-интерфейсе в разделе Devices должно появиться новое устройство "Send custom command to RS-485 port".
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
6. Add a function to configure the port.
6. Добавим функцию для конфигурирования порта.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<syntaxhighlight lang="ecmascript">
<syntaxhighlight lang="ecmascript">
function setup_port() {
function setup_port() {
     runShellCommand("stty -F /dev/ttyNSC0 ospeed 9600 ispeed 9600 raw clocal -crtscts -parenb -echo cs8");
     runShellCommand("stty -F /dev/ttyNSC0 ospeed 9600 ispeed 9600 raw clocal -crtscts -parenb -echo cs8");
}
}
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
</syntaxhighlight>
</syntaxhighlight>
</div>


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

правок