Siemens c55 sms control help please


Closed Thread
Results 1 to 40 of 86

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thanks for caring one more time sow i need:

    ...............
    myarray var byte
    ...........
    ...........
    Loop:
    HSEROUT ["AT+CMGR=1",13,10]
    Pause 1000
    Hserin 6000,loop,[STR myarray]

    if myarray[1]="1" then
    if myarray[2]="2" then
    if myarray[3]="3" then
    ....
    if myarray[0]="0" then
    goto success
    endif
    ....
    endif
    endif
    endif

    no_success:


    success:


    Is ok the code?
    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    ...............
    myarray var byte
    No. You need array not byte variable. Read the Manual. I am not going to teach you the abc's of PBP! That is what YOU have to do! Sorry...

    Quote Originally Posted by camolas View Post
    HSEROUT ["AT+CMGR=1",13,10]
    Pause 1000
    Hserin 6000,loop,[STR myarray]
    I wrote on a previous post that you have to read back what the module is responding. By waiting 1 sec. I am sure, don't know about you, that you are quaranteed to lose data. Wait for the OK and read immediately.

    Quote Originally Posted by camolas View Post
    if myarray[1]="1" then
    if myarray[2]="2" then
    if myarray[3]="3" then
    ....
    if myarray[0]="0" then
    goto success
    endif
    ....
    endif
    endif
    endif

    no_success:


    success:
    The above was an example! You have to complete the puzzle...


    Quote Originally Posted by camolas View Post
    Is ok the code?
    Thanks
    No, I don't think is 100% OK, as I don't know PDU as I stated before and the example I gave has nothing to do with PDU that needs to be decoded first.

    Last, you are welcome, but please, read, read, read the PBP manual as to how the compiler is used. Blink a LED and then try this hardcore stuff...

    Ioannis

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Im lost now

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hi,

    I think the array is now ok

    ..........
    ..........
    myarray var byte[48] 'My array is made i think
    ..........
    ..........
    Loop:
    HSEROUT ["AT+CMGR=1",13,10]
    HSERIN 5000, Loop,[WAIT("OK")]

    if myarray[0]="0" then
    if myarray[1]="1" then
    ..................... ' from 0 to 47
    .....................
    if myarray[46]="46" then
    if myarray[47]="47" then

    goto success
    endif
    endif
    ................... ' from 0 to 47
    ...................
    endif
    endif

    no_success:
    Goto Loop

    success:
    High PortD.2

    End


    Please give me your input thanks.
    Last edited by camolas; - 8th July 2008 at 00:49.

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


    Did you find this post helpful? Yes | No

    Default

    OK. That is an improovment!

    I don't like the loop with Hserin. If you have to do other things and the data arrived are not good, it will stuck in the loop. You must have a way out and do some other checks if you need to execute tasks in the mean time.

    Ioannis

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Hi,

    100% right is stuck and keep doing AT+CMGR=1 (see it in hterminal)

    Can you please show me how you do it?

    thanks for caring.

    Quote Originally Posted by Ioannis View Post
    OK. That is an improovment!

    I don't like the loop with Hserin. If you have to do other things and the data arrived are not good, it will stuck in the loop. You must have a way out and do some other checks if you need to execute tasks in the mean time.

    Ioannis

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Its stuck and keep doing LOOP: (see it in hterminal)

    at+cpms="SM"
    +CPMS: 1,15,1,15,1,15

    OK
    AT+CMGR=1
    +CMGR: 1,,23
    0791539126010000240C915391663921010000807070819341 400453FA1B0E

    OK

    There is some error on my code.




    Code:
     @ Device HS_OSC         ' High Speed Crystal
    define OSC 20     ' Check the spelling of OSC, must be in capital letter
            
    Include "modedefs.bas" ' Include serial modes
    
    ' Define LCD registers and bits
    Define	LCD_DREG	PORTB           'Lcd D 4-bit parallel register starts at PortB.4 to PortB.7
    Define	LCD_DBIT	4              
    Define	LCD_RSREG	PORTB
    Define	LCD_RSBIT	2
    Define	LCD_EREG	PORTB
    Define	LCD_EBIT	3
    Define  LCD_COMMANDUS   2000	      ' Command Delay (uS)
    Define  LCD_DATAUS      50 	     ' Data Delay (uS)
    DEFINE  OSC         20                'Define oscilator frequency
    DEFINE LCD_LINES 4 'Number lines on LCD 
    
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
            
    
    
    myarray var byte[62]
    
    
    TrisD.2=0
    TrisC.6=0
    TrisC.7=1
    B0 var byte
    
    High portD.2
    Pause 500
    Low portD.2
    Pause 500
    High portD.2
    Pause 500
    Low portD.2
    Pause 500
    
    
    
    LOOP:
                                          
    HSEROUT["at+cpms=",34,"SM",34,13]
    PAUSE 500
    HSEROUT ["AT+CMGR=1",13,10]
    PAUSE 500
    
    
    
    HSERIN 5000, POR,[WAIT("OK")]
    
    POR:
    if myarray[0]="0"then 
    '0791539126010000240C915391663921010000807070819341400453FA1B0E
    
    goto success
    
    endif
    goto LOOP
    
    success:
    High PortD.2
    
    End




    Thanks for caring.
    Last edited by camolas; - 8th July 2008 at 19:41.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    There is some error on my code.
    No kidding...
    Where is myarray getting filled from? And how?

Similar Threads

  1. sms to control pic..pls help...
    By Ziki in forum mel PIC BASIC Pro
    Replies: 53
    Last Post: - 12th April 2010, 21:19
  2. Replies: 11
    Last Post: - 19th August 2009, 15:23
  3. SMS control for Relays
    By charudatt in forum Code Examples
    Replies: 15
    Last Post: - 2nd May 2009, 00:08
  4. Reading a SMS to an array
    By KA5MAL in forum GSM
    Replies: 3
    Last Post: - 17th June 2008, 17:24
  5. Control RC servo via Parallax Servo Control
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th September 2005, 08:18

Members who have read this thread : 0

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