8000 atc_command() wait until get correct answer · Issue #5 · nimaltd/atc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
atc_command() wait until get correct answer #5
Open
@elkanamol

Description

@elkanamol

HI,
I'm trying to set workflow with ESP8266 to send data to TCP server over AT commands.
the atc_command() not wait to correct answer and i need to wait until get "CONNECT" and later get ">" sign to able send my string.
it is not send the data after ">" sign, also not halt until correct answer received.
see some my code below,

uint8_t espSendDataTCP(char *APIkey, int Field_num, uint16_t value)
{
	char localBuffer[100] = {0};
	char localBuffer2[30] = {0};

	sprintf (localBuffer, "GET /update?api_key=%s&field%d=%u\r\n", APIkey, Field_num, value);
	sprintf (localBuffer2, "AT+CIPSEND=%d\r\n", strlen(localBuffer));
	if(atc_command(&atc, localBuffer2, 5000, NULL, 0 ,1, "\r\nCONNECT")!= 1)
	{
		printf("ERROR: ESP01 cannot set TCP connection \r\n");
		toggleGreenLed(6);
		return -1;
	}
	HAL_Delay(5000);
	if(atc_command(&atc, localBuffer, 1000, NULL, 0 ,1, "\r\n>" )!= 1)
	{
		printf("ERROR: ESP01 cannot set TCP connection \r\n");
		toggleGreenLed(6);
		return -1;
	}
	return 1;
}

BR,
ElkanaM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0