I am trying to use PHP to send text to an LED sign so I can send support ticket numbers to it. The sign itself is a piece of work; it came from eBay and is poorly made with almost no documentation. After fiddling with it for a while, I was able to figure out the way it expected stuff to be sent to it and that the baud rate is 28800. I already know how to communicate with stuff like this using PHP, but I don’t know how to change the baud rate to something nonstandard. I’ve tried other baud rates, and haven’t been able to get it to work.
Share
You might want to look into the setserial command in Linux – with it, you can assign a serial port to have a non-standard rate.
You should be able to pull it off if you run setserial as follows before connecting to initialize the port (either in the server init scripts or in your PHP…though not sure if that’d be a good idea):
/bin/setserial /dev/ttyS1 spd_cust baud_base 115200 divisor 4Here’s what’s going on in the command:
115200 / 4 = 28800 …the speed you need 🙂
In your PHP code, you’ll connect at 38400, which seems strange, but because of setserial, the port you specify will be running at 28800