Pic to GSM Phone connection (HSerin problems)


Closed Thread
Page 1 of 3 123 LastLast
Results 1 to 40 of 289

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61

    Question Pic to GSM Phone connection (HSerin problems)

    Hi!

    I am trying a project of remote control (SMS) using 16f628 connected to an Ericsson T10 mobile phone.
    My problem is with the serial communication with the phone
    I have tried everyting from software Serou/Serin to HSERIN/HDEROUT using build-in f628 USART.
    Although Sending AT commands is ok receiving the reply from the phone is very difficult.
    I think the phone response is too uick for picbasic to receive the stirng. What is your opinion. Is it possible from PBP Pro to cath-up the receiving data from the mobile?
    (Using 9600,8,n,1) with no rs232-drivers - with inverted/noninverted modes -the same problem

    Any ideas?

    P.S: I have developed a PDU decoded with the pic. If it works properly I may public the code

    Thank you all Pic-maniacs! )

  2. #2
    mcglacy's Avatar
    mcglacy Guest

    Default

    It is difficult to use Ericsson try to use Nokia Phones..

    try to visit this site maybe it can help you..

    www.embedtronics.com

  3. #3
    Mikkel's Avatar
    Mikkel Guest

    Smile SMS and Pics

    Hi I have had the same problem, mobiles are sometimes to fast

    I use the GSM engine TC 35 from siemens they can run Normaly text but run to fast for a pic too.

    so put in a larger crystal (8mhz)

    set up your programmer to HS

    if your settings is 9600 chose 2400 baud because at 8 MHZ it goes to faster
    I use serin and a timeout seqenze so i can find the end of the message

    If your modem can deal with slower speed auto matically
    try to send some AT AT at a lower speed 1200 Baud

    You won't fell the differnce since SMS messages are so short.


    Best regards Mikkel Holm
    I

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

    Default

    I may help you but please give some more details, as what do you expect to receive from the phone and what do you receive?

    Most of the times is a matter of sync problem.

    Ioannis

  5. #5
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    I have tried it using a NOKIA Phone and it works fine.

    The Phone is connected to the HW-USART via MAX232
    Baudrate: 9600 8N1

    You need a clock spped of minimum 8MHz
    (I'm using a 12MHz resonator)

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

    DEFINE OSC 12

    DEFINE HSER_TXSTA 20h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1

    GSMBUFFER VAR BYTE[16]
    Caller VAR BYTE[13]
    GSMTime VAR BYTE[17]


    'Send SMS Test-Message

    HSerout ["ATZ",13,10]
    Pause 1000

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

    HSerout ["AT+CMGS=",34,"+491232456789",34,",129",13,10]
    Pause 500

    HSerout ["Test-Message",10,13]
    HSerout [26]
    Pause 500

    ' Check for new incomming Messages

    HSerout ["ATZ",13,10]
    Pause 1000

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

    Loop:

    'List new Messages
    HSerout ["AT+CMGL",13,10]

    ' Read Caller ID, time and 16 CHARs of Message

    ' The timeout value in the HSERIN statement is important, it takes some time before the phone replies to the AT+CMGL command

    HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

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

    ' i.e. LCDOUT . . . .

    Goto Loop:

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

    There are certainly better ways to do the job, this was just a quick test and it works

  6. #6
    Join Date
    Apr 2005
    Posts
    17

    Question

    Quote Originally Posted by NavMicroSystems
    I have tried it using a NOKIA Phone and it works fine.

    The Phone is connected to the HW-USART via MAX232
    Baudrate: 9600 8N1

    You need a clock spped of minimum 8MHz
    (I'm using a 12MHz resonator)

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

    DEFINE OSC 12

    DEFINE HSER_TXSTA 20h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1

    GSMBUFFER VAR BYTE[16]
    Caller VAR BYTE[13]
    GSMTime VAR BYTE[17]


    'Send SMS Test-Message

    HSerout ["ATZ",13,10]
    Pause 1000

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

    HSerout ["AT+CMGS=",34,"+491232456789",34,",129",13,10]
    Pause 500

    HSerout ["Test-Message",10,13]
    HSerout [26]
    Pause 500

    ' Check for new incomming Messages

    HSerout ["ATZ",13,10]
    Pause 1000

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

    Loop:

    'List new Messages
    HSerout ["AT+CMGL",13,10]

    ' Read Caller ID, time and 16 CHARs of Message

    ' The timeout value in the HSERIN statement is important, it takes some time before the phone replies to the AT+CMGL command

    HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

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

    ' i.e. LCDOUT . . . .

    Goto Loop:

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

    There are certainly better ways to do the job, this was just a quick test and it works
    This is my first post..pls be gentle..
    Will this code applicable to PIC16F84A using an 8 mhz xtal?

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

    Talking

    you'll have to do some modification before. Ralph's favourite 16F84a have no internal USART. Wich mean that, at least, you'll need to change HSEROUT, HSERIN for an equivalent SERIN,SERIN2,SEROUT,SEROUT2

    Once it will be done... it's suppose to work fine.
    Steve

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

  8. #8
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Quote Originally Posted by mister_e
    ..,Ralph's favourite 16F84a have no internal USART. Wich mean that, at least, you'll need to change HSEROUT, HSERIN for an equivalent SERIN,SERIN2,SEROUT,SEROUT2
    Steve, thanks for the reminder ;-)

    As you can see, many beginners are giving themselves a hard time by starting with that "great" F84 while life could be so easy with one of the recent 18pin types.

    I guess one of the reasons is because my favourite is mentioned in so many (outdated) books and manuals.

    (Even in the lastest issue of the PBP Manual)
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



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

    Talking

    Ralph,
    in addition to that, this awesome F84 is one of the first flash device from Microchip and can still be found everywhere and at local electronic parts provider... like 12C508

    for the remainder, you know why i did it
    Last edited by mister_e; - 20th April 2005 at 04:01.
    Steve

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

  10. #10
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61

    Default Tex node support on Nokias

    NavMicroSystems thanks!

    I think I will go for Nokia phone as it would be better to handle!
    Anyway does al Nokia supports Text mode or only PDU format?

    P.S I have a PDU decode routine available -as soon as I will try it out I will make the code available.

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

    Default Re: Tex node support on Nokias

    Originally posted by bitmaniac
    NavMicroSystems thanks!

    I think I will go for Nokia phone as it would be better to handle!
    Anyway does al Nokia supports Text mode or only PDU format?

    P.S I have a PDU decode routine available -as soon as I will try it out I will make the code available.
    @ bitmaniac

    As far as I know do all NOKIA phones with embedded Modem support the text mode.
    I have successfully tested it on 62xx and 63xx series.

    The TEXT mode is easier to handle than PDU mode and it certainly saves some code space.

    anyway: I am interested in your PDU encoding / decoding routines.

    rgds

  12. #12
    Join Date
    Oct 2003
    Location
    Cyprus
    Posts
    12

    Post Pic to GSM Phone connection (HSerin problems)

    Hi people,
    I had implemented an interface with Ericsson and a 16F628 that worked fine.
    I used a T65 model and pin 4 on the RS232 connector has to be driven high for the phone to accept and issue responces. For other models this can be different. Appart from pin 4, I used 3 more pins, Ground, TX and RX.
    I used PDU mode due to the Ericsson and the fact that, any phone can be interfaced with virtually only hardware modifications.
    I sample of my code is shown below:

    @ DEVICE pic16F628, HS_OSC
    ' ---- High Speed Oscilator
    @ DEVICE pic16F628, WDT_OFF
    ' ---- Watchdog Timer=OFF
    @ DEVICE pic16F628, BOD_ON
    ' ---- Brown-Out Detect
    @ DEVICE pic16F628, LVP_OFF
    ' ---- Low-Voltage Programming=OFF
    @ DEVICE pic16F628, MCLR_OFF
    ' ---- Reset Pin=Internal
    @ DEVICE pic16F628, PWRT_ON
    ' ---- Power-On Timer=Disabled
    @ DEVICE pic16F628, CPD_OFF
    ' Data Memory Code Protect
    ' Set to CPD_OFF for Development Copy
    @ DEVICE pic16F628, PROTECT_OFF
    ' Program Code Protection

    INCLUDE "modedefs.bas"

    ' ******* Definitions *******
    ' ------------------------------

    DEFINE OSC 16 ' Define clock Oscillator Frequency at 16Mhz
    DEFINE HSER_RCSTA 90H ' Enable Hardware USART receive
    DEFINE HSER_TXSTA 24H ' Set Hardware USART parameters
    DEFINE HSER_BAUD 9600 ' Set baud rate to 9600
    define HSER_CLROERR 1
    CMCON=%00000111 ' Make PortA digital

    ' ****** Initialise PORTs ******
    '----------------------------------

    TRISA = %11110000 'Set PORTA status (Low byte=Output, for LEDs)
    TRISB = %11100010 'Set PORTB status
    PORTA = %00000000 ' Initial state of PORT A
    PORTB = %00000000 ' Initial state of PORT B

    ' ****** Variables ******
    '---------------------------

    TXD VAR PORTA.0 ' Phone not responding
    RXD VAR PORTA.1 ' Transmit to Phone
    error VAR PORTA.2 ' Receive from Phone
    deb var PORTA.3 ' Debugging led
    relay0 VAR PORTB.3 ' First Relay
    relay1 VAR PORTB.4 ' Second Relay
    CALLER var byte[8] ' Callers ID Array
    INSMS VAR BYTE[8] ' Incoming SMS message Array
    cr con 13 ' Carriage Return character
    lf con 10 ' Line Feed character
    j var byte


    goto start ' Jump to Main Program

    ' ****** SUBROUTINE AREA ******
    ' -------------------------------

    meminit:
    ' Instract Phone to use it's own memory for storage and SMS manipulations
    TXD = 1 ' Tx LED=ON
    HSerout ["AT+CPMS=",34,"ME",34,44,34,"ME",34,44,34]
    HSerout ["ME",34,cr] ' Command AT+CPMS="ME","ME","ME"
    Pause 600
    TXD = 0 ' TX LED=OFF
    return

    Some other ROUTINES reside here.......

    ' ****** MAIN PROGRAM AREA ******
    ' ----------------------------------

    Start:
    PAUSE 1000
    TXD = 1 ' Tx LED=ON
    HSerout ["at",cr] ' <----- Check for Phone presence
    RXD = 1 ' Rx LED=ON
    HSerin 400,nophone,[wait ("OK")]
    Pause 500
    TXD = 0 : RXD = 0 ' Tx & Rx LEDs=OFF

    TXD = 1
    hserout ["AT+CMGF=0",cr] ' <----- Initiate PDU Format
    pause 400 ' Not needed for Ericsson Phones
    ' hserout ["ATE0",cr] ' <----- Turn Echo OFF
    ' pause 200
    TXD = 0

    Gosub meminit ' <----- Initialise Phone's SMS memory

    TXD = 1
    hserout ["AT+CSAS",cr] ' <----- SAVE SETTINGS
    PAUSE 400
    TXD = 0

    ' ++++ Read from Phone ++++
    ' -------------------------
    GOSUB meminit
    pause 3000
    TXD = 1
    HSerout ["AT+CMGL=0",cr] ' <----- Read Received and Unread Incoming messages.
    TXD = 0
    pause 2
    RXD = 1
    Hserin 800, msg_old , [wait ("+CMGL:")] ' If no +CMGL then no new SMS was read
    hserin [skip 36, str caller\8 , skip 20, str insms \8]
    RXD = 0
    'GOSUB eepwrite
    gosub meminit ' <----- Initialise Phone's SMS memory
    hserout ["AT+CMGD=1",cr] ' <----- Delete the "read message" (First SMS)
    pause 200


    I do not decode the PDU but I use it ready made All the messages were sent and read from phone via HyperTerminal. The resulting PDU coded message was used. an example is shown below.

    ++++ An Unrecognised command was received ++++
    ' ----------------------------------------------
    PAUSE 400
    GOSUB meminit
    TXD = 1 : deb = 1 : PAUSE 500
    HSerout ["at+cmgs=33",cr] ' Intraction to Phone to send SMS in PDU mode
    Pause 500 ' "Unrecognised Command" Message
    HSerout ["0011000B915397490185F80000AA1455B7BC3C7E9FDDE97999 0C1ABEDBEDB09BEC02",26,cr,lf] ' PDU message of 33 bytes.


    I hope that I helped a bit
    Regards

    Kypros V.

    P.S. If you developed a PDU decoding code I woould appriciate if you share it.

  13. #13
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18

    Default

    hi,

    is there any AT COMMAND to check the time of a nokia 6210.


    thanks,
    brenda

  14. #14
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Hi Brenda,

    unfortunately there is no such AT-command.

    If your intention is to set an RTC on your PIC-board connected to the Phone you could do the following:

    as soon as you have received a new SMS-message write your RTC-time to some variables.

    now you have got plenty of time to decode the SMS-message.
    The message header contains the time it was delivered by the server.
    comparing this to your RTCs time gives you the offset you need to correct the RTC.

    This is certainly not perfect in terms of accuracy, but far better (+/- 1 min) than the long term accuracy of an RTC with a non-compensated clock.

    rgds.

  15. #15
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18

    Default

    thanks! That was a good idea which I didn't think off. I'll try it today.

    regards,

  16. #16
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61

    Default Pic pdu encoding/decoding code

    finally here is the forum linkfor the pdu encoding.decoding routine for anyone that is interested

    http://www.picbasic.co.uk/forum/show...=&threadid=305

  17. #17
    Join Date
    Oct 2003
    Location
    Cyprus
    Posts
    12

    Cool

    Many many thanks bitmaniac.
    Regards
    Kypros

  18. #18
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Thanks bitmaniac !

    I'll give it a try this weekend.

    rgds

  19. #19
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18

    Default Flash SMS

    Anybody knows at command for Flash SMS.. i.e.. recipient will recieve tha sms direct to screen without opening it.

    Thankx!
    Brenda

  20. #20
    Join Date
    Oct 2003
    Location
    Cyprus
    Posts
    12

    Cool

    Hi brenda,
    There is no AT command for this. You have to use PDU mode in order to send FLASH SMS. First you must undertand how PDU works, then you should know that this function is not supported by all phones.

    Try http://www.traud.de/gsm/ and http://www.dreamfabric.com/sms/
    for more information on Flash messaging and PDU mode.

    Regards
    Kypros

  21. #21
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18

    Default

    hi kypros,

    thanks for the info. I think I have to study Pdu format as what you and everybody recommend. Nice site!!! thanks again!

    brenda

  22. #22
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Dear Forum Members,

    I will defititely no longer reply to any PM's regarding this thread.

    All information you need to get started can be found here.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  23. #23
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Again:

    Please stop sending PMs asking: would Phone Model X work?

    I definitely don't know all brands and models available on the market.
    And I don't know the pinouts of all those different connectors.

    Further down on this thread there is a working code example that can easily be modified for a different PIC type or Phone type.

    If the documentation of your specific phone says it has an embedded modem you should be able to get it working.

    First try it in Hyperterm, it doesnt make much sense to hook the GSM up to the PIC as long as you havent figured out what the Comms parameters should look like.

    If you try the code example with a phone other than mentioned in that posting chances are it will work, but YOU will certainly have to do some homework.
    (I'm not going to do it for you)

    I'm sure if you google for your particular phone model you will find more descriptions of connectors and interfaces than you'll ever need.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



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

    Default

    For some pinout, i think, i'm not familiar with this kind of task, you can find about everything on GsmForum
    Steve

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

  25. #25
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18

    Default Smart Car Buddy

    Hi,
    Visit picbasic.org/forum, I've seen a very nice project.

    Brenda

  26. #26
    aruran's Avatar
    aruran Guest

    Default Schematic

    According to Stu's post (#49). I am indeed need of that modified circuit. Can I do it for Nokia 7250i. Since the MBUS pins are connected.


    thanks in advance
    aruran

  27. #27
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18

    Default

    Hi kyprus and everybody,

    Well, Its really hard to understand PDU format but I manage to understand it. Now I can send a Flash SMS. Cheers!!!! I found a nice PDU converter by Peter Sandstrom.

    http://www.spaceorbit.net/peter/proj...rk1/index.html

    Another question:
    How about sending Picture message?

    Regards,

    brenda

  28. #28
    Join Date
    Mar 2004
    Posts
    74

    Default SMS

    I have tried sending a SMS on a nokia 6210 with a 16f84A ( only micro I had at the time) the osc was only at 4MHz. As I was only sending AT commands I thought it would be ok. The sequence seems to hang before the SMS is completed. Has anyone tried this with a 16f84a at 4MHz?

  29. #29
    Join Date
    Oct 2003
    Location
    Cyprus
    Posts
    12

    Default

    Hi Darrenmac,
    how do you determine tha the sequence hangs?
    I sugest that you send a simple AT command and capture the answer as a first step.
    In my code example as published is:
    HSerout ["at",cr] ' <----- Check for Phone presence

    HSerin 400,nophone,[wait ("OK")]
    Pause 500

    Just convert it to SEROUT and SERIN commands since 16F84 does not have a hardware USART.
    In the above example, a sent an AT command followed by a Carriage Return character and then waited for 400 ms for the phone to respond with an “OK”. If within the 400 ms there is no answer (meaning that the phone does not respond) then program execution would continue at label “nophone” where I use a small code to indicate phone absence.

    Further to the above, I suggest you test communication at various speeds, baud rates. Try 9600 which is the standard and on unsuccessful results move down to lower speeds.
    You can also check your cable connection or the levels on your RS232 interface. Also check if you need to use True or Inverted mode in your SEROUT lines.
    I haven used the 16F84 but I cannot see any reason why it should not work ok.

    Regards
    Kypros

  30. #30
    Join Date
    Mar 2004
    Posts
    74

    Default

    Thanks for the advice Kypros, I found the problem to be the lack of a comma. I found the program to be hanging by add in a couple of leds and some toggle commands between at commands.
    I used the debug command instead of the serout as I could not get the serout to work properly for some strange reason.

  31. #31
    Bulman's Avatar
    Bulman Guest

    Default

    Hi.

    Where can I find the Nokia protocol? I can't understand what are the AT commands for? Where can I find a comprehensive info about the commands like:
    AT
    AT+CMGF=1
    AT+CMGL
    ATZ
    AT+CMGS
    etc.
    I would like to understand the NavMicroSystems's program, but I can't without the protocol.
    Please give me some usefull links, bacause I would also like to control my PIC with a SMS.

    Thanks

  32. #32
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    GOOGLE:

    NOKIA AT COMMANDS

    and you will find all you need.

    rgds.

  33. #33
    Bulman's Avatar
    Bulman Guest

    Default

    Hi NavMicroSystems

    Thanx for the point.
    I still can’t understand some of your ideas, therefore I rewrote your program in a way that I think it should be. 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?

    Regards



    DEFINE OSC 20

    DEFINE HSER_TXSTA 24h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 115200
    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?

    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.

    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]
    ‘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]
    ‘Optionally: "REC READ", "ALL"
    ‘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? Then you used GSMBUFFER\16\13, which must be 'GSMbuffer\12. Am I right? What \16\13 does mean?

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

    ' i.e. LCDOUT . . . .

    ‘Delete the processed SMS:
    Hserout [“AT+CMGD=1”, 13, 10]

    Goto Loop

  34. #34
    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.

  35. #35
    Bulman's Avatar
    Bulman Guest

    Default

    Thank you very much NavMicroSystems.
    I'm gonna bye a Nokia and do some test.

    Thanx again.
    Bye.

  36. #36
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    @ Bulman

    before you buy a mobile phone
    you should have a look at at the SIEMENS TC35i GSM Terminal.
    It is more reliable and has more features.
    (i.e. remote reset and remote power on/off)

    The TC35i is available at about 150 EUR (or even less)

    see: siemens.com.

    rgds.

  37. #37
    LazBoy's Avatar
    LazBoy Guest

    Default Hyper Terminal & GSM AT

    Hi,

    I have Nokia 7110 and MBUS/FBUS dual data cable.
    (home made) I can use some Nokia GSM control
    softwares with it. (Oxygen Phone Manager, LogoManager etc)

    But, when I want to use with Hyper Terminal for AT commands,
    the phone does not answer. I am planning for secure use with
    PIC mController. But after PC tests.

    What is the wrong ? Any idea for this ?

  38. #38
    Join Date
    Mar 2004
    Posts
    74

    Default

    sounds like the data lead is working in one mode but not the other. I have 2 seperate cables, the one I use for Logo manager is different from the one I use for sms or interconect connection

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

    Default

    May be if you type the ATE1 command enables the echo?

    Ioannis

  40. #40
    LazBoy's Avatar
    LazBoy Guest

    Default Nokia 7110

    I just learned that Nokia 7110 has not an embedded modem.
    A software driver or DLR-3P cable required.
    I am planning to use Siemens C55.
    Thanks,

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