UART scripting

Hello,

I am running automatic tests on the otii device. I can’t find a way to send the AT-command “write_tx” command. The sent commands appear in the window only after the project is closed.

Could you help me to do this ? Basically the lua script would look like:

setup device + project + choose the good port to display the UART log
set the supply voltage
send at-command to the device through tx messages
receive uart messages through rx
register both the current values and the log messages

Thanks in advance,
Anne-Charlotte

Hi Anne-Charlotte,
Welcome to the forum!

Since you mention “choose the good port…”, do you want to send UART TX with Otii Arc or a external UART serial device?
External devices are not supported in scripting, only using Otii Arc.

Make sure that you set the right voltage level and baud rate, also include \r\n in the end of your string.

Quick example below, not complete script, just to show the APIs.
device:set_main_voltage(3.0)
device:set_exp_voltage(1.8)
device:set_uart_baudrate(115200)
device:enable_channel(“mc”,true)
device:enable_channel(“rx”,true)
device:write_tx(“ATI\r\n”)

You can find the API here:
https://www.qoitech.com/help/scripting/modules/otii.html

Best regards,
Björn

Thanks a lot ! I missed the \r\n. It’s perfectly working !