I have a USB Bluetooth dongle mounted (?) as /dev/rfcomm0, and when I navigate to my local IP address from another device on my network in a browser, I want it to write a 't' to the serial port so that it is transmitted over the Bluetooth connection to another module. I also want it to be as fast as possible.
Currently I can do it in PHP with fopen() and fwrite(), but it is far too slow (3 - 5 seconds), and when I connect to the port with minicom, I can send these commands instantly.
Is there a way to maybe keep the com port open, but then be able to write bytes to it asynchronously from a PHP or CGI script?
I am running an Apache web server with PHP on Rasbian (Debian 7.6) on a Raspberry Pi.