Page 1 of 1

Opening a till (cash drawer) via PHP

Posted: Fri Sep 16, 2005 6:53 pm
by robster
Hi everyone,

I'm writing some POS software for my wifes business and we're having issues with money dissapearing from our cashbox. So I've decided we have to have a cash drawer that only opens when instructed from the PC. Our software I've written for POS is in PHP with MySQL as the database. It all works well and records which employee does the transaction.

What I now need is to get the cash drawer to open when instructed.

The question is, how can I get PHP to do this? (please note the machine is an imac running OSX 10.x)

Here are the cash drawer styles I'm looking at:
http://www.downtown.com.au/hsc1081.htm
http://www.vantex.com.au/product.asp?pID=9325&cID=1538
and the usb version http://www.vantex.com.au/product.asp?pID=9331&cID=1540

Obviously there are many variants but you get the idea.

If anyone could point me in the direction of interfacing hardware, or even better, if you've worked with cash drawer opening via PHP before, I'd really appreciate any help.

Thanks for your time...

Rob

EDIT: I am using PHP 4.x on the mac

Posted: Fri Sep 16, 2005 8:10 pm
by jwalsh
PHP would need to be installed on the computer that directly controls the cash drawer. You could probably create a batch program to open the door from shell, then run that from php... Only option I can think of offhand.

Josh

Posted: Fri Sep 16, 2005 8:17 pm
by robster
sorry yes, I forgot to mention, the whole machine (imac) is just there on the counter, it does its thing and will be connected to the drawer.

I see what you're saying, write an app in another language (perhaps applescript or some other batch processing language) and then call that from php (as i've seen php can run external apps).

Sounds like i've got my answer.

I guess the other question is, USB or seriel (and the mac has no seriel port, but they say you can get a dongle/converter). Does anyone know anything about this kind of thing?

Thanks again :)

Rob

Posted: Fri Sep 16, 2005 8:49 pm
by jwalsh
I run a mac myself, and have used such a converter, but I would always take the USB approach over a serial conversion. USB is more than fine for this type of use.

If the company is growing, I'd suggest running the switch on a seperate computer acting as a server. Then use a switch to control input from multiple cash registers.

This project sounds like fun... perked my interest.

Posted: Fri Sep 16, 2005 9:02 pm
by robster
The company is growing, but still very small in reality and we only need the one machine. (This is a hair salon).

My only concern with the USB device (drawer) is the need for a driver, and if so, how to open it. It appears that the seriel ones open just from recieving data from the seriel port, whereas the USB one seems to need more than this. I guess it's whether or not there is a USB drawer with a mac driver, and an app I can call (or make an app I can call) from PHP.

It is interesting, and it will be fun to see my PHP code, in the browser, open the till (in real life!).

;)

Thanks everyone for the help, but don't feel you have to stop, if you can think of anything/find anything out there I'm of course very grateful. I'll also keep anyone interested up to date with how the project goes.


Rob

Posted: Fri Sep 16, 2005 9:04 pm
by jwalsh
I would assume buying a cash register with a USB port, would come with the appropriate software to open the till... no?

AppleScript the open through their software (running in background), then run that script from PHP. Remove all confusion by letting their code do it.

Although, the software they send may do exactly what your php script is doing... but then again, maybe not, I've never used one.

Posted: Fri Sep 16, 2005 9:07 pm
by robster
I think you're right. I'll get back when it's ready to roll with a little page of how I did it.

:)

Posted: Sat Sep 17, 2005 1:25 am
by Trenchant
Another thing you might want to invest in is a decent quality security cammera. My family fast food business was having the same problem as you with money walking away. We bought a security system and ran it through the computer/cash register. Ever since we rarely have money missing where as before it use to be as much as $120/day going missing.

A fake camera might even work. Its all about them knowing your watching.

Just my 2 cents.

Posted: Sat Sep 17, 2005 1:52 am
by n00b Saibot
Web Dummy wrote:A fake camera might even work. Its all about them knowing your watching.
Elementary, My dear Watson :!: :lol:

Posted: Sat Sep 17, 2005 2:03 am
by robster
i could get it to grab for X seconds when till opens or similar, just run a shell command to run a cam capture utility. I like it, thanks again :)

Rob

Posted: Sat Sep 17, 2005 2:15 am
by m3mn0n
You could get one of those new cameras that connect to your network and send data wirelessly.

I bet if you worked at it you could get PHP to snap a photo (or video) as soon as the drawer was open and then log all that data for viewing by management at the end of the day. :)

Posted: Sat Sep 17, 2005 4:05 am
by robster
it's almost evil!!!



:twisted:

Posted: Sat Sep 17, 2005 8:38 am
by Charles256
the real question is do they catch you scratching your rear with this camera.... hehe . sorry for the off topic post but i had to some amusement in someones life:-D

Re: Opening a till (cash drawer) via PHP

Posted: Thu Jan 26, 2017 12:26 pm
by chevi99
I'm in the same trouble here. Has anyone gotten the solution to this? I have developed my POS already, now my client came to me that he has purchased a till machine and now he wants me to integrate it in the app. I wrote the app using PHP. Waiting for answers THANKS

Re: Opening a till (cash drawer) via PHP

Posted: Thu Jan 26, 2017 12:29 pm
by Celauran
This is a post from 2005. Please create a new thread explaining your problem in detail.