Anyone using php_serial.class.php with USB serial port?

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Apr 3 17:41:11 UTC 2008


On Thu, Apr 03, 2008 at 12:07:49PM -0400, jim wrote:
> Hello,
> I'm wondering if anyone has any suggestions for me. I am trying to use
> the php serial class with a usb to serial adapter. The device is
> recognized
> as /dev/ttyUSB0 . I can't use this with the serial class without getting
> an error.
> Warning: Specified serial port is not valid
> in /usr/share/php/php_serial.class.php on line 111
> 
> I also tried creating a symbolic link to /dev/ttyS4 thinking maybe it
> only recognizes traditional serial ports. I can use either
> this symbolic link or /dev/ttyUSB0 with a terminal program like gtkterm
> but I keep getting the above error when I try using the php serial class
> with
> $serial->deviceSet("/dev/ttyS4");  or $serial->deviceSet("/dev/USB0");
> Anyone have any ideas how I can get this to work. Thanks a lot.

Does it work with a non USB serial port?

Looking at the code for the class (which has many misspelled words and
really isn't very well commented), it looks like the problem is running
this command:

stty -F /dev/ttyUSB0

If it returns 0 then it says it is a valid port and otherwise it does
not.  Try running it and then check the return code (echo $?)

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list