On Tue, 14 Aug 2018 at 12:42, ljh_dev <ljh_dev@126.com> wrote:
The board has usb serial, it connected to computer running dispatcher. On dispatcher computer that  usb serial device name is /dev/ttyUSB0 .
How to configure  usb serial in device .jinja2  file?

You will need a service which maps the device node to a serial interface - we typically recommend ser2net.

Always use the /dev/serial/by-id/ path and not the device-node name because the node can enumerate as ttyUSB1 or ttyUSB0 depending on local configuration but the /dev/serial/by-id/ path does not change.

Something like:

# UART1 - nearest power connector - current kernel console.
6080:telnet:0:/dev/serial/by-id/usb-FTDI_TTL232RG-VREG1V8_FTXODY29-if00-port0:115200 8DATABITS NONE 1STOPBIT banner LOCAL

This allows the connection_command to be "telnet localhost 6080" and this can be tested locally.

https://git.linaro.org/lava/lava-lab.git/tree/staging.validation.linaro.org/master-configs/staging-master.lavalab/lava-server/dispatcher-config/devices/staging-black01.jinja2

{% set connection_list = ['uart0'] %}
{% set connection_tags = {'uart0': ['primary', 'telnet']} %}
{% set connection_commands = {'uart0': 'telnet localhost 7105'} %}

/etc/ser2net.conf needs to be modified on the worker if you want to use localhost. (This is expected because the DUT USB serial cable is plugged into the worker in most cases, so that the /dev/serial/by-id/ path exists on the worker.)

 



 

_______________________________________________
Lava-users mailing list
Lava-users@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lava-users


--

Neil Williams
=============
neil.williams@linaro.org
http://www.linux.codehelp.co.uk/