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 Read Serial Support #1

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

Windows Read Serial Support #1

GoogleCodeExporter opened this issue Dec 1, 2015 · 19 comments

Comments

@GoogleCodeExporter
Copy link

Hi,

I have got windows to read from my serial port using the following code in
place of the 'not implemented' comment:

------
        elseif ($this->_os === "windows")
        {
            $content = "";

            if ($count > 0)
            {
                $content = fread($this->_dHandle, $count);
            }

            return $content;
        }
-----

System: Vista 32bit with a Prolific USB to serial adapter cable.

I hope that it is of some help.

Cheers,

David

Original issue reported on code.google.com by david.ro...@gmail.com on 30 Dec 2009 at 8:47

@GoogleCodeExporter
Copy link
Author

does this code really work ?

please confirm sir...

if yes i would take up my final year project related to web controlled arduino 
please reply sir...

Original comment by THEREDR...@gmail.com on 6 Jan 2011 at 5:04

@GoogleCodeExporter
Copy link
Author

Why would I make a post saying it works if it didn't? give it a test for your 
hardware it will take all of 20 mins.

As an added bonus I have attached my working version of the class.

Have Fun!

Original comment by david.ro...@gmail.com on 9 Jan 2011 at 7:35

Attachments:

@GoogleCodeExporter
Copy link
Author

It looks very good!I send the message to MCU.It's all right!

Original comment by gongqing...@gmail.com on 27 May 2011 at 9:16

@GoogleCodeExporter
Copy link
Author

Yes, it is working for me... :-)

Original comment by honzapr...@gmail.com on 31 May 2011 at 9:08

@GoogleCodeExporter
Copy link
Author

What version of pf PHP is this working on? Will it work running Apache, PHP5.2 
on Windows 7 64Bit?  It works fine to write to the com port but I am still 
unable to read the comp port. 

Original comment by mustangc...@gmail.com on 18 Nov 2011 at 7:44

@GoogleCodeExporter
Copy link
Author

PHP Version 5.3.1 (XAMPP package)

Be worth checking php doco for issues using 'fread' and 64-bit, since the 
change uses it to read the data.

Original comment by david.ro...@gmail.com on 20 Nov 2011 at 7:33

@GoogleCodeExporter
Copy link
Author

so it mean that if i use XAMPP package then i can read the data from COM port 
in my windows? please give me some advices, and thank in advance.

Original comment by sokmeng....@gmail.com on 15 Mar 2012 at 3:21

@GoogleCodeExporter
Copy link
Author

It means if your php/apache is running with sufficient privelege to access your 
windows com ports then you should be able to read from it.

Original comment by david.ro...@gmail.com on 16 Mar 2012 at 2:13

@GoogleCodeExporter
Copy link
Author

For me, write does work, read doesn't unfortunately. Even with the suggested 
change in code..

Original comment by vandenbe...@gmail.com on 1 Apr 2012 at 8:56

@GoogleCodeExporter
Copy link
Author

hai all,, I need Help..
I was try php_serial.class.php
code
$serial->sendMessage('Hallo');
why I cannot get reply with code
$result=$serial->readPort();
print $result;

regard newbie

Original comment by cilok.e...@gmail.com on 19 Jun 2012 at 6:57

@GoogleCodeExporter
Copy link
Author

cilok.e...@gmail.com
for windows it is imposible to receive data from serial communication
that features only work in linux

Original comment by bayu.wib...@gmail.com on 8 Feb 2013 at 12:31

@GoogleCodeExporter
Copy link
Author

U ARE Impossible @ bayu.wib...@gmail.com

Original comment by Jaspreet...@gmail.com on 19 Nov 2013 at 11:00

@GoogleCodeExporter
Copy link
Author

i made it work in windows also, Try it Mr Impossible. ;-)

Original comment by Jaspreet...@gmail.com on 19 Nov 2013 at 11:02

@GoogleCodeExporter
Copy link
Author

@davi.ro...@gmail.com
I don't think it is reading anything. I looked (and tested) your file. function 
readPort has $count=0. When it moves down to if statement for windows, it will 
skip if ($count>0), hence, $content is always blank.

And if you pass a variable other than 0 for count, your version does no better 
than the original buggy php_serial.class.php

Kindly correct me if i am wrong. I can't get the damn thing to work (reading 
port).

@Jaspreet
If you were able to read from the port, could you please give me your version 
of php_serial.class.php along with any test code your wrote. 

Any help appreciated guys

Original comment by srivasta...@gmail.com on 16 Dec 2013 at 5:34

@GoogleCodeExporter
Copy link
Author

Same issue for me, unable to read with XamppLite 1.7.3 PHP 5.3.1 and Apache 
2.2.14

thanks for your help

Original comment by pyzim...@gmail.com on 17 Dec 2013 at 10:46

@GoogleCodeExporter
Copy link
Author

how to make it work?? I try the file also didn't work

Original comment by leeyensi...@gmail.com on 25 Mar 2014 at 7:39

@GoogleCodeExporter
Copy link
Author

can anyone give the html/php code to show the result on browser? im using 
windows

Original comment by duckin...@gmail.com on 11 Apr 2015 at 2:58

@GoogleCodeExporter
Copy link
Author

weare trying it right now and it worked

Original comment by tapish...@gmail.com on 16 Apr 2015 at 3:11

@GoogleCodeExporter
Copy link
Author

Hi,

I am trying something similar :  Arduino is printing some values in the COM15, 
i am trying to retrieve it and display on the web page. 
Using Xampp on windows 8 32bit machine.

I tried with your php_serial.class.php file too. All i get is a blank page. 
What could be the error ?

Original comment by karthiku...@gmail.com on 20 Apr 2015 at 6:57

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

1 participant