Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Dec 1, 2015 · 20 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 3 Jan 2012 at 10:53

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 3 Jan 2012 at 10:58

@GoogleCodeExporter
Copy link
Author

anyone can help??
here I have the same problem with his

-regard-
Eri Samsudin

Original comment by [email protected] on 27 Jan 2012 at 4:30

@GoogleCodeExporter
Copy link
Author

Waiting for an answer to this one as well. Please help.

Original comment by [email protected] on 11 Feb 2012 at 5:55

@GoogleCodeExporter
Copy link
Author

same problem here..

Original comment by [email protected] on 12 May 2012 at 12:43

@GoogleCodeExporter
Copy link
Author

same here

Original comment by [email protected] on 11 Jun 2012 at 7:23

@GoogleCodeExporter
Copy link
Author

Yea, the fix isnt simple.

Original comment by [email protected] on 11 Jun 2012 at 7:33

@GoogleCodeExporter
Copy link
Author

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

Original comment by [email protected] on 14 Jun 2012 at 4:41

@GoogleCodeExporter
Copy link
Author

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

Original comment by [email protected] on 15 Jun 2012 at 3:28

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 10 May 2013 at 2:52

@GoogleCodeExporter
Copy link
Author

I am also facing the same problem. Can anyone provide the solution? Is it the 
problem with php_serial.class.php?

Original comment by [email protected] on 28 Jun 2013 at 3:52

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Can anyone help up? I am facing this problem too. Thanks in advance.

Original comment by [email protected] on 22 Aug 2013 at 10:08

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 25 Jan 2014 at 4:34

@GoogleCodeExporter
Copy link
Author

The solution from #13 is worked for me, thanks.

Original comment by [email protected] on 23 Apr 2014 at 12:54

@GoogleCodeExporter
Copy link
Author

UALLL !!! THANKS VERY MUCH, #13 [email protected] !!!

Original comment by [email protected] on 11 Aug 2014 at 2:14

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 26 Sep 2014 at 1:25

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 8 Jan 2015 at 12:29

@robrey
Copy link

robrey commented Jan 3, 2020

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 [email protected] on 26 Sep 2014 at 1:25

I resolved this way too.

@robrey
Copy link

robrey commented Jan 3, 2020

this is my program
Remember to go to Device Manager> Ports (COM & LPT)>Arduino XXX (COMXX)>right click>Properties>Port Settings>Advanced>uncheck "use FIFO buffers ........."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants