translator, wb_editors
4544
правки
Matveevrj (обсуждение | вклад) (Новая страница: «1. Port setting») |
Matveevrj (обсуждение | вклад) (Новая страница: «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 | ||
To configure the / dev/ttyNSC0 port to 9600 speed, run the following command | |||
<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> | ||
2. Sending a command | |||
2. | |||
Sending data is done with the following shell command: | |||
<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> | ||
where "\xFF\xFF\x0A\x01\xD1\x06\x00\xE2" - is the entry of a "FF FF 0A 01 D1 06 00 E2" command. | |||
3. Create the new rules file <code>/etc/wb-rules/rs485_cmd.js</code> in the rules engine | |||
3. | |||
The file can be edited with vim, nano, or mcedit in an ssh session on the device, or it can be downloaded with SCP. | |||
<pre> | <pre> | ||
root@wirenboard:~# mcedit /etc/wb-rules/rs485_cmd.js | root@wirenboard:~# mcedit /etc/wb-rules/rs485_cmd.js | ||
</pre> | </pre> | ||
<div lang="ru" dir="ltr" class="mw-content-ltr"> | <div lang="ru" dir="ltr" class="mw-content-ltr"> |