desgin
Full Member level 1
Hello All,
I am using MikroC pro software and using PIC18f46k80 Controller with SIM800 and SD Card
Through HTTP - i am able to send live data of my sensor
i want to Store data when GSM can not send data to server.
I am able to store my data. Even i am able to read data from SD Card but HTTPPUT giving me error.
Can anyone please help me for this.
I want to send Whole File Data !!
USART2 is used for GSM
USART1 is used for checking data at Terminal
Below is my code:
I am using MikroC pro software and using PIC18f46k80 Controller with SIM800 and SD Card
Through HTTP - i am able to send live data of my sensor
i want to Store data when GSM can not send data to server.
I am able to store my data. Even i am able to read data from SD Card but HTTPPUT giving me error.
Can anyone please help me for this.
I want to send Whole File Data !!
USART2 is used for GSM
USART1 is used for checking data at Terminal
Below is my code:
Code:
char http_send_at_OFF[200];
memset(http_send_at_OFF, 0 , sizeof(http_send_at_OFF));
Mmc_Fat_Assign(&ch_SDFile_Name, 0xA0);
file_size = Mmc_Fat_Get_File_Size(); // File_size is 1 variable - signed long data type
LongToStr((signed long)sl_file_size, uch_file_size); //uch_file_size = unsigned char file size variable
UART1_write_text(uch_file_size); // Printing File size in Terminal
UART1_write_text(": File Size \n");
delay_ms(50);
if (sl_file_size > 50) // IF SD Card having File Size - and if its greater than 50 then only it will go in this function
{
sprintf(http_send_at_OFF, "AT+HTTPDATA=%d,10000", sl_file_size); // AT +HTTPDATA=%d,10000 --- where %d will be replaced by actual File Size
MMC_Fat_Assign(&ch_SDFile_Name, 0); // Calling SD card File
if(sendATcommand(http_send_at_OFF, "DOWNLOAD",150)==1) // Sending AT Command as --- AT+HTTPDATA=%d,10000 --- DOWNLOAD is reponse --- 150 - Timeout --
SendATcommands is 1 function
{
for (i_SDRead_Char = 0; i_SDRead_Char <= sl_file_size; i_SDRead_Char++) // For loop for reading from SD Card
{
MMC_Fat_Read(&ch_SDREAD_Char); // Reading from SD Card
UART2_Write(ch_SDREAD_Char); // Sending to Server
UART1_Write(ch_SDREAD_Char); // Printing on Terminal
}
//}
if(sendATcommand2("AT+HTTPACTION=1","OK","+HTTPACTION:1,200",200)==1) // Sending AT Command as ---AT+HTTPACTION=1 --- OK is response1 & +HTTPACTION:1,200 is
response1 --- 200 - Timeout -- SendATcommand2 is 1 function
{
}
}
Last edited by a moderator: