[Lava-users] How to configure usb serial in device .jinja2 file

Neil Williams neil.williams at linaro.org
Tue Aug 28 07:19:25 UTC 2018

On Tue, 14 Aug 2018 at 12:42, ljh_dev <ljh_dev at 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.

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


{% 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 at lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lava-users


Neil Williams
neil.williams at linaro.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linaro.org/pipermail/lava-users/attachments/20180828/fcb08486/attachment.html>

More information about the Lava-users mailing list