sms to control pic..pls help...


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    Ziki's Avatar
    Ziki Guest


    Did you find this post helpful? Yes | No

    Unhappy

    thx flez.....sorry i'm not very familiar with the code you have given ...maybe if possible ..can you send me a code on a simple program ( on a LED when t610 receive sms " ONLED" and off it when recieve "OFFLED" ..thx alot

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ziki
    thx flez.....sorry i'm not very familiar with the code you have given ...maybe if possible ..can you send me a code on a simple program ( on a LED when t610 receive sms " ONLED" and off it when recieve "OFFLED" ..thx alot

    My point was your pic will not see 'OFFLED' it will see a string of hex digits like "6768768768768670987898658769080978547678465587548 7"

    Off led is:
    064FA391592402

    06 is 6 bytes of message and

    4FA391 is off

    592402 is led

    but if you type offled then you get

    06
    6FB399 off
    5D2603 led

    you need to read up on pdu mode if your using ericsson

    pdu mode is more common than text mode phones, I dont know of new phones that support text so learn to use pdu its all the phone manufacturers are offering!

    download pduspy, a link is on google.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi,

    That's not Pic ... but have a look !!!

    http://www.serasidis.gr/circuits/sms...controller.htm

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Ziki's Avatar
    Ziki Guest


    Did you find this post helpful? Yes | No

    Smile

    thx for the link acetronics..........

  5. #5


    Did you find this post helpful? Yes | No

    Default

    You can make it all work without worrying about decoding the pdu's, dont be scared off by them!

    Provided you always send commands in a set way, a protocol if you like, then it wont matter that its not text.

    IE..

    617658DE06BDDD alarm on
    617658DE06BDCD66 alarm off

    You just check a few key points in the above, ie

    617 658D E06B DDD alarm on
    617 658D E06B DCD66 alarm off

    Just check for 658d, if you have that you have the alarm word,then check for DDD, if you have then its on, if DCD then its off, if not any, its a user/sms/command error.

    Thats how I have mine working now.

    And sending a sms back is easy too, ie...

    serout portb.6,t1200,["atz",13] ' wake up thephone
    pause 500
    serout portb.6,t1200,["at+cmgs=",#ln,13] ' tell it we want to send a txt
    pause 2000

    serout portb.6,t1200,["0011000C91"] ' start of the pdu data


    for x=1 to 12 ' send it the destination phone number, 12 digits international format
    serout portb.6,t1200,[pduphn(x)]

    next


    serout portb.6,t1200,["00F0AD"] ' next part of header


    ' ****** Put all the above in a subroutine, every message you send will need the same header, all you need to send a different message is to change the next lines

    serout portb.6,t1200,["C8329BFD06DDDF723619"] ' hello world
    pause 9000 ' wait for phone to send


    You can just change the hello world to whatever you want, remember if you change the length, you need to tellthe phone the incoming data is a different length.

    use 'pdu spy' to create the pdu text you need.
    Last edited by f_lez; - 6th September 2006 at 10:59.

  6. #6
    Ziki's Avatar
    Ziki Guest


    Did you find this post helpful? Yes | No

    Default

    thx for the info ...sorry for late reply ....bz lately with exam .......in the #6 post u put :

    If buf(6)<>"4" then wait_for_command
    if buf(6)<>"1" then wait_for_command
    If buf(6)<>"7" then wait_for_command
    If buf(6)<>"6" then wait_for_command

    do i need to store the recieve message( Alarm arm 0AD09417658DE0685E56D
    )into the buffer 1st ...?

  7. #7
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Compleet command for sony & Siemens

    I think this help you, this is the compleet command list that work for picmicro.
    http://www.precision.net.in/picbasic...guidelines.pdf

    http://www.precision.net.in/picbasic...at_command.pdf

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ziki
    thx for the info ...sorry for late reply ....bz lately with exam .......in the #6 post u put :

    If buf(6)<>"4" then wait_for_command
    if buf(6)<>"1" then wait_for_command
    If buf(6)<>"7" then wait_for_command
    If buf(6)<>"6" then wait_for_command

    do i need to store the recieve message( Alarm arm 0AD09417658DE0685E56D
    )into the buffer 1st ...?

    Yes, make buf(XX) large enough for your longest message, but remember that a message has a huge 60 chars plus overhead, dont store those, you have to read them, but dont store them, and then simply read what you want with a for next loop.

    use serin with a timeout so if the message is short, it will keep going, and also if the message is short, you need to skip any further serin commands, IE






    for z=0 to 90
    buf(z)="*"
    next

    error_flag=0

    for n=1 to 20 digits

    get_back_in_loop:

    if error_flag=0
    SERIN portb.7,t1200,1000,comserr,combuf(z)
    endif

    next

    goto finished read


    comserr:

    error_flag=1

    goto get_back_in_loop

    finished_read:


    OK so we have now read the string in (in a dirty horrible looking way) so you can now process it as you need

    You will have to write another routine, to call (gosub) before that, to read the first 46 or so chars, then you can read the next 12 and save them as there are the originating phone number, you may want to check that for an authentic message sender, then dump another 20 as they are time/date etc, unless you want to do something with them.

    remember it screws phone numbers / time date etc up too, so a phone number of 1234 becomes 2143, stupid damn system.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 11:00
  2. HELP ME, SMS controlled relay using PIC
    By pazko1125 in forum mel PIC BASIC
    Replies: 14
    Last Post: - 2nd October 2008, 16:26
  3. Siemens c55 sms control help please
    By camolas in forum mel PIC BASIC Pro
    Replies: 85
    Last Post: - 20th August 2008, 02:13
  4. Motor Control PLC with a PIC
    By sougata in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 2nd November 2006, 08:59
  5. Need help on pic to pic flow control (simple problem I think)
    By khufumen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th January 2006, 01:34

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