I've downloaded dio extension->php_dio.dll (version 5.2.6.6) and put it in extension dir php then put extension=php_dio.dll in php.ini then restart the apache.
in phpinfo() shows: see here
I read in some forum that it's old version of dio extension.
I've tried to run this script:
<?php
// Create a stream context that configures the serial port
// And enables canonical input.
$c = stream_context_create(array('dio' =>
array('data_rate' => 115200,
'data_bits' => 8,
'stop_bits' => 1,
'parity' => 0,
'is_canonical' => 1)));
// Are we POSIX or Windows? POSIX platforms do not have a
// Standard port naming scheme so it could be /dev/ttyUSB0
// or some long /dev/tty.serial_port_name_thingy on OSX.
if (PATH_SEPARATOR != ";") {
$filename = "dio.serial:///dev/ttyS0";
} else {
$filename = "dio.serial://COM5";
}
// Open the stream for read only and use it.
$f = fopen($filename, "r+", false, $c);
if ($f) {
echo "Writing to port...
";
fprintf($f,"Hello world
");
echo "Reading from port...
";
$data = fgets($f);
if ($data) {
echo $data;
}
fclose($f);
}
?>
but I always get Warning: fopen(dio.serial://COM5) [function.fopen]: failed to open stream: No such file or directory in
dio extension does not work in windows? or i'm using a old version?
if i'm using a old version, where can i find the newer version of dio extension.
Thanks in advance.