Pic to GSM Phone connection (HSerin problems)


Results 1 to 40 of 289

Threaded View

  1. #11
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    @ Bulman


    I still can’t understand some of your ideas,
    therefore I rewrote your program in a way that I think it should be.
    --> My code example is a working program, have you given it a try?

    I wrote my questions like comments next to the lines which I can’t get. So could you please take a look and answer the questions.
    And do you think that this program could be used with all Nokia phones with embedded modems, or it’s for the 62xx series only?
    --> I have tested it on 62xx and 63xx series,
    --> according to the NOKIA documentation
    --> it should work on any model with embedded modem.



    --------------------------------------

    DEFINE OSC 20

    DEFINE HSER_TXSTA 24h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 115200
    --> I couldn't establish a reliable connection to the phone faster than 9600
    --> and 9600 is certainly fast enough to transfer those few bytes

    DEFINE HSER_CLROERR 1

    GSMbuffer var Byte [12]
    Caller var Byte [12]
    GSMtime var Byte [17]


    ‘Check the connection between the phone and PIC works. Should ‘give OK. Instead you’ve used ATZ, why?
    --> You are right, a simple AT would do the same job at this point

    Hserout [“AT”, 13, 10]
    Pause 1000

    HSerout ["AT+CMGF=1", 13, 10] 'Set Text Mode. Answer: OK
    Pause 500

    Hserout [“AT+CMGS=”, 34, “+359888123456”, 34, 13, 10] ‘Answer: >
    ‘Why have you put “,129” in addition. I think it’s not nessesary.
    --> "129" is the "TYPE" (See NOKIA AT COMMANDS)

    Pause 500

    Hserout [“Test-message”, 13, 10]

    ‘Terminate the SMS by Control+Z
    ‘Here you send ASCII 26 => SUB. Is it equal with CTRL+Z?
    Hserout [26]
    --> ASCII 26 is equal to CTRL+Z

    ‘Answer: +CMGS: 125 - the ord. number of the SMS (0-‘255)
    Pause 500

    ' Check for new incomming Messages

    HSerout ["AT", 13, 10] ‘Check the connection
    Pause 1000

    HSerout ["AT+CMGF=1", 13, 10]
    Pause 1000

    Loop:
    ‘list new unread messages
    Hserout [“AT+CMGL=”, 34, “REC UNREAD”, 34, 13, 10]
    --> Lists all unread (new) messages
    ‘Optionally: "REC READ", "ALL"
    --> I'm only interested in new "UNREAD" messages
    --> already processed MSGs have been deleted

    ‘Or it must be HSerout ["AT+CMGL",13,10] ?

    ‘Answer in 3 lines should look like this:
    ‘+CMGL: 1,"REC UNREAD","+359888123456",,"04/07/21,08:03:05-00"
    ‘Test-message
    ‘OK

    HSerin 5000, Loop, [Wait("UNREAD"), skip 3, STR Caller\12, skip 4, STR GSMTime\17, skip 4, STR GSMbuffer\12]
    ‘You ‘ve written skip 6 before STR GSMuffer\12 but I think it ‘should 'be skip 4?
    --> There are two additional bytes to be skipped at the end of the first line (CR LF)

    Then you used GSMBUFFER\16\13, which must be 'GSMbuffer\12. Am I right?
    --> I did want to read the first 16 chars of the received message, --> GSMbuffer\16

    What \16\13 does mean?
    --> See PBP Manual Section 5.30
    --> stop reading if chr(13) is received if no chr(13) read max 16 chars


    ' --- Put your code to output the result here

    ' i.e. LCDOUT . . . .

    ‘Delete the processed SMS:
    Hserout [“AT+CMGD=1”, 13, 10]
    --> This is exactly what I would do after the MSG has been processed

    Goto Loop

    --------------------------------------
    regards
    Last edited by NavMicroSystems; - 21st July 2004 at 20:59.

Similar Threads

  1. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 00:52
  2. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  3. problem with the GSM controller
    By Dariolo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th May 2009, 20:33
  4. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 07:57
  5. Pic to GSM Phone connection
    By samertop in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th July 2005, 13:40

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