Gsm/Gps Tracker


Closed Thread
Results 1 to 40 of 53

Thread: Gsm/Gps Tracker

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    Camola, try the following:

    Use a larger array in such a way that you can accomodate the calling string in the initial part of the array:

    Arry[0]=65
    Arry[1]=84
    Arry[2]=43
    Arry[3]=67
    Arry[4]=77
    Arry[5]=71
    Arry[6]=83
    ArrY[7]=43

    The above sequence contains the string AT+CMGS=+

    Than you tranfer the sender number (12 bytes) in Arry[8] to Arry[19]. Remember that last byte should always be Arry[20]=13
    At this point you can make the call:


    Al.
    Hi,

    Can you please explain this part i do not now how i will put the numbers that i get from the array "numero" to the "Arry" one in ascii.

    Thanks,

    Xau

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Look the ASCII table

    A=65
    T=84
    and so on

    the above could also be written like...

    Code:
    Arry[0]="A"
    Arry[1]="T"
    // etc etc etc
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Not sure if this will help you now or not, but it might.
    http://www.picbasic.co.uk/forum/showthread.php?t=544
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Camolas, The array "numero" contain the string so:

    For A0=8 to 19
    arry[A0]=numero[A0-8]
    next A0
    Arry[20]=13

    But you can put the value directly in arry[8] to arry[19] instead to put it in the array "numero"

    Al.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Its final and full working code, any questions please asck.



    Code:
    --------------------------------------------------------------------------
    @ Device HS_OSC
    define OSC 20 ' Check the spelling of OSC, must be in capital letter

    Include "modedefs.bas" ' Include serial modes

    Define LCD_DREG PORTD
    Define LCD_DBIT 4
    Define LCD_RSREG PORTD
    Define LCD_RSBIT 3
    Define LCD_EREG PORTD
    Define LCD_EBIT 2
    Define LCD_COMMANDUS 2000 ' Command Delay (uS)
    Define LCD_DATAUS 50 ' Data Delay (uS)
    DEFINE LCD_LINES 2 '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

    LCDOut $FE, 1

    Clear
    sms var byte[10]
    numero VAR BYTE[12]
    Lat var byte[11]
    Long var byte[11]

    TrisB.7=0 ' LIGA GSM
    TrisB.6=1 ' IGNIÇÃO
    TrisB.5=1 ' SENSORES
    TrisB.4=0 ' FEXA PORTAS
    TrisB.3=0 ' PISCAS
    TrisB.2=0 ' IMOBLIZA
    TrisB.1=0 ' ?????????????
    TrisB.0=0 ' LED OK VERDE

    TrisC.4=1 ' RX BT
    TrisC.5=0 ' TX BT
    TrisC.6=0 ' TX GSM
    TrisC.7=1 ' RX GSM

    TrisD.1=1 ' RX GPS

    Low PortB.1
    Low PortB.2
    Low PortB.3

    Inicio:
    Low PortB.0
    Pause 500
    High PortB.0
    Pause 500
    Low PortB.0
    Pause 500
    High PortB.0 'pisca 3 vezez e desliga
    Pause 500
    Low PortB.0
    Pause 500
    High PortB.0
    Pause 500
    Low PortB.0
    Pause 2000

    UM:
    Low PortB.1
    HSEROUT["at",13,10]
    HSERIN 10000,UM,[WAIT("OK")]
    LCDOut $FE, 1,"ON"
    HIGH PortB.0

    DOIS:
    serin2 portD.1, 188, [WAIT("$GPRMC,"),skip 13, STR LAT\11,skip 1, STR Long\12]
    High PortB.1


    HSEROUT["AT+CMGF=1",13,10]' Modo Texto
    HSERIN 10000,UM,[WAIT("OK")]
    LCDOut $FE, 1,"ok"

    HSEROUT["AT+CMGR=1",13,10] ' Ler sms
    HSERIN 5000,UM,[WAIT("REC UNREAD"),skip 3, STR numero\13,skip 27,STR sms\10]


    IF sms[0]="S" and sms[1]="t" and sms[2]="o" and sms[3]="p" Then
    goto Tranca
    Endif

    IF sms[0]="C" and sms[1]="e" and sms[2]="l" and sms[3]="i" and sms[4]="a" Then
    goto Destranca
    Endif

    IF sms[0]="P" and sms[1]="o" and sms[2]="s" Then
    goto PO
    Endif

    Goto APAGA

    Tranca:
    High PortB.3 'Piscas
    Pause 500
    High PortB.2 ' Imobliza
    Goto PO

    Destranca:
    Low PortB.3 'Piscas
    Low PortB.2 ' Imobliza
    Goto APAGA

    Liga: ' LIGA GSM
    High PortB.7
    Pause 20000
    Goto UM

    PO: ' Enia localizacao
    HSEROUT["AT+CMGS=",34,STR numero, 34,13]
    hserin 10000,PO,[WAIT(">")]

    Lo:
    HSEROUT["LAT: ",LAT (10),"-", LAT, lat (1),"'",lat (2),Lat(3),".",lat (5),lat(6),lat (7),lat(8),$fe,$c0,"LON: ", Long(11),"-", Long (1),long (2),"'",Long (3),long (4),".",Long (6),long (7),long(8),long (9),13,10]
    hserin 10000,lo,[WAIT(">")]

    Li:
    HSEROUT[26]
    hserin 10000,li,[WAIT("OK")]


    APAGA:
    HSerout ["AT+CMGD=1",13,10]' apaga sms 1
    hserin 10000,APAGA,[WAIT("OK")]
    HSerout ["AT+CMGD=2",13,10]
    Pause 5000
    goto Inicio


    End
    --------------------------------------------------------------------------


    Thanks for all the help that you gave me.


    Xau.

  6. #6
    Join Date
    Jul 2006
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Your code must hang if there is no enough deposit on the sim card, alternativelay u can see gsm network connectivity available for make more reliable the sms dispachting, i don't know how that cell phone works but if it has log for sms in areas without gsm coverage and the pic still in the Lo loop, once you are back on GSM coverage, simply alll your deposit can be wasted in several hundred SAME message !!

    but . . . is just my point of view...
    Last edited by bethr; - 1st December 2008 at 04:27. Reason: spell

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bethr View Post
    Your code must hang if there is no enough deposit on the sim card, alternativelay u can see gsm network connectivity available for make more reliable the sms dispachting, i don't know how that cell phone works but if it has log for sms in areas without gsm coverage and the pic still in the Lo loop, once you are back on GSM coverage, simply alll your deposit can be wasted in several hundred SAME message !!

    but . . . is just my point of view...
    Hi,

    Thanks for the inputs, for the deposit there is no problem because in my code i delet the "REC UNREAD" sms

    "APAGA:
    HSerout ["AT+CMGD=1",13,10]' apaga sms 1
    hserin 10000,APAGA,[WAIT("OK")]
    HSerout ["AT+CMGD=2",13,10]
    Pause 5000"

    The gsm coverage is very good point that you have made it need to be changed in a futer update.


    I have been in a wardware problem now this works very good in a QL200-A4 board but in my home made pcb not (some times works some not..) the pic cant get the phone Tx (i see it in hyperterminal that phone gets the pic Tx e reply but pic cant get it) i have put a 10K pulldown and up in phones Tx but no sucess.Need hellp on that if you mates can hellp me thanks.

    Xau.

Similar Threads

  1. solar tracker controller
    By CIRE in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 15th November 2016, 15:16
  2. Help Idea Off infrared tracker
    By jetpr in forum General
    Replies: 5
    Last Post: - 11th September 2008, 08:22
  3. Replies: 1
    Last Post: - 27th July 2008, 06:14

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