« first day (7 days earlier)    last day (15 days later) » 

4:59 AM
I uncomment that uart_put(data[i]); it displays the CMTI: "SM",1 and after that it displays msg content and everything then again shows AT+CMGR=6 and error and it goes on like a while(1) loop
I have put 1sec delay in ISR because if i wont do that, the ISR doesnt function properly
earlier i was not including delay then what happend was like when ISR was fires, it gives a series of command and nothing happens
*fired
so i though of putting delay and after that it executes properly
 
5:17 AM
and one thing also I am executing AT+CMGD=slot to delete the msg so that the new msg is stored the 1st place
but at the terminal it is displayed as only T+CMGD=slot
dont know where this A in T+CMGD is going?
 
 
2 hours later…
7:43 AM
in your for loop where you extract the slot number, this part of the code
data[i] = serial_Rx();
uart_put(data[i]);
shows AT+CMGR=6 on the terminal?
 
currently i have no idea where that 'A' had gone
 
if you remember I have used MATCH to confirm that it has matched. so after this match AT+CMGR=6 comes
 
so where u extract the slot number, there is nothing extraordinary, only the "CMTI: "SM",1"
for(int k =0;smscontent[k]!=NULL;k++) //smscontent[k]!=NULL
{
if (smscontent[k] == 'C')
{
if (smscontent[k+1] == 'H')
{
if (smscontent[k+2] == 'A')
{
if (smscontent[k+3] == 'N')
{
if (smscontent[k+4] == 'G')
{
if (smscontent[k+5] == 'E')
{

if(isdigit(smscontent[k+6]))
{

This part of the code is over complicated
when k = 0
u check with the ifs the the message contains "CHANGE string"
it happens completely when k = 0, because u r checking k+1, +2, +3 ...
but when the for loop iterates
k= 1, you check again k +1, +2, +3 ,+4
it checks again the whole array, but obviously it will be false
the first if will fail since the second char i not a C but a H
all in all the for loop is unnecessary
if(strstr(smscontent,"CHANGE") && isdigit[6]){

}
is the same, since u check for the CHANGE and then check that if the char in the 7th position is a digit
 
8:11 AM
oh let me try this one
 
code would be more clear which is good when we are hunting for bugs
do not forget safe saves though
 
yeah
&& (isdigit(smscontent[6]) not working
 
nope i forget something
if(strstr(smscontent,"CHANGE") != NULL && isdigit(smscontent[6]){

}
now it must work
 
8:34 AM
no its not working
actually i think this isdigit not working
i check it individually for if(strstr(smscontent,"CHANGE") != NULL and its fine
and yes i should say that now i am not getting AT+CMGR=6 problem
I am actually doing this

if((strstr(smscontent,"CHANGE") != NULL) && (isdigit(smscontent[6])))
{
serial_Tx("MATCH");
}
but i am just getting ok no MATCH
then i did this
if((strstr(smscontent,"CHANGE") != NULL))
{
serial_Tx("MATCH");
}
i got MATCH
even I did this also

if((strstr(smscontent,"CHANGE") != NULL) && (smscontent[6]=='1'))
{

serial_Tx("MATCH");
}
bcause I am sending CHANGE1<number>
i didnt got MATCH
I managed to do this and got MATCH
if((strstr(smscontent,"CHANGE") != NULL) && (strstr(smscontent,"1")))
{

serial_Tx("MATCH");
}
is this ok?
but now if i follow this method how will i extract my number
:/
 
9:15 AM
serial_Tx("1 MATCH\n");
for (int i=0;i<=9;i++)
{
newnum1[i] = smscontent[i+6];
} serial_Tx(newnum1);
uart_put('\n');
(void) memcpy(topHalf1,newnum1,5);
(void) memcpy(bottomHalf1,newnum1 + 5,5);
sprintf(delcmd1,"AT+CMGD=%c\r\n",slot);
serial_Tx(delcmd1);
and you do not need top and bottom half use a ten long string
array
 
serial_Tx("1 MATCH\n");
for (int i=0;i<=9;i++)
{
newnum1[i] = smscontent[i+7];
}
serial_Tx(newnum1);
bnevermind
first this is how u can extract the tel num
I wonder why does the isdigit not work
I tried this code yesterday
zour messgage is like "CHANGE19999999999" or "CHANGE29999999999"
so the smscontent[6] is a surly a digit if the string contains the "CHANGE" part
 
yes my msg is like CHANGE19999999999 CHANGE29999999999
and its not working
number is not extracted
these are the outputs
are you able to see them
 
10:21 AM
what is the matter now?
I feel like just pulling you back with mz refactoring ideas, sorry
 
mz refactoring ideas?
 
my refactoring, refactoring means change a part of the code to make it simpler, easier
 
ohh okay
 
but that lot of is is a little bit fuzzy
*IFs
are a little bit fuzzy
i will try to send a picture about a code sample with its results as soon as possible
 
 
2 hours later…
12:43 PM
its okay Bence, leave it, I cannot continue with this project anymore.
I got a mail from the department that I have to submit a report on this by tomorrow. I talked to my guide that my project is 90% complete and few things are remaining, he told me that leave that few things for now, make a report and submit it then we can ask for some some time to complete it.
 
what kind of project was it?
if I am allowd to know
sorry I could have helped more
 
its okay. It was my college project
in each sem we have to give a project
so the problem which i was facing, i'll complete it in future now
 
Zes, I am familiar with that my GSM module with the AVR is an university Project laboratory theme
and I am in the middle of it too
 
by the way bence, can i ask you what do you?
if you dont have any problem
 
What do I do with the GSM module_
?
 
12:50 PM
no I mean are you in job? or in university?
 
I have just finished the first semester on Electrical Engineering Master training and I am working beside school as a software developer intern
 
okay
Well Bence you really helped me a lot in this.. I am really thankful to you :)
 
so I am prettz occupied but now its summer holiday so I can work a lot
zou are welcome
you*
sometimes I was very confusing I think sorry for that
 
no no its okay. I understand :)
I need to go right now. but we will be in touch if you can
Bye :)
 

« first day (7 days earlier)    last day (15 days later) »