hamedalfahad / php-serial

Automatically exported from code.google.com/p/php-serial
0 stars 0 forks source link

Windows Unable to open the device in C:\xampp\htdocs\php_serial.class.php on line 186 #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run xampp on windows
2. select COM13 (or com port you want)
3. run it with this script below.

<?php
include "php_serial.class.php";

echo "<html>
      <head><title>Test MySQL</title></head>
      <body>";

// Let's start the class
$serial = new phpSerial;

// First we must specify the device. This works on both linux and windows (if
// your linux serial device is /dev/ttyS0 for COM1, etc)
$serial->deviceSet("COM13");

$serial->confBaudRate(9600);

// Then we need to open it
$serial->deviceOpen();

// To write into
$serial->sendMessage("Hello !");

// Or to read from
$read = $serial->readPort();

echo "here it is";
echo $read;
echo "here it was";

sleep(1);

// If you want to change the configuration, the device must be closed
$serial->deviceClose();

// We can change the baud rate
//$serial->confBaudRate(2400);

// etc...
?>
</body></html>

Original issue reported on code.google.com by lcooper2...@gmail.com on 3 Jan 2012 at 10:53

GoogleCodeExporter commented 9 years ago
this is the error i get when running the above coe

Warning: Unable to open the device in C:\xampp\htdocs\php_serial.class.php on 
line 186

Warning: Device must be opened in C:\xampp\htdocs\php_serial.class.php on line 
584

Warning: Device must be opened to read it in 
C:\xampp\htdocs\php_serial.class.php on line 507
here it ishere it was

Original comment by lcooper2...@gmail.com on 3 Jan 2012 at 10:58

GoogleCodeExporter commented 9 years ago
anyone can help??
here I have the same problem with his

-regard-
Eri Samsudin

Original comment by erisamsu...@gmail.com on 27 Jan 2012 at 4:30

GoogleCodeExporter commented 9 years ago
Waiting for an answer to this one as well. Please help.

Original comment by da...@strictlystone.com on 11 Feb 2012 at 5:55

GoogleCodeExporter commented 9 years ago
same problem here..

Original comment by eliseuku...@gmail.com on 12 May 2012 at 12:43

GoogleCodeExporter commented 9 years ago
same here

Original comment by freddy7p...@gmail.com on 11 Jun 2012 at 7:23

GoogleCodeExporter commented 9 years ago
Yea, the fix isnt simple.

Original comment by lcooper2...@gmail.com on 11 Jun 2012 at 7:33

GoogleCodeExporter commented 9 years ago
What? No support? I have the same issue and it's all fine! Still it does not 
work.

Original comment by eliezer....@gmail.com on 14 Jun 2012 at 4:41

GoogleCodeExporter commented 9 years ago
I had finally solved it. All you need to do is change the com port to anything 
between 1 and 5.

Original comment by freddy7p...@gmail.com on 15 Jun 2012 at 3:28

GoogleCodeExporter commented 9 years ago
I am also getting errors even after changing from COM19 to COM4. If anyone has 
solved the problem in Windows, can he/she please upload the exact php files. I 
need to blink the LED 13 of arduino

Original comment by e...@cleantechsolution.in on 10 May 2013 at 2:52

GoogleCodeExporter commented 9 years ago
I am also facing the same problem. Can anyone provide the solution? Is it the 
problem with php_serial.class.php?

Original comment by farhad9...@gmail.com on 28 Jun 2013 at 3:52

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Can anyone help up? I am facing this problem too. Thanks in advance.

Original comment by wsh...@gmail.com on 22 Aug 2013 at 10:08

GoogleCodeExporter commented 9 years ago
In php_serial.class.php, for COM > 4, change at OS Windows:
$this->_device = "\\.\com" . $matches[1]; 
with 
$this->_device = "\\\.\com" . $matches[1];

Original comment by jabba...@hotmail.com on 25 Jan 2014 at 4:34

GoogleCodeExporter commented 9 years ago
The solution from #13 is worked for me, thanks.

Original comment by a...@simetri.web.id on 23 Apr 2014 at 12:54

GoogleCodeExporter commented 9 years ago
UALLL !!! THANKS VERY MUCH, #13 jabba...@hotmail.com !!!

Original comment by robe...@grupoatua.com.br on 11 Aug 2014 at 2:14

GoogleCodeExporter commented 9 years ago
I used this:

// If you are using Windows, make sure you disable FIFO from the modem's
// Device Manager properties pane (Advanced >> Advanced Port Settings...)

Original comment by myproma...@gmail.com on 26 Sep 2014 at 1:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
me also not working for this code.."Fatal error: Uncaught exception 
'phpSerialException' with message 'Specified serial port is not valid' in 
D:\xampp\htdocs\Serialport\PHP-Serial-develop\PHP-Serial-develop\php_serial.clas
s.php:143 Stack trace: #0 
D:\xampp\htdocs\Serialport\PHP-Serial-develop\PHP-Serial-develop\port1.php(14): 
phpSerial->deviceSet('COM10') #1 {main} thrown in 
D:\xampp\htdocs\Serialport\PHP-Serial-develop\PHP-Serial-develop\php_serial.clas
s.php on line 143

" this is my error

Original comment by karthick...@gmail.com on 8 Jan 2015 at 12:29