Php Serial Port Communication Linux Ubuntu

I have installed xampp in fedora 13.I am trying to communicate with microcontroller through serial port using php serial class. My code is example.php include('php_serial.class.php'); $serial = new phpSerial(); $serial->deviceSet('0'); $serial->confBaudRate(9600); //Baud rate: 9600 $serial->confParity('none'); //Parity (this is the 'N' in '8-N-1') $serial->confCharacterLength(8); //Character length (this is the '8' in '8-N-1') $serial->confStopBits(1); //Stop bits (this is the '1' in '8-N-1') $serial->confFlowControl('none'); //Device does not support flow control of any kind, so set it to none. //Now we 'open' the serial port so we can write to it $serial->deviceOpen(); $serial->sendMessage('*1' ); //sleep(1); // echo 'hi'; $serial->deviceClose();?>The php script gets executed but gives the following warnings.
Warning: Specified serial port is not valid in /opt/lampp/htdocs/xampp/php_serial.class.php on line 147 Warning: Unable to set the baud rate: the device is either not set or opened in /opt/lampp/htdocs/xampp/php_serial.class.php on line 241 Warning: Unable to set parity: the device is either not set or opened in /opt/lampp/htdocs/xampp/php_serial.class.php on line 295. I have used the command: chmod 0777 /dev/ttyUSB0 to give permissions. I have also tried to add the apache user 'prudhvi' to the dialout group by using command: $ usermod -a -G dialout prudhvi But it doesnt work. When I send a command directly from the terminal using the command: echo 1 >/dev/ttyUSB0 it works and '1' is transmitted to the serial port. But using php I get the above warnings. I have used the '$whoami' to check name of user and added that user 'prudhvi' to the dialout group.
It still doesnt work. Please help me guys. I did this once with Debian to control an Arduino board with a PHP script and initially ran into the same problem. In Debian, you need to add the Apache user to the dialout group in order to allow it to make serial connection requests. I would assume the same is true for Fedora.
In Debian the command is: useradd -G dialout www-data However I believe Fedora names the Apache user as apache instead. I don't have a Fedora machine to test on, but I would assume the command you need to run is: useradd -G dialout apache You will then need to restart your xampp server. Install Mysql Module Php Windows Install on this page. See the following for reference: Neal.
I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303. I'm a beginner at minicom.
Hi for the last few days i'v been trying to get a script to work on my local server. Server dell 4600 ubuntu 10. Contoh Program Kasir Dengan Php Include File on this page. 04 lamp server software webmen.
Is this the correct command to execute? Or do I need to configure something? $ sudo minicom --device /dev/ttyUSB0 minicom: cannot open /dev/ttyUSB0: No such file or directory $ sudo lsusb -v Bus 002 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Device Descriptor: bLength 18 bDescriptorType 1 $ tail /var/log/syslog #then removed and attached the device. Mar 13 23:31:49 ubuntu kernel: [805] usb 2-1: pl2303 converter now attached to ttyUSB0 Mar 13 23:34:44 ubuntu kernel: [829] usb 2-1: USB disconnect, address 7 Mar 13 23:34:44 ubuntu kernel: [821] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0 Mar 13 23:34:44 ubuntu kernel: [874] pl2303 2-1:1.0: device disconnected Mar 13 23:34:52 ubuntu kernel: [856] usb 2-1: new full speed USB device using uhci_hcd and address 8 Mar 13 23:34:52 ubuntu kernel: [845] pl2303 2-1:1.0: pl2303 converter detected Mar 13 23:34:52 ubuntu kernel: [809] usb 2-1: pl2303 converter now attached to ttyUSB0.
I get get the same minicom error, 'cannot open /dev/ttyUSB0: No such file or directory' Three notes: • I get the error when the device attached to the serial port end of my Prolific Technology PL2303 USB/Serial adapter is turned off. After turning on the device (an embedded controller running Linux) minicom connected fine. • I have to run as super user (i.e. Sudo minicom) • Sometimes I have to unplug and plug back in the USB-to-serial adapter to get minicom to connect to it. I am running Ubuntu 10.04 LTS (Lucid Lynx) under VMware (running on Windows 7).
In this situation, make sure the device is attached to VM operating system by right clicking on the USB/Serial USB icon in the lower right of the VMware window and select Connect (Disconnect from Host). Remember to press Ctrl + A to get minicom's prompt, and type X to exit the program. Just exiting the terminal session running minicom will leave the process running. I just got my GUC232A cable with a molded-in PL2302 converter chip. In addition to adding myself and br to group dialout, I found this helpful tip in the README.Debian file in /usr/share/doc/bottlerocket: This package uses debconf to configure the /dev/firecracker symlink, should you need to change the symlink in the future run this command: dpkg-reconfigure -pmedium bottlerocket That will then prompt you for your new serial port and modify the symlink. Single Collection Hotchpotch Rar File. This is required for proper use of bottlerocket. I did that and voila!