You might want to look at the setserial command on Linux - with it you can assign a serial port for non-standard speed.
You should be able to disable it if you run seterial as follows before connecting to port initialization (either in server initialization scripts or in your PHP ... although you are not sure if this will be a good idea):
/bin/setserial /dev/ttyS1 spd_cust baud_base 115200 divisor 4
Here's what happens on the team:
- The spd_cust option tells the OS to set the speed to a custom divider when the application requests 38400.
- / dev / ttyS1 is the serial port. You change it to anything.
- baud_base is the number to be used by divisor 4
115200/4 = 28800 ... the speed you need :-)
In your PHP code, you connect to 38400, which seems strange, but due to seterial, the port you specify will work at 28800
source share