tags:

views:

44

answers:

2

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 receive messages from the remote printer, can i do this using Java or PHP.

How do i communicate through GPRS? Will socket communication work?

A: 

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..)

shadow_of__soul
The device is like a POS system running some programs in embedded C as mentioned by our client.Now our server will be the actual place where the communication will be initiated through our website.So instead of the POS polling our server for requests, we have to work towards a protocol that will push requests to the device and wait for response.Our backend is in PHP so there will be a client/server module running on our server to communicate with device. Is this the right approach to be taken?
if you need to send a message and wait the answer, the right approach will be developing a executable that could actively listen and answer from a port. what you want to accomplish can be done with php but is not something reliable as you going to need to use a database to store the answer from the device and check it with another php each X seconds for the answer. you could use also php as frontend to launch the action of send/receive the messages with the executable.
shadow_of__soul
A: 

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.

Mark Guadalupe