I am using two Q2686G modules in modems; one with the sample program tcp_server, and one with tcp_client. The server modem has a public static IP address.
When I power on the server, it indicates that it has attached to GPRS, and is listening for clients (on port 2000). The client modem is configured to talk to the server (public IP address) on port 2000. When the client is powered up, after attaching to the GPRS network, it successfully connects to the server, and sends dummy data. The server indicates that it has a connection from a client and also send dummy data before closing the connection down. That all appears to be OK so far…
As I understand it, the dummy data in both the tcp_server and tcp_client examples are sent out over the air to each other; however, in both cases a WIP_CEV_READ event does not seem to be fired. (a TRACE tells me so). I have also added UART1 FCM routines to the sample code, and there is no output from the RS232 port, which does not surprise me because there seems to be no WIP_CEV_READ event generated. (When this event fires, it would place data in the UART buffer). Is there anyone out there who has played with the tcp_client and tcp_server examples who had similar results to mine? Have I understood the operation correctly?
Look in chapter “6.5.1 Read/Write Events” in the WIP Plugin documentation.
Thanks for that, Kaare.
For anyone who may have the problem that I had, it turned out that port 2000 which I was using (being the default port on the example programs), was not being forwarded by my SIM provider. When I used e.g. port 1000 or port 8080, all worked OK.
sorry i dont have the solution for your problem, as i am just a bigner in this domain, but fortunately i found your post interesting to solve my problem if you kindly help, i am just stuck in an issue; while running a client application on one module and the server application on the other module how do i tell the client module to connect to the server module and how can i access a server module with an internal gateway ip on another network, please help me in getting out of this issue.
Problem: what ip to use to connect another gateways internal ip address.
The important thing here is that the server must have a SIM with a public static IP address which you must try and get from a service provider. Only with a public, static IP address can the server’s SIM be visible on the internet. The client can have an ‘ordinary’ SIM. What you then have to do is edit the code in the tcp_client example (I am assuming that you are using this example code) to provide it with the details of the server’s public IP address e.g. in entry_point.c
#define PEER_STRADDR "192.168.1.5" <== Edit this
#define PEER_PORT 2000 <== Chose a port and edit this
#define RCV_BUFFER_SIZE 10240
This will enable the client to connect to the server.
In the server’s code (tcp_server example code), you have to edit the APN details which the service provider of the SIM will tell you, e.g. in cfg_gprs.c
#define GPRS_APN "websfr" <== Edit this
#define GPRS_USER "a2b" <== Edit this
#define GPRS_PASSWORD "access" <== Edit this
#define GPRS_PINCODE "0000"
Also, in another file (I forgot the name of of it), you have to edit the port number so that it is the same as the one entered into the client software.
I hope this helps.
No, that’s not entirely true.
It is not actually necessary to have a static IP address - although, obviously, it does make things a whole lot easier!
Yes, it must be Public - but it does not have to be Static.
Note that this applies to all IP addressing - it is not specific to GPRS.