Siemens c55 sms control help please


Closed Thread
Page 1 of 3 123 LastLast
Results 1 to 40 of 86
  1. #1

    Default Siemens c55 sms control help please

    Hi,

    I cant put this simple sms sender to work in pic(the phone works pdu mode only on hterminal works all call and sms) . In my code you can see 2 parts 1 is the dailing that works fine the other was to be a sms sender but i cant put it to work can you please helpp me on that thans a lot.

    By by

    Code:
    @ Device HS_OSC         ' High Speed Crystal
    define OSC 20    
            
    Include "modedefs.bas" ' Include serial modes
    
    ' Define LCD registers and bits this time not use it for later apps..
    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
            
    TrisC.5=0
    TrisC.6=0
    TrisC.7=1
    B0 var byte
    
    High portC.5 ' Led flashing to see if wardware are ok
    Pause 500
    Low portC.5
    Pause 500
    High portC.5
    Pause 500
    Low portC.5
    Pause 500
    
    
    HSEROUT ["AT", 13]
    HSEROUT ["ATD+351xxxx31210;", 13] 'phone dials to number no problem here
    pause 5000   
                                          
    ' Now were is the problem is when i thange the dialing line command for the sms to send a sms and the phone do nothing.. :(
    'HSEROUT ["AT", 13]  
    'HSEROUT ["AT+CMGS=16", 13]
    'HSEROUT ["079153912601000011000C915391663921010000AA02EF35",13]
    STOP
    end
    Last edited by camolas; - 28th June 2008 at 18:31. Reason: more things to add

  2. #2


    Did you find this post helpful? Yes | No

    Default

    On my searchs i find more info now i can send the sms from hterminal but not from the pic i read that "Hserout [20]" is the Ctrl+z end command but some thing is still missing for me i belave the problem must be on the sending command..... plz give ne some hellp.Thanks


    Hserout ["at", 13]
    Hserout ["at+cmgs=16", 13]
    Hserout ["079153912601000011000c915391663921010000aa02ef35" ,13]
    Hserout [20]

  3. #3
    Join Date
    Dec 2007
    Location
    Cd. Juarez, Mexico
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Here is a section from my program to send a sms. I'm using a WAVECOM modem, but I think the AT commans are the same for all brands.

    sms:
    HSerout ["AT",13]
    HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
    HSerout ["AT+CMGF=1",13] 'Set Text Mode
    HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
    HSerout ["AT+CMGS=",str tel\14,13] ' dial the phone number
    HSERIN 5000 , SMS, [WAIT(">")] 'wait for a response to send the message
    HSerout ["Esto es solo una prueba",13] 'write the message
    HSerout [26] 'exit message mode
    Pause 500
    GOTO ESPERA 'exit sms rutine

    and it works great!!!!!!!

    I hope it can help you

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hi,

    thanks for caring, but de siemens c55 do not have text sms only pdu. I think i need in the pdu array some send command... like i have used in hterminal the ctrl+z.
    (Mi problema esta en comandar la trama pdu)

    Gracias

    Thanks,

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Hi Norbac. Are you sure it is working? After AT+CMGS= there is a need for " character. Maybe your module does not needed.

    Here is an older post I gave as an example:

    Code:
    HSerout ["AT+CMGS=",34,your numbers here,34,13]
    hserin 2000,noresp,[wait(">")]
    HSerout ["your message here",26]
    hSerin 5000,noresp,[wait("OK")]
    LCDOut com,1,"Sent OK":Pause 1000
    GoTo .....
    noresp:
    LCDOut com,1,"Message not sent...":Pause 1000
    GoTo....
    34 is " character
    26 is Ctrl+Z character

    To Camolas: find another mobile with text. PDU is difficult format. Does not worth it. You may find cheap phones and modules to try.

    Ioannis
    Last edited by Ioannis; - 30th June 2008 at 19:09.

  6. #6
    Join Date
    Dec 2007
    Location
    Cd. Juarez, Mexico
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    You are rigth, according with the standard, the CMGS command needs a " for the phone number. But for some reason on my modem does not need it. I will change just to follow the standard.

    Thanks for your feedback.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thanks for caring, i have one nokia 6230 but i have tried for one month to connect it to pc but no sucess then i moved to siemens c55 and made it. Can you please just tell me how i have to do (pbp code, because my pdu array works fine in pc connection) to end my pdu array and send the send command (ctrl+z) ??

    Thanks

    By by


    Quote Originally Posted by Ioannis View Post
    Hi Norbac. Are you sure it is working? After AT+CMGS= there is a need for " character. Maybe your module does not needed.

    Here is an older post I gave as an example:

    Code:
    HSerout ["AT+CMGS=",34,your numbers here,34,13]
    hserin 2000,noresp,[wait(">")]
    HSerout ["your message here",26]
    hSerin 5000,noresp,[wait("OK")]
    LCDOut com,1,"Sent OK":Pause 1000
    GoTo .....
    noresp:
    LCDOut com,1,"Message not sent...":Pause 1000
    GoTo....
    34 is " character
    26 is Ctrl+Z character

    To Camolas: find another mobile with text. PDU is difficult format. Does not worth it. You may find cheap phones and modules to try.

    Ioannis

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    I gave you the code. You even quoted to the reply. Please read carefully. The ctrl-Z is there. As for the PDU I cannot help you, sorry.

    Ioannis

  9. #9


    Did you find this post helpful? Yes | No

    Default

    Hi,

    The pdu is fine no problem, are this command lines ok?


    Hserout ["at", 13]
    Hserout ["at+cmgs=16", 13]
    Hserout ["079153912601000011000c915391663921010000aa02ef35" ,13, 26]


    Thanks for caring

    Quote Originally Posted by Ioannis View Post
    I gave you the code. You even quoted to the reply. Please read carefully. The ctrl-Z is there. As for the PDU I cannot help you, sorry.

    Ioannis

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    If you mean the syntax then yes, I don't see any problem, except the 13 on the last. Just remove it.

    Ioannis

  11. #11
    Join Date
    Nov 2005
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Why not store the messagge in the sim memory card and send with the command "AT+CMSS=n",Cr

    Regards

  12. #12


    Did you find this post helpful? Yes | No

    Default

    Hi,

    @ Ioannis tanks i will try later.


    Quote Originally Posted by GioppY View Post
    Why not store the messagge in the sim memory card and send with the command "AT+CMSS=n",Cr

    Regards
    Can you please explain me beter your idea? it will go like this? : Hserout ["AT+CMSS=n", 13]

    n- is posicion number in sim storege?
    no need off [26] Ctrl+z command?


    My code

    Hserout ["at", 13]
    Hserout ["at+cmgs=16", 13]
    Hserout ["079153912601000011000c915391663921010000aa02ef35" , 26]

    I have connect to hterminal and this is what the pic is sending:

    ATAT+CMGS=
    16079153912601000011000C915391663921010000AA02EF3

    It miss a 5 on the end , and 16 is not on the AT+CMGS=16

    Can you hellp me people?


    Thanks,
    Last edited by camolas; - 4th July 2008 at 17:10.

  13. #13
    Join Date
    Nov 2005
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Here a snip that send a sms from position 1, then wait for ok.

    SerOut2 TX,TTMode,["AT+CMSS=1",Cr] ’invia sms presente in posizione 1
    gosub Poll_Ok ’sms inviato ?


    Search with google "allarme SMS per siemens e pic12f675"
    You should found a my program that uses a siemens C35 and send the message stored in pos.1 from sim card. I do not know if it works with C55.
    Regards
    Gianni

  14. #14


    Did you find this post helpful? Yes | No

    Post

    Hi,

    Now is working im very happy )

    code line:

    HSEROUT ["AT+CMGS=16",13,10]
    PAUSE 500
    HSEROUT ["079153912601000011000C915391663921010000AA02EF35" ,26,10]
    HSEROUT [13]

    A good utility to macke sms pdu-encode-decode
    http://twit88.com/home/utility/sms-pdu-encode-decode

    Thanks to the ones that hellp me

    By by

  15. #15
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Smile

    Hi, when you enter with a voice command then you have to close it with "ATH" otherwise you will never return to data mode.
    Regards

  16. #16


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Please explain what you said.
    Now i want to read a sms line code HSEROUT ["AT+CMGR=1",13,10]
    but i do not now read it and compare with the IF SMS="pdu array" then .....
    Can you please hellp me on that?

    Thanks

  17. #17
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    pbp does not have string comparison commands (Hey Darrel, what about a macro for this??)

    So you have to compare one character at a time using nested if-then.

    Ioannis

  18. #18


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Sow i can not store the sms full received pdu array as var word and then compar it with IF...THEN... ?
    Im very new at all this can you please give me a example sow i can see how to do?

    Thanks
    Last edited by camolas; - 7th July 2008 at 19:17.

  19. #19
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    You ca store in an array of bytes whatever you want, but cannot do this if myarray="1234567890" then do that.

    You have to do a nested if-then comparison like that:

    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:


    Of course this can be done with a for-next loop more elegant, but for the sake of simplicity I left it like that.

    Ioannis

  20. #20


    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

  21. #21
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    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

  22. #22


    Did you find this post helpful? Yes | No

    Default

    Im lost now

  23. #23


    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.

  24. #24
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    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

  25. #25


    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

  26. #26


    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.

  27. #27
    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?

  28. #28
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    After this:

    HSERIN 5000, POR,[WAIT("OK")]

    and before that:

    POR:
    if myarray[0]="0"then

    you need to fill the array as Skimask stated.

    Ioannis

  29. #29


    Did you find this post helpful? Yes | No

    Default

    Hi,

    It is this ok Masters?

    Code:
    ..........
    ..........
    HSERIN 5000, [WAIT("OK")] ' I tacke off the POR from HSERIN 5000, POR,[WAIT("OK")] i think theres no need, is ok masters?
    HSERIN 5000 POR,[STR myarray\62]

    POR:
    if myarray[0]="0"then
    ..........
    ..........

    Thanks for caring

  30. #30
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    Hi,
    It is this ok Masters?
    I don't know....(how can I? I haven't built your hardware, used your firmware, on your chips, with your setup, on your PC)
    Does it work or not?

  31. #31


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Not working

    Quote Originally Posted by skimask View Post
    I don't know....(how can I? I haven't built your hardware, used your firmware, on your chips, with your setup, on your PC)
    Does it work or not?

  32. #32
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    Hi,
    Not working
    How quickly can and/or does the phone respond after you send the: ["AT+CMGR=1",13,10]

  33. #33


    Did you find this post helpful? Yes | No

    Default

    Hi,

    After de phone recived the AT+CMGR=1 command he gives very fast (1s at most) the
    +CMGR: 1,,23
    0791539126010000240C915391663921010000807070819341 400453FA1B0E

    OK


    Thanks for still caring

    Quote Originally Posted by skimask View Post
    How quickly can and/or does the phone respond after you send the: ["AT+CMGR=1",13,10]

  34. #34
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    Hi,
    After de phone recived the AT+CMGR=1 command he gives very fast (1s at most) the
    +CMGR: 1,,23
    0791539126010000240C915391663921010000807070819341 400453FA1B0E
    OK
    Thanks for still caring
    Ok, so don't you think that by pausing for 1/2 second after sending the command, you might miss the incoming data, or at least maybe the beginning of it, thereby causing you to think you might not have gotten anything at all?

    Code:
    LOOP:                             
    HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500
    HSEROUT ["AT+CMGR=1",13,10] : PAUSE 500

  35. #35


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Ive put HSEROUT["at+cpms=",34,"SM",34,13] and HSEROUT ["AT+CMGR=1",13,10] and them it give me error back, sow back to HSEROUT ["AT+CMGR=1",13,10]:PAUSE 500 and
    HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500 and then i thang the HSERIN 5000,POR,[WAIT("OK"),STR myarray\62] to HSERIN 500, .............. data came faster but keep looping
    then to HSERIN 1000,............. same problem



    Quote Originally Posted by skimask View Post
    Ok, so don't you think that by pausing for 1/2 second after sending the command, you might miss the incoming data, or at least maybe the beginning of it, thereby causing you to think you might not have gotten anything at all?

    Code:
    LOOP:                             
    HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500
    HSEROUT ["AT+CMGR=1",13,10] : PAUSE 500

  36. #36
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    Ive put HSEROUT["at+cpms=",34,"SM",34,13] and HSEROUT ["AT+CMGR=1",13,10] and them it give me error back, sow back to HSEROUT ["AT+CMGR=1",13,10]:PAUSE 500 and HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500 and then i thang the HSERIN 5000,POR,[WAIT("OK"),STR myarray\62] to HSERIN 500, .............. data came faster but keep looping then to HSERIN 1000,............. same problem
    Just because I'm using l/c letters doesn't mean you have to change yours...

    So what does your program look like now...

    And again, if your phone responds inside of a second, usually faster, and you add in a pause after sending the command that will get a response, what's going to come first, the pause or the response? And are you going to miss it or not?

  37. #37
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    This is the last time I am going to state this: DON't use pause statements or ignore the responses of the serial devices. When you send a command ALWAYAS check for the response.-

    Ioannis

  38. #38


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Let see if i get it.

    LOOP:
    HSEROUT["at+cpms=",34,"SM",34,13] : PAUSE 500
    HSEROUT ["AT+CMGR=1",13,10] : PAUSE 500

    Change to.

    LOOP:
    HSEROUT["at+cpms=",34,"SM",34,13]
    HSERIN 5000, [WAIT("OK")]
    HSEROUT ["AT+CMGR=1",13,10]
    HSERIN 5000, [WAIT("OK")]


    Is this what you ment?

    Thanks for caring.

  39. #39
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by camolas View Post
    Is this what you ment?
    Thanks for caring.
    Maybe...again, does it work or not?

  40. #40
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Skimask got me on the turn!

    Pheww! Yes at last... 8-)

    Always do this kind of check. It is the only way to communicate. Otherwise you may well be talking but no-one listening!

    Ioannis

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 : 1

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