Custom AT Commands CMD-Len limited to <80 Bytes?

Hi Support-Team,

I added custom AT commands (RUI3 - Version RUI_4.2.1 on RAK3172).

Problem: the maximum len for the command is not documented and it seems its is only somewhat < 80 Bytes? Interesting thing is, the module seems to accept not always the same number of bytes, it varies in the range ca. +/-2 ?

Thanks for a short statement,
Jo

The limit seems to be ~230 characters.
I tested multiple serial terminals and the parameter after the command itself is cut off at 230 characters, but the parameter length is reported as 260 bytes (that could be a bug in RUI3)

Test command with 25 char long command and 260 byte long parameter:

atc+testing_long_command=---------1---------2---------3---------4---------5---------6---------7---------8--------9---------100-------1----------2---------3---------4---------5---------6---------7---------8---------9---------200-------1---------2---------3---------4---------5---------6

Testing with the Serial Monitor of Visual Studio the parameter is cut off at 230 bytes:

The Serial Monitor of the ArduinoIDE has a similar behaviour, the parameter is cut off at 230 bytes.

If I split the parameter into two parameters of 200 characters each, all is good:

atc+test=---------1---------2---------3---------4---------5---------6---------7---------8--------9---------100-------1----------2---------3---------4---------5---------6---------7---------8---------9---------200:---------1---------2---------3---------4---------5---------6---------7---------8--------9---------300-------1----------2---------3---------4---------5---------6---------7---------8---------9---------400

Command = atc+test=
Parameter 1 = ---------1---------2---------3---------4---------5---------6---------7---------8--------9---------100-------1----------2---------3---------4---------5---------6---------7---------8---------9---------200
Parameter 2 = ---------1---------2---------3---------4---------5---------6---------7---------8--------9---------300-------1----------2---------3---------4---------5---------6---------7---------8---------9---------400

From VSC terminal app:

Test AT command used for this:

bool init_test2_at(void)
{
	return api.system.atMode.add((char *)"TESTING_LONG_COMMAND",
								 (char *)"max input length for AT commands",
								 (char *)"TESTING_LONG_COMMAND", test_handler2,
								 RAK_ATCMD_PERM_WRITE | RAK_ATCMD_PERM_READ);
}

int test_handler2(SERIAL_PORT port, char *cmd, stParam *param)
{
	AT_PRINTF("Received %d arguments", param->argc);

	for (int idx = 0; idx < param->argc; idx++)
	{
		AT_PRINTF("Argument %d Length %d ==> %s", idx + 1, strlen(param->argv[idx]), param->argv[idx]);
	}
	return AT_OK;
}

Hello Bernd,
thanks for your detailed tests!

Maybe you remember, I still reconised sometimes the problem of getting an error (“AT_COMMAND_NOT_FOUND\r\n”),
because the first few bits sometimes seems to be read wrong by the RAK3172 (tested on RAK3172-E, -T, -SIP and LP_SIP), USART2 on RAK3172-E and -SIP.

Since I could not find any reason for this (with different tools), I send two ‘\r’ and clear afterwards the buffer for 10 msec and also added retries in the commands.

I also added custom stress-test function, that periodically failed for blocks of ca. 80+/- Bytes. So maybe it “could” be a synchronisation problem of the UART.
My host CPU is a nRF52832.

Anyhow, with smaller blocks (<60 Bytes) all seems to work stable now for several days and temperatures without any error. If I discovery news, I’ll post it.

Thanks and with kind regards,
Jo