Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SIM 300D interfacing with server

Status
Not open for further replies.

movie_freak

Member level 5
Joined
Mar 20, 2007
Messages
89
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,943
simm 300d at commands

Hi,

I am facing the following problem:


I have designed a Client program, based on SIM300D GPRS. There would be many similar Clients working at the same time in the application



I understand that the Sever Program should be multi-threaded to receive more than one connection at a time, which i believe it is, and it's a java based server.

The length of data i want to send is not same every time.


As you may know, with AT+cipsend, i can only send 1024 bytes of data at a time.

The server behaves likes this:
(It is not designed by me and i don't have inner working knowledge of it's implementation)

As soon as the client starts a request for the connection the server accepts the connection, and receives the data, but as
as soon as i recieve "SEND OK", i also get "CLOSED" which means the server has closed the connection without issuing any AT+CLOSE command

Now in this case if i have larger data to send i need to connect to the server again and again and send the data, which i believe is not preferable


I requested the guy (who designed the server code) to increase the time out or instead keeping the connection always open,
as i beleive the GPRS connection can be maintained as long as the client is in the network and powered on, this way i just need to check for connection status of the client with the sever and send data..

So in this way I can issue multiple at+cipsend commands and send the large data

The guy says that the server creates a tunnel for each corresponding client and it needs to be closed everytime, otherwise server program won't be able to recieve data with multiple clients.
He instead also tells me to change the client program so that whenever it is required to send a larger amount of data, send it on a diffent port number of the same server
so that whenever clients will send large data it will be recieved on other ports and it will server the purpose, he will implement the required.

So i wanna know if this is a good solution?


How much is this true and are there any other alternatives available to solve the issue?

Also, if any one can help me understand, how the communication is being done at the server end




Many Thanks,
Surya
 

I am designing a similar system like yours, the server (in Java) and the GPRS based device.
I think that the best option is that the GPRS device issue the AT+CLOSE command, but if the server has to close the socket always end your messages with a '\n' or '\r' character, that is the end of line character for the function readLine that is used in java to read the data from the socket stream and then you can send all the data before the server closes the socket.
You have to connect again and again because each time you open a connection the PC allocates memory for it, and if you never disconnect you will have a lot of threads opened at the same time, and it will occupy too much RAM. The best is that every client connects, send the data and disconnect again and again, because there will be less connections and threads opened at the same time being a more efficient solution.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top