Jump to content

Using PHP to transmit/write characters to a USB port device at 9600 baud rate


project168

Recommended Posts

Hello guys,

 

I am new to PHP programming. I am trying to figure out how to use PHP language to transmit/write characters to a USB port device at 9600 baud rate 8-N-1. Basically I just need the PHP coding to allow me to send stuff to the USB device but I have no idea how I can interface this. I did some researching but most were for RS-232 COM Port. I can't find the proper one for USB.

 

If someone can help me out, that would be awesome. Thank you!

Link to comment
Share on other sites

Well, after a quick search on Google, I found this class that apparently lets you write data to a serial port.

 

It's well documented, but here's what settings I think you'll require:

 

require("php_serial.class.php");

$serial = new phpSerial(); 
$serial->deviceSet("COM1"); 

$serial->confBaudRate(9600);
$serial->confParity("none");
$serial->confCharacterLength(;
$serial->confStopBits(1);
$serial->confFlowControl("none");
$serial->deviceOpen(); 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.