mmm, seems you're right!
It opens a treat on the xp machine, ding, till opens, very fun stuff (yes, it's for a POS system).
I took it to the hair salon and installed it on the mac (running OSX 10.2 I believe) and the standard php and mysql install that comes with (or that you install) and it won't open the till.
Here's the lowdown:
The mac has no serial port.
To overcome this a usb2serial adapter was purchased, installed and is running
To test this, I connected the till and told the mac via networking that the modem was infact a null modem cable connected to com1
I tried to connect via this 'modem' and the till opened. Bingo, it works.
I then go to my code and try and open till, and it does NOT open.
I check the settings (and here's where some mac advice could come in handy), it turns out the serial port installs itself in networks under an entry called USBSERIAL.
Looking in the /DEV/ folder on the mac there is an entry now called
tty.usbserial.
I've tried changing the code above so many variations of this:
Code: Select all
//*****************
//Pos OPEN THE TILL
//*****************
function pos_open_till()
{
`mode com1: BAUD=9600 PARITY=N data=8 stop=1 xon=off`;
$fp = fopen ("USBSERIAL:", "w+");
if (!$fp) {
echo "Uh-oh. Port not opened.";
} else {
$e = chr(27);
$string = ""; //don't need to send anything, it's just a null string
$string .= $e;
fputs ($fp, $string );
fclose ($fp);
//echo "till open<br>";
}
}
or
Code: Select all
//*****************
//Pos OPEN THE TILL
//*****************
function pos_open_till()
{
`mode com1: BAUD=9600 PARITY=N data=8 stop=1 xon=off`;
$fp = fopen ("SERIAL:", "w+");
if (!$fp) {
echo "Uh-oh. Port not opened.";
} else {
$e = chr(27);
$string = ""; //don't need to send anything, it's just a null string
$string .= $e;
fputs ($fp, $string );
fclose ($fp);
//echo "till open<br>";
}
}
etc etc but to no avail.
I'm really sort of, stumped. Come to an end of my ideas

I expected a few hickups, but this is really a bit of a downer. I'll get there though, but it seems I will need the advice of someone who can point me in the right direction.
So yes please, any advice appreciated.
Rob