-2

I am trying to use gprs for remote monitoring using quectel m95 and pic controllers. I know a little bit of http commands used for this purpose and we can send data and receive data from server using http POST and GET commands.

Now my application is such that my app request some data from the server. The server has to get this data from the pic controller using gprs. How can I send a request from the server to the pic controller which is interfaced using quectel modem.

Also I know that the server has to keep track of the IP address assigned to the modem when initialising a gprs context. Then only it can send request to the modem. I want to know is this feasible, if yes how can one achieve this.

Please do throw some light upon this.

Regards

Sanket

Sanky
  • 13
  • 1
  • 6

1 Answers1

0

The Quectel GPRS module (modem) features a TCP/IP stack, and you treat it as the client in the server-client model. Refer to the Quectel reference material for specific AT commands required to achieve a certain task, but here's the general process:

  1. The PIC initiates the GPRS context in the modem (comms between the PIC and the modem is via a UART).
  2. The PIC initiates the opening of a TCP/IP connection to your server on the GPRS context. The public IP address of the server must be known to the PIC, so keep it static.
  3. The server accepts the client connection request and assigns a socket for data transfer.
  4. Data is sent through the open TCP/IP connection from either end. If originating at the PIC, the data must first be sent over the UART to the modem to forward to the server. If originating in your app on the server, the data must be placed in a TCP/IP packet and directed through the socket to the client. Note that once the connection is open, the socket is bound to the client - this is what you need to keep track of (should you have multiple clients).
Ed King
  • 1,833
  • 1
  • 15
  • 32