project168 Posted March 26, 2011 Share Posted March 26, 2011 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 https://forums.phpfreaks.com/topic/231796-using-php-to-transmitwrite-characters-to-a-usb-port-device-at-9600-baud-rate/ Share on other sites More sharing options...
mattal999 Posted March 26, 2011 Share Posted March 26, 2011 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 https://forums.phpfreaks.com/topic/231796-using-php-to-transmitwrite-characters-to-a-usb-port-device-at-9600-baud-rate/#findComment-1192621 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.