Shop OBEX P1 Docs P2 Docs Learn Events
Javelin vs T630 II — Parallax Forums

Javelin vs T630 II

UllrottaUllrotta Posts: 12
edited 2004-11-25 07:23 in General Discussion
Hi!

What ascii character equals <ctrl-z> ?
I'm having problems getting my phone to execute the at+cmgs-command
after I've entered the message text. Works fine in HyperTerminal where
I can input the <ctrl-z> manually...


I realize this might be a little on the side of the forum, but hopefully
you can all handle it cool.gif

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-11-14 16:19
    ctrl-z has ascii value 26 decimal (or $1A hex).

    regards peter
  • UllrottaUllrotta Posts: 12
    edited 2004-11-15 16:51
    Thank you!

    burger.gif
  • UllrottaUllrotta Posts: 12
    edited 2004-11-15 20:57
    ... but I still can't get it working! AAargh!
    I get no feedback back from the phone. I know the program won't
    catch anything coming back from the phone before after the last
    AT-command has been executed, but there is nothing how ever I've tried.
    Is there anything visibly wrong with the code?

    import stamp.core.*;

    public class ModemTest
    {
    final static int SERIAL_TX_PIN = CPU.pin0;
    final static int SERIAL_RTS_PIN = CPU.pin1;
    final static int SERIAL_CTS_PIN = CPU.pin2;
    final static int SERIAL_RX_PIN = CPU.pin3;


    static Uart rxUart = new Uart( Uart.dirReceive,
    SERIAL_RX_PIN,
    Uart.dontInvert,
    SERIAL_CTS_PIN,
    Uart.dontInvert,
    Uart.speed9600,
    Uart.stop1);

    static Uart txUart = new Uart( Uart.dirTransmit,
    SERIAL_TX_PIN,
    Uart.dontInvert,
    SERIAL_RTS_PIN,
    Uart.dontInvert,
    Uart.speed9600,
    Uart.stop1);


    public static void main()
    {
    txUart.sendString("AT+CPMS=\"ME\"\r\n");
    CPU.delay(5000);
    txUart.sendString("AT+CMGF=1\r\n");
    CPU.delay(5000);
    txUart.sendString("AT+CMGS=\"99999999\"\r");
    CPU.delay(15000);
    txUart.sendString("Hello, World!\032");


    while (true)
    {
    System.out.println((char)rxUart.receiveByte());
    }
    }
    }
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-11-15 21:29
    Have you tried and checked that whatever is send from your main()

    is received by Hyperterminal?

    If that is so, then the bytes are transmitted correctly and

    there must be something missing/wrong in your protocol.

    regards peter
  • UllrottaUllrotta Posts: 12
    edited 2004-11-17 11:57
    I've connected the Javelin to my computer, and read the signal in both HyperTerminal and Advanced Serial Port Monitor. The commands get through allright, and when I connect the phone directly to the computer and copy the same commands that came from the Javelin back to the phone, it sends the message without a problem.

    What I have noticed, is this: in Advanced Serial Port Monitor there are three lights that indicate CTS (Clear To Send), DCD (Data Carrier Detect) and DSR (Data Set Ready). When the phone is connected to the computer all three are on, but when the Javelin is connected, only CTS is on.


    Any and all suggestions are welcome
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-11-17 12:21
    It may be the DTR signal from your phone (that connects to

    the DSR and DCD inputs) thst is toggled on/off by your phone

    during communication with your pc.

    Meaning: if DTR is set to off, the pc should not transmit.

    When DTR is on again, the pc may start sending.

    You can try to use the phone's DTR signal as handshake.

    I would directly connect the phones RTS and CTS

    (local handshake) and not use RTS handshake with the javelin.



    Uart rxUart = new Uart(dirReceive,pinRX,dontInvert,baud,stop);

    Uart txUart = new Uart(dirTransmit,pinTX,dontInvert,pinCTS,dontInvert,baud,stop);

    //connect phone DTR to Javelin pinCTS



    regards peter
  • UllrottaUllrotta Posts: 12
    edited 2004-11-24 21:39
    I'm not quite sure I understand what you want me to do.
    Please explain:
    DTR
    DSR
    DCD
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-11-25 07:23
    You said in your earlier message that DSR and DCD and DTR are on when
    you connect the phone to the PC. The DTR is an output from the PC. DSR
    and DCD are inputs to the PC, so the phone sends an ON signal to these
    pins. The PC's DSR and DCD·usually connect to the device's (ie. your phone)
    DTR pin. But do check your phone cable. I know other serial devices like
    serial printers often use their DTR pin for handshake. Maybe your phone
    does to. That means you must wait for an ON signal from the device DTR pin
    before you may send data to the device. You really need to check the manual
    for the protocol used plus timing charts if these are given. You need to know
    what pins are involved besides TX and RX. Contact the phone manufacter
    if you don't have all these details.

    regards peter.
    ·
Sign In or Register to comment.