How can I post data to url with AT commands?


#1

I have UART_SendStr function. I created gsm_send_data function to save data to phpmyadmin. Firstly, I want to send data to url with AT commands. How can I do? UART_SendStr() function like this:

void UART_SendChar (char data)
{
while (get_bit(UART1->FR,5)==1) //Poll on bit 5 (TXFF) until it becomes 0. The loop exits only if the bit value is 0
{
}
UART1->DR=data; // Put the data to send in the UARTDR register
}

void UART_SendStr (char* string) //girilen stringi null olana kadar karakter karakter okur.SendChar’a gönderir.
{
char i=0;
while ((string+i) != ‘\0’)
{
UART_SendChar(
(string+i));
i+=1;
}
}

void gsm_send_data(char *Number, char *Text) //send data to url
{
UART_SendStr(“AT+HTTPINIT\r\n”);
UART_SendStr(“AT+HTTPPARA=“URL”,“http:/192.168.1.230/info.php?num=”);
UART_SendStr(Number);
UART_SendStr(”&text=");
UART_SendStr(Text);
}


#2

Hi,
I have tutorials with code examples for sending data to server using HTTP on my youtube channel and blog. Please refer them.