Anyone using php_serial.class.php with USB serial port?
jim
cinetron-uEvt2TsIf2EsA/PxXw9srA at public.gmane.org
Thu Apr 3 18:24:21 UTC 2008
> > 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 $?)
Thanks for the help. Below is the output of the command.
~$ stty -F /dev/ttyUSB0
speed 9600 baud; line = 0;
min = 1; time = 0;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
Does this help shed light on things?
Jim
>
--
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