hserin and sms controller


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    Do you have any problem with this program, or ist an example?

    I have say to that is long enough! I have a little difficulty followng the s1, s12 named subs. Better use names to understand after a month what this sub do.

    Ioannis
    its a example, but everything is working just fine, thos subs s1 to s4 is mesages for users!!!turn on heating, turn off heating, temperature in object and u dont have autorizathion for device!!! and once again thx for help!!!

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    You are welcome. Thanks for posting your work too.

    Ioannis

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    After a lot of experimenting with the SMS subject, I noticed all by chance, that when my provider sent an SMS for advertisment purposes, the program could not handle it properly because in Hserin line to get the SMS, a 10 digit number was expected and not the 4 digit one.

    Keep in mind that the "defaults" may not always be default enough!

    Here is my test subroutine:
    Code:
    read_sms:
    	Lcdout com,line1,"Reading SMS"
    	HSerout ["AT+CMGL=",34,"ALL",34,13]  '"ALL" is for Wavecom module. Read all SMS 
    	' Read Caller ID etc. The timeout value in the HSERIN statement is important.
    	' it takes some time before the phone replies to the AT+CMGL command
    	HSerin 5000,ex_sms4,[wait("READ"),wait("+30"),str cc_phone\10,wait(44,44,34),SKIP 23,STR array\15\13] 'Number is waitstr command\10
    	LCDOut com,1,"Read 1 SMS"
    	pause 1000
    sms_delete:
    	LCDOut com,1,"Deleting SMS"
    	HSerout ["AT+CMGD=1,4",13]			'Delete all messages
    	HSerin 19000,ex_sms2,[wait("OK")]     'Wait for OK (null)
    	LCDOut com,line1,"Deleted SMS "
    	Pause 1000
    	return
    ex_sms2:    'No new message or timeout error
    	LCDOut com,line2,"Error",rep " "\11:Pause 1000
    	return
    ex_sms4:    'Wrong Number!
    	LCDOut com,line2,"Error phone Nbr":Pause 1000
    	goto sms_delete
    At the 3rd command line where HSerin 5000,ex_sms4,[wait... is executed, the command waits for +30 which is the country code for Greece, then I get 10 digits for the phone that is sending the SMS.

    But if the sender has only 4 digits I now through the timeout, jump to ex_sms4 and after an LCD message, the new and irrelevant SMS is deleted.


    Hope this helps all that deal with SMS stuff.

    Ioannis

Similar Threads

  1. Replies: 11
    Last Post: - 19th August 2009, 15:23
  2. problem with the GSM controller
    By Dariolo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th May 2009, 20:33
  3. Replies: 0
    Last Post: - 21st May 2009, 00:58
  4. parsing string from hserin
    By xxxxxx in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 2nd April 2009, 18:42
  5. Reading a SMS to an array
    By KA5MAL in forum GSM
    Replies: 3
    Last Post: - 17th June 2008, 17:24

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts