wb_editors
14 355
правок
(Новая страница: «For interactive sending and receiving of data in HEX (hexadecimal) format, use the [https://github.com/contactless/serial_tool serial_tool] utility (already ins…») |
FuzzyBot (обсуждение | вклад) м (FuzzyBot переименовал страницу Working with serial port/en в Serial Port/en без оставления перенаправления: Часть переводимой страницы Working with serial port.) |
||
(не показано 9 промежуточных версий 2 участников) | |||
Строка 20: | Строка 20: | ||
For interactive sending and receiving of data in HEX (hexadecimal) format, use the [https://github.com/contactless/serial_tool serial_tool] utility (already installed on the Wiren Board). | For interactive sending and receiving of data in HEX (hexadecimal) format, use the [https://github.com/contactless/serial_tool serial_tool] utility (already installed on the Wiren Board). | ||
=== | ===Help=== | ||
<pre> | <pre> | ||
Строка 48: | Строка 48: | ||
=== | === An example of running === | ||
<pre> | <pre> | ||
Строка 60: | Строка 60: | ||
<< FF FF 0A 00 11 00 00 1B | << FF FF 0A 00 11 00 00 1B | ||
</pre> | </pre> | ||
The settings are 9600 8N2, 1 second timeout, port /dev/ttyNSC1 (RS-485). | |||
== | == Interactive mode from the console == | ||
The most convenient tool to work with the serial port from the console is ''minicom'' (available in the standard image of the Wiren Board controller). Minicom is convenient to use for working with devices that are controlled by text commands or output text messages. The examples of such devices are GSM modems (controlled by AT commands), including the GSM module built into the Wiren Board; GPS modules operating under the NMEA Protocol, etc. | |||
Minicom | |||
Brief instructions (we believe that we will work with the port /dev/ttyAPP0): | |||
* | * For the first time, run minicom with a key that creates a port profile (it stores the port number, data rate, parity, etc.): | ||
<pre> | <pre> | ||
$ minicom -s /dev/ttyAPP0 | $ minicom -s /dev/ttyAPP0 | ||
</pre> | </pre> | ||
* | * Go to settings (press Ctrl+A, then O), select Serial port setup, there set port /dev/ttyAPP0, speed and parity - 115200, 8N1, Hardware flow control - No, Software flow control - No | ||
* | * To save settings: Save setup as _dev_ttyAPP0 | ||
* | * Then run as: | ||
<pre> | <pre> | ||
$ minicom /dev/ttyAPP0 | $ minicom /dev/ttyAPP0 | ||
</pre> | </pre> | ||
( | (all settings will be taken from the profile name /dev/ttyAPP0 that we previously created) | ||
* | * You can now enter the data you want to send to the port. Data coming to the port from external devices will also be displayed | ||
---- | ---- | ||
Строка 87: | Строка 86: | ||
== modbus-client == | == modbus-client == | ||
One of the most convenient means of debugging Modbus communications from the command line of Wiren Board is the modbus-client utility. Description and examples can be found on this page [[modbus-client/en|modbus-client]]. | |||
== | == | ||
Work with serial port from your program == | |||
http://tldp.org/HOWTO/Serial-Programming-HOWTO/ | http://tldp.org/HOWTO/Serial-Programming-HOWTO/ |