Thread: Sending '+++' to serial port

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    37

    Sending '+++' to serial port

    OS: Linux Debian Lenny
    IDE: Code::Blocks

    Hello guys,

    I really have an issue with sending '+++' to a GSM module through serial port. All the other AT commands are sent successfully, except that damn '+++'. This triple '+' is needed to tell the GSM module to bridge so the data is passed to another serial port device.

    How am I sure that other AT data is sent successfully? Well, because for every AT command I send, I receive a repsonse. Normally a '+++' sends back a response of another serial port device. I have tested it with minicom (a serial port app) and sending '+++' works ok there. But from a C program it's not working. I'm kind of desperate now, cause I don't know what's the problem.

    Another thing to mention, it just doesn't send somehow. I don't think '+' has a special meaning.

    I hope you guys can give me some good tips.
    Thank you.
    Last edited by Andaluz; 01-20-2011 at 08:24 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    +++ has two meanings, depending on how quickly you send it.

    Testing it "slow speed" using minicom, you get one answer.

    From a program, it gets sent a lot quicker, and the meaning changes.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    37
    Thanks for your reply, but even slow sending didn't work.
    This is rediculous, that's so wrong, what's the difference between a '+' character and alphabetical character? It's all data...I'm about having a heart attack here.

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Wild guess based on no evidence whatsoever:
    make sure your quotes are right (i.e. sending '+' not "+" or '+++', which should give a warning anyway)

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    37
    Thank you Thank you Thank you Thank you very much for your help guys!
    Salem was right, adding some pauses between the '+' did indeed help to solve the problem!

    Tabstop, you are right also, cause my latest modification was wrong. Well if I get desperate, my coding gets worse too because of frustrations. But I was working on a system which has no network connection for some reasons, so I couldn't copy paste the code here.

    The problem in our organization is communication. A colleague had implemented the '+++' stuff in an embedded device, but didn't tell me that he needs a few hundreds ms to process another serial port event. Which means, if he gets the '+' too fast, he won't do anything.

    I learnt another important lesson and your help is very valuable, thank you very much.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Modem AT Command Set
    Hayes command set - Wikipedia, the free encyclopedia
    These talk about a pre and post delay. I'm not sure about the intra-character delay between each +

    Anyway, good job on getting there.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Comodo Firewall Vulnerability (Port 0)
    By Mario F. in forum Tech Board
    Replies: 0
    Last Post: 11-11-2009, 08:56 AM
  2. sending streams over serial port in win32
    By deian in forum C Programming
    Replies: 2
    Last Post: 07-13-2009, 12:01 PM
  3. serial port to poll on request
    By infineonintern in forum C++ Programming
    Replies: 2
    Last Post: 06-11-2009, 06:52 AM
  4. sending data over UDP from serial port
    By forumguy in forum Linux Programming
    Replies: 0
    Last Post: 04-25-2009, 02:10 PM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM