PHP Serial Class for OS X

tags: ,

Recently a friend of mine was want­ing to tin­ker with a ser­ial device on his Power­book. Since he was want­ing to even­tu­ally allow device input over HTTP requests, we went off look­ing for a PHP class to help out. Luck­ily, there was a GPL-​licensed PHP Ser­ial class on php​classes​.org by Remy Sanchez. How­ever, it only works under Linux or Win­dows. A few machine lock-​ups later, we appeared to have it working.

Down­load my mod­i­fied ver­sion of the PHP Ser­ial class here.

Note: There are a few other modified-​for-​OSX ver­sions of this class float­ing around on the inter­webs, but none that I’ve seen enable all of the func­tions that this class offers.

Feedback

Pim

Thanks for this class. Some­how I can’t get it to work and get the fol­low­ing error:

Fatal error: No stty availi­ble, unable to run. in /Library/WebServer/Documents/php_serial.class.php on line 71

Run­ning stty on the ter­mi­nal shows me: stty speed 9600 baud; lflags: echoe echoke echoctl pendin iflags: iutf8 oflags: –oxtabs cflags: cs8 –parenb

Did you ever run into some­thing similar?!