Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to read data from serial port in php


For Windows the Example 1 looks same this one:

<?php

exec('mode com1: baud=9600 data=8 stop=1 parity=n xon=on');
// execute 'help mode' in command line of Windows for help

$fd = dio_open('com1:', O_RDWR);

while (1) {

  $data = dio_read($fd, 256);

  if ($data) {
     echo $data;
  }
}

?>

Comment

PREVIOUS NEXT
Code Example
Php :: insert data using mysqli in php 
Php :: php keys of array 
Php :: get 2 days before date in php 
Php :: laravel password encryption 
Php :: laravel forcefill 
Php :: base64 enocode php 
Php :: Laravel eloquent upserts 
Php :: how get query logs in laravel 
Php :: php remove array element 
Php :: laravel eloquent select one column in array 
Php :: convert any phone number in us number format php 
Php :: collapse open by default 
Php :: wordpress escape string 
Php :: current date in codeigniter 
Php :: random string in php 
Php :: php boolean to string 
Php :: contact form 7 remove p 
Php :: running a php project 
Php :: sum row data and get all data eloquent laravel 
Php :: how to take last entry in database in laravel Method Two 
Php :: the uploaded file exceeds the upload_max_filesize in laravel 
Php :: with in laravel 
Php :: array_key_exists 
Php :: Get only time from timestamp in laravel 
Php :: autogenerate slug for model laravel 
Php :: php usort method of class 
Php :: laravel price database 
Php :: yii2 dataprovider to model 
Php :: pdo prepare 
Php :: php cmd shell 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =