Hi,
I'm looking into LAVA and I figured I'd give it a try by flashing a frdm-k64f MCU board and parse its output (the board behaves as a USB to UART adapter through /dev/ttyACM0 at 115200bps). I created the board instance as:
{% extends 'frdm-k64f.jinja2' %} {% set board_id = '0240000048824e45004a700add89001a8761000097969900' %} {% set usb_mass_device = '/dev/disk/by-id/usb-MBED_VFS_0240000048824e45004a700add89001a8761000097969900-0:0' %}
I'm able to launch a job (frdm-k64f.job) but LAVA complains and returns:
Invalid job data: ["Invalid device configuration - missing 'commands'"]
So I went looking for an example and found thishttps://git.lavasoftware.org/fabo/lava/blob/bc44750733f57de09909f45ba7e65faa4cef341c/lava_scheduler_app/tests/devices/frdm-k64f-01.jinja2 which defines something called connection_commands as:
{% set connection_commands = {'usb0': 'telnet lab-slave-0 7115'} %}
Based on the documentationhttps://docs.lavasoftware.org/lava/connections.html I'm under the impression that the slave/dispatcher is expected to momentarily open a telnet server on port 7115 and forward the output of the serial port through that server to be retrieved by a client implemented by the master.
If I match the example the dispatcher flashes the board, but a telnet server is never launched on the slave. It's not surprising as at no point did I specify a tty or a baud rate for the dispatcher to connect to the board in order and launch something like:
socat TCP-LISTEN:7115,fork,reuseaddr FILE:/dev/ttyACM0,b115200,raw
When I sit on the slave and manually launch the command the master successfully connects to TCP port 7115. Problem is it does so after the board outputted its results (and obviously it's not the right way to do it).
So I have 3 questions:
* How should a UART connection be specified (/dev/ttyACM0, 115200bps) to LAVA?
* Once the UART connection specified, will the dispatcher buffer the board's output until it is retrieved by the master?
* Why does LAVA rely on a telnet channel instead of the existing zmq channel to forward the output of the board from the slave to the master?
Thanks
On Wed, 28 Aug 2019 at 10:12, Dupont, Louis [2] Dupont.Louis2@ireq.ca wrote:
Hi,
I’m looking into LAVA and I figured I’d give it a try by flashing a frdm-k64f MCU board and parse its output (the board behaves as a USB to UART adapter through /dev/ttyACM0 at 115200bps). I created the board instance as:
{% extends 'frdm-k64f.jinja2' %}
{% set board_id = '0240000048824e45004a700add89001a8761000097969900' %}
{% set usb_mass_device = '/dev/disk/by-id/usb-MBED_VFS_0240000048824e45004a700add89001a8761000097969900-0:0' %}
I’m able to launch a job (frdm-k64f.job) but LAVA complains and returns:
Invalid job data: ["Invalid device configuration - missing 'commands'"]
So I went looking for an example and found this which defines something called connection_commands as:
{% set connection_commands = {'usb0': 'telnet lab-slave-0 7115'} %}
Based on the documentation I’m under the impression that the slave/dispatcher is expected to momentarily open a telnet server on port 7115 and forward the output of the serial port through that server to be retrieved by a client implemented by the master.
If I match the example the dispatcher flashes the board, but a telnet server is never launched on the slave. It’s not surprising as at no point did I specify a tty or a baud rate for the dispatcher to connect to the board in order and launch something like:
socat TCP-LISTEN:7115,fork,reuseaddr FILE:/dev/ttyACM0,b115200,raw
When I sit on the slave and manually launch the command the master successfully connects to TCP port 7115. Problem is it does so after the board outputted its results (and obviously it’s not the right way to do it).
So I have 3 questions:
· How should a UART connection be specified (/dev/ttyACM0, 115200bps) to LAVA?
We're using ser2net for connecting to UARTs. The telnet from example connects to ser2net port and ser2net listens to serial connection from the board. The real device configuration from our LAB:
{% extends 'frdm-k64f.jinja2' %} {% set board_id = '024002019EA14E65635FB3DD' %} {% set usb_mass_device = '/dev/disk/by-id/usb-MBED_microcontroller_024002019EA14E65635FB3DD-0:0' %} {% set connection_command = 'telnet lite-master 7103' %} {# Power control is through USB rather than PDU #} {% set pre_power_command = '/usr/local/lab-scripts/cbrxd_hub_control -i DJ00K21W --mode1 off --mode2 sync -d 15 -a 5 -u 5' %}
and snippet from ser2net config: BANNER:frdm-k64f-01:\r\nfrdm-k64f-01 \p [\s]\r\n\r\n 7103:telnet:0:/dev/serial/by-id/usb-MBED_MBED_CMSIS-DAP_024002019EA14E65635FB3DD-if01:115200 8DATABITS NONE 1STOPBIT LOCAL frdm-k64f-01
· Once the UART connection specified, will the dispatcher buffer the board’s output until it is retrieved by the master?
It works the other way around. Worker parses logs and pushes to lava-logs (which is currently bound to master) using ZMQ.
· Why does LAVA rely on a telnet channel instead of the existing zmq channel to forward the output of the board from the slave to the master?
ZMQ is used for internal communication between LAVA parts. I guess you can somehow connect serial output from your board to ZMQ but than lava-dispatcher would have to connect to this stream for retrieving the logs (connection_command). As it currently doesn't support listening to ZMQ sockets this won't work. But the idea is nice :)
milosz
Thanks
Lava-users mailing list Lava-users@lists.lavasoftware.org https://lists.lavasoftware.org/mailman/listinfo/lava-users
On Aug 28, 2019, at 4:21 AM, Milosz Wasilewski milosz.wasilewski@linaro.org wrote:
On Wed, 28 Aug 2019 at 10:12, Dupont, Louis [2] Dupont.Louis2@ireq.ca wrote:
Hi,
I’m looking into LAVA and I figured I’d give it a try by flashing a frdm-k64f MCU board and parse its output (the board behaves as a USB to UART adapter through /dev/ttyACM0 at 115200bps). I created the board instance as:
{% extends 'frdm-k64f.jinja2' %}
{% set board_id = '0240000048824e45004a700add89001a8761000097969900' %}
{% set usb_mass_device = '/dev/disk/by-id/usb-MBED_VFS_0240000048824e45004a700add89001a8761000097969900-0:0' %}
I’m able to launch a job (frdm-k64f.job) but LAVA complains and returns:
Invalid job data: ["Invalid device configuration - missing 'commands'"]
So I went looking for an example and found this which defines something called connection_commands as:
{% set connection_commands = {'usb0': 'telnet lab-slave-0 7115'} %}
Based on the documentation I’m under the impression that the slave/dispatcher is expected to momentarily open a telnet server on port 7115 and forward the output of the serial port through that server to be retrieved by a client implemented by the master.
If I match the example the dispatcher flashes the board, but a telnet server is never launched on the slave. It’s not surprising as at no point did I specify a tty or a baud rate for the dispatcher to connect to the board in order and launch something like:
socat TCP-LISTEN:7115,fork,reuseaddr FILE:/dev/ttyACM0,b115200,raw
When I sit on the slave and manually launch the command the master successfully connects to TCP port 7115. Problem is it does so after the board outputted its results (and obviously it’s not the right way to do it).
So I have 3 questions:
· How should a UART connection be specified (/dev/ttyACM0, 115200bps) to LAVA?
We're using ser2net for connecting to UARTs. The telnet from example connects to ser2net port and ser2net listens to serial connection from the board. The real device configuration from our LAB:
{% extends 'frdm-k64f.jinja2' %} {% set board_id = '024002019EA14E65635FB3DD' %} {% set usb_mass_device = '/dev/disk/by-id/usb-MBED_microcontroller_024002019EA14E65635FB3DD-0:0' %} {% set connection_command = 'telnet lite-master 7103' %} {# Power control is through USB rather than PDU #} {% set pre_power_command = '/usr/local/lab-scripts/cbrxd_hub_control -i DJ00K21W --mode1 off --mode2 sync -d 15 -a 5 -u 5' %}
and snippet from ser2net config: BANNER:frdm-k64f-01:\r\nfrdm-k64f-01 \p [\s]\r\n\r\n 7103:telnet:0:/dev/serial/by-id/usb-MBED_MBED_CMSIS-DAP_024002019EA14E65635FB3DD-if01:115200 8DATABITS NONE 1STOPBIT LOCAL frdm-k64f-01
· Once the UART connection specified, will the dispatcher buffer the board’s output until it is retrieved by the master?
It works the other way around. Worker parses logs and pushes to lava-logs (which is currently bound to master) using ZMQ.
· Why does LAVA rely on a telnet channel instead of the existing zmq channel to forward the output of the board from the slave to the master?
ZMQ is used for internal communication between LAVA parts. I guess you can somehow connect serial output from your board to ZMQ but than lava-dispatcher would have to connect to this stream for retrieving the logs (connection_command). As it currently doesn't support listening to ZMQ sockets this won't work. But the idea is nice :)
milosz
We’ve had a desire to support pySerial to allow for direct serial support, but that is work someone needs to undertake.
- k
lava-users@lists.lavasoftware.org