Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Testing serial port in

  • 20-04-2006 2:00pm
    #1
    Closed Accounts Posts: 25,848 ✭✭✭✭


    I'm testing a program that reads in a constant stream of data from the serial port (/dev/ttyS0).

    The problem is I'm trying to test and debug this program on a machine that has nothing connected to the serial port.

    Is there an easy way of emulating serial port input so I can send some data to this "virtual" serial port and see what my program does with it.

    I can change the port from /dev/ttyS0 if that helps (I've access to the source code)


Comments

  • Registered Users, Registered Users 2 Posts: 2,747 ✭✭✭niallb


    Any chance the machine has two serial ports?
    A null modem cable between the two would be the most realworld option.

    If you've only one port, a USB to serial adapter for the second one will
    work fine.

    If you don't have physical access, you could look up "serial port redirector" on freshmeat, and see if anything there might suit.

    A simple solution would be to use a fifo.
    Change your sourcecode from /dev/ttyS0 to /tmp/ttyVirtual.
    mkfifo /tmp/ttyVirtual

    You can fire test data at the fifo, and the app should read it.
    You will HAVE to be able to turn off flow control to use this method.

    Test it using minicom.
    minicom -s
    Select "serial port setup", press A and enter the portname /tmp/ttyVirtual.
    press F to turn off hardware flow control if it's enabled.
    echo "Hello World" > /tmp/ttyVirtual and you'll see it in minicom.

    Hope one of those sorts you out,
    good luck,
    NiallB


Advertisement