Forum > General

serread doesn't return any bytes from /dev/ttyUSB0

(1/1)

snafu:
Hello everyone,

I'm experimenting with Lazarus at the moment and trying to communicate with a serial device via /dev/ttyUSB0.

I can send commands to the device without issue, and the device does send data back BUT serread never returns any data. Always returns a result of 0 (bytes read)

If I watch /dev/ttyUSB0 with GtkTerm I can see the devices responses to the Lazarus generated commands.

The port is initialised with:
    MySerialHandle := SerOpen('/dev/ttyUSB0');
    SerSetParams(MySerialHandle, 4800,8,NoneParity,1,[]);

The OS is Ubuntu 9.10 AMD64.

Can anyone shed any light on this?

Thanks.

snafu:
Solved.

It seems there's some hysteresis to deal with.
A small delay between finishing the write and submitting the read resolves my issue.

Navigation

[0] Message Index

Go to full version