GPRS remote printer
We have a custom remote printer designed with GPRS module. We now need to communicate with the device over the web.
We have to send messages and r开发者_如何学编程eceive messages from the remote printer, can i do this using Java or PHP.
How do i communicate through GPRS? Will socket communication work?
gprs is like any network connection, sockets or anything that works on a internet connection will work.
you can make the communication between the gprs module and the client using a server/client schema or something more home-brew using a webserver in the middle.
the server/client schema will require you use java to make a server on the remote printer, that will be always active to receive messages from(s) clients.
if you cant use java or anything, you can use a webserver in the middle where the printer will check for messages for him. and make or answer the messages
the correct schema of connection really depends of:
1) if the grps can be always active
2) the capacity of the remote printer to execute (java, php whatever)
3) the capacity or how the clients should interact (directly, indirectly, using a website etc..)
I guess same thing applies to a network printer, I have configured a thermal printer to a static IP over the network, and then installed and configured it to the web server(linux) and set it as the default printer, I've used 'CUPS' and phpPrintIPP to achieved this. And only authenticated users can print to the receipt printer.
Also do you have to query(handshake) the device printer with GPRS first before you can print to the device? I have built a PHP script that does this same sort of thing that connects to a Windows server to communicate to a desktop program over the network and initiates a socket connection to the specified IP:port.
精彩评论