I am building an online POS and trying to establish low level communication with an Epson tm-t88iv thermal printer. there is no direct printing of files, only hexadecimals or ascii can be sent to the hardware in a specific format for it to print. all of this done in a linux enviroment (both ubuntu 13.10 and 12.04).
Now the problem is that I can't establish communication with the printer. I have tried using Jzebra and other java to javascript libraries but with no luck, so I changed to a more familiar environment and tried using the php serial class with a status check code but nothing happens.
include 'src/PhpSerial.php';
// Let's start the class
$serial = new PhpSerial;
$serial->deviceSet("/dev/ttyUSB0");
$serial->confBaudRate(38400);
$serial->confParity("none");
$serial->confCharacterLength(8);
$serial->confStopBits(1);
$serial->confFlowControl("none");
$serial->deviceOpen();
$serial->sendMessage("\x02\x81\x1B\x02\x01\x03\x5C\x5C");
$read = $serial->readPort();
var_dump($read);
which returns an empty string. Also the printer is not receiving the hexadecimals (it is set on a hex-dump state, to print every hex it receives).
I am not sure even if its a coding or hardware problem. I tried installing cutecom to talk with serial port but I don't get any answers either. I also tried doing some stty commands directly from shell but got nothing either.
If someone can please shed a light on why this is happening or if he has any similar experience, it would be great.
thanks!
p.d: i am connecting using a prolific pl2303 serial to usb cable and its correctly installed as far as i am aware.