Sending AT+WCFM command remotely

Hello,

Is it possible to use this command remotely?

We’re trying to add Watchdog support for our application and we found out that the watchdog extension is not activated on our applications. So we contacted our provider and got activation codes for them.

Now we need to upgrade some of our devices remotely to enable this setting.

I remember a topic about “not being able to execute AT commands via adl_atCmdCreate”, at least I remember that it was not possible to set that command parameter for that function dynamically.

If we manage to make that possible, then the length of command string becomes the issue.

Do you have any advice for this issue?

(we are planning to use these update commands via TCP/IP server or SMS)

Yes.

That relates to the Custom AT Commands created by the application - not to “standard” commands.

There is no problem to fit an AT+WCFM command into an SMS.

OK I managed to send command via TCP server, but I always get ERROR response to my commands:

tempData is the string I’m sending via TCP/IP (tempdata in the response handler is different from the one below, they both are local variables)

bool OuterAT_Handler(adl_atResponse_t *paras)
{
	char tempData[128];
    TRACE((17,"OUTER 1"));
    wm_sprintf(tempData, "%s", paras->StrData);
    TRACE((17,"OUTER 2"));
    wm_sprintf(CustomreturnData, "%s", (char *)tempData);
    TRACE((17,CustomreturnData));
    return FALSE;
}

TRACE((17,tempData));
TRACE((17, "AT+COMMAND: %d",adl_atCmdCreate(tempData, ADL_AT_PORT_TYPE( ADL_AT_UART1, FALSE ), (adl_atRspHandler_t) OuterAT_Handler, "*", NULL)));

TRACE for the code above is like this:

I can see that the AT+COMMAND is successfully executed according to the return OK (0)
and I can also see that there is a response to the sent command since OUTER1 trace marks the beginning of the response handler.

This is the same with the command “AT+IPR?”

Incorrect: the return value from adl_atCmdCreate does not indicate that the command was successfully executed - just that it was submitted.

I have sent you a private message on this subject.

I have found out what’s causing the problem;

the extra characters at the end of strings that I was sending (i guess they were ) shouldn’t be included in the command string.

I have resolved this issue but there is another problem I am facing now;

On Debug mode, I can run the command via TCP, I can see the response and I can see that It’s executed on the device.

When I compile the same code on Release mode, I don’t see the response, It also doesn’t execute the command.

What am I missing?

Command to send:

bool OuterAT_Handler(adl_atResponse_t *paras)
{
	char tempData[128];
    TRACE((17,"OUTER 1"));
    wm_sprintf(tempData, "%s", paras->StrData);
	ATRSP("\r\nCevap Geldi\r\n");
	ATRSP(CustomreturnData);
	ATRSP("\r\n");
    TRACE((17,parseString(tempData,2,2)));
    if (wm_strncmp(parseString(tempData,2,2), "OK", 2) != 0)
    {
    	ATRSP("\r\nCevap Geldi : Onaylandi\r\n");
    	ATRSP(CustomreturnData);
    	ATRSP("\r\n");
    	wm_sprintf(CustomreturnData, "%s", (char *)tempData);
    	TRACE((17,CustomreturnData));
    }
    TRACE((17,CustomreturnData));
    return FALSE;
}

    case 21:
    	// AT+COMMAND
        if (cmd[10] == '=')
        {
            wm_memset(tempData, 0, wm_strlen(cmd) + 1);
            wm_memcpy(tempData, parseString(cmd, 11, wm_strlen(cmd) - 11), (wm_strlen(cmd) - 11));
            wm_strRemoveCRLF(cmddata, tempData, wm_strlen(cmd) - 11);
            TRACE((17,cmddata));
            TRACE((17, "AT+COMMAND: %d", adl_atCmdSend(cmddata, (adl_atRspHandler_t) OuterAT_Handler, "*", NULL)));
        	ATRSP("\r\nKomut Geldi\r\n");
        	ATRSP(cmddata);
        	ATRSP("\r\n");
        }
        break;

I didn’t receive any private message here.

You seem to be doing a lot of stuff within TRACE macros - remember that TRACE macros are effectively removed in a non-Debug build…

stupid me :slight_smile:

Now I managed to make it work. Thank you.