Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
Hi, sorry for my english I try to get data from a serial port on /dev/ttyS*. my serial port is open and all is good but when the data arrived ...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Location
    Toulouse-France
    Posts
    7

    Exclamation read : I/O possible

    Hi, sorry for my english

    I try to get data from a serial port on /dev/ttyS*.
    my serial port is open and all is good but when the data arrived on the input, i have te following message and my application down.

    "I/O possible"

    I have configured my serial port in asynchronous, VMIN = 100, VTIME=0.
    have you any idea about my problem?

    (my application get GPS data on this serial port)

    thank's a lot for your answer

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    What language are you programming in? C?
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Just Joined!
    Join Date
    Jul 2008
    Location
    Toulouse-France
    Posts
    7
    my programmation language is the C, I have test on a linux Debian distibution and on the target, cross compillation with arm-linux-gcc.

    my EDI is Eclipse

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    When you say you have the message "I/O possible", do you mean that your program is outputting that message? If so, it's because you put the code there to do that. So the next question is: how do you get to that point in your code? Can you show us a relevant piece of your code?

    (To make it easy to read, when you've pasted it in your edit buffer, please highlight the code and click the octothorpe (the # icon) at the top of your edit window.)

    But if your program is not itself outputting "I/O possible", I don't know what to say.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  5. #5
    Just Joined!
    Join Date
    Jul 2008
    Location
    Toulouse-France
    Posts
    7
    When you say you have the message "I/O possible", do you mean that your program is outputting that message? If so, it's because you put the code there to do that.
    I don't say that from my program, in my program I have et simple
    Code:
    read (my_file_descriptor_not_NULL, My_buffer, 100);
    the read on my file descriptor is not O_NONBLOCK so while i have no data in my serial port input, all is ok, I'm stoped.

    but when I have data, I have the line "I/O possible" and the program is exited!!
    I WOULD MY DATA lol, not the information about they are here

    I put my code tomorow morning (I'm french, it's 10h pm).
    Last edited by Galadrin; 07-21-2008 at 09:52 PM. Reason: a little fault of english

  6. #6
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    The message "I/O possible" has to come from somewhere: if not in your C program, then in some library you call.

    Please know that VMIN = 100, VTIME=0 means don't return until 100 bytes have been input. Is that your intent?
    --
    Bill

    Old age and treachery will overcome youth and skill.

  7. #7
    Just Joined!
    Join Date
    Jul 2008
    Location
    Toulouse-France
    Posts
    7
    yes I would this fonctionnement, I receive a lot of GPS data from my receiver, and I don't have a continuous iteration of read for keep some times for my other thread (she print GPS statistic on the screen).

    my issue is realy in the read return, I don't know why he kill my application after "I/O possible" print.... it's not documented

  8. #8
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    my issue is realy in the read return, I don't know why he kill my application after "I/O possible" print
    If you write a small program which does nothing but this:
    1. open the serial port
    2. read one byte
    3. print out that byte in hexadecimal ("%X\n" format)
    4. exit your program

    it would be interesting to see whether you get "I/O possible". It's almost certain you won't get that message.

    Then input 100 bytes instead of one byte. See whether the message appears.

    Continue to make the program more and more like your original program. When the "I/O possible" message appears after changing your program, it's probably your most recent change that causes that message to appear.

    I know this isn't terribly helpful, but there's more going on here than just the read(), and this will help isolate the problem.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  9. #9
    Just Joined!
    Join Date
    Jul 2008
    Location
    Toulouse-France
    Posts
    7
    I have make a test of the errno value only but kill of my program => no print

    I will make a little test following your plan, and if I have no result, I have a big issue

    with my first test program, all is good, but I havn't touch the serial port part (open, read)

  10. #10
    Just Joined!
    Join Date
    Jul 2008
    Posts
    5
    I am getting the same condition on a TS-7800 ARM board running Debian flavor of Linux. Simply doing a read() on an open port. I can transmit from it just fine ... but get an character in and the program aborts with the "I/O possible" error. Researching this now. Thinking there is a 'signal' being generated and not caught, but I am looking. Just letting you know you are no alone with this problem!

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...