Sim Com 7600 closes TCP connection

Has anyone been able to successfully send DATA with a Sim Com 7600g-h modem to the dashboard?
I’m currently able to send and receive SMS but keep running into a issue where the TCP socket closes
after 12 seconds or if I immediately try to send (or Paste) AT+CIPSEND=0,50 it closes right away.

AT+NETCLOSE
OK
+NETCLOSE: 0

AT+CIPMODE=1
OK

AT+NETOPEN
OK

  • NETOPEN: 0
    OK

AT+IPADDR
+IPADDR: 100.69.159.82
OK

AT+CIPOPEN=0,“TCP”,“cloudsocket.hologram.io”,9999
CONNECTED 9600
OK
CLOSED (10-12 sec delay then automatically closes)

(or start typing via Tera Term, AT+CIPSEND=0,50 and it closes right away, before I finish typing)

I’ve looked over the forum and suggested literature but have not been able to find my problem. Any thoughts would be appreciated. Thanks beforhand

Hi iceman,

Yes, I’ve been using that modem successfully.

There’s two ways to send data to the socket. The Hologram API uses TOTP for authentication and that is very quick to reply and close the connection (typically within a second). I’ve put in a lot of work to recreate that method using my own code and it replicates the performance of the API. However, the method we are encouraged to use (via the documentation on this website) has the device key for authentication and is typically very slow, and takes as you say around 10-12 seconds to reply and close the connection.

In either case the commands sent to the modem are the same - it’s just the actual data payload that varies depending on the method used. To quote the hologram example, you’ll be sending something like:

{“devicekey”:“ABCDWXYZ”, “data”:“Hello, World!”, “tags”:[“TOPIC1”, “TOPIC2”]}
to cloudsocket.hologram.io 9999
and you should receive [0,0] back if you’re successful, after 10-12 seconds.

Back to your modem. I’m being a bit lazy and pasting some lines from my code:
open_check = “AT+CIPOPEN?”
open_check_resp = “+CIPOPEN: 0,"TCP"”
open_req = “AT+CIPOPEN=0,"TCP",” + ip_address + “,9999”
open_req_resp = “+CIPOPEN: 0,0”
send_tcp_cmd = “AT+CIPSEND=0,” + message_length

In referring to the above, you should chck if a connection is already open (send open_check), and if the reponse contains open_check_resp, you’re good to proceed. Otherwise open the TCP connection (send open_req), making sure it opens correctly (response contains open_req_resp).
Then send the actual data, using command send_tcp_cmd.
Note that this last command has to include the message length and then the modem responds with text finishing with a “>”, whereupon you are to send to the modem the actual data to send - no AT command, just send the pure message text (hologram text message example above).

As an aside, I haven’t hard coded the hologram socket ip address. I use a dns to look it up in my code once at the start, the use that ip_address from then on (it uses less dns lookups and hence less cellular data that way).

In your example, I don’t see where you are sending the actual data payload. After 10-12 seconds the socket closes because it gave up waiting for you to provide the actual data!

Hope that helps.

Cheers, Phil

Upon rereading what you’ve done, it seems to me you need to be prepared with some copy and paste responses to get your CIPSEND command sent quickly, and pasting quickly the followup message text. I’ve never tried doing this manually via a terminal - always used code where my two-fingered typing speed isn’t a factor!

Hello Phil and thanks for your advise!

If I input AT+CIPOPEN=0,“TCP”,“cloudsocket.hologerm.io”,9999, I get CONNECTED 9600 OK.

As soon as I input my next step, AT+CIPSEND, the socket closes, like as soon as I put in the first couple letters!

I try AT+CIPOPEN? but as soon as I type the first couple letters the socket closes so I can’t tell if it is opened. If I try and paste the AT+CIPSEND=0,50 or AT+CIPOPEN? it closes immediately also.

When I initiate the modem on startup, I send it the following

AT+CNMP=38;+CMEE=2;+CMGF=1;+CMGD=4;+CNMI=2,2,0,0,0;+IPREX=9600
AT+COPS=0
AT+CGDCONT=1,“IP”,“HOLOGRAM”
AT+CSQ

After this startup I’m able to send and receive SMS texts.

My goal is to send SMS to the modems phone number and return the replay from the modem as DATA and reduce the expense of outbound SMS messages.

From all the information I was able to gather, this is how I should do it

AT+NETCLOSE
OK
+NETCLOSE: 0

AT+CIPMODE=1
OK

AT+NETOPEN
OK

NETOPEN: 0
OK

AT+IPADDR
+IPADDR: 100.69.159.82
OK

AT+CIPOPEN=0,“TCP”,“cloudsocket.hologram.io,9999
CONNECTED 9600
OK
(12 second delay then closes, which is supposed to happen, or it closes immediately after I begin
typing and I can type faster than the 12 second automatic close)
CLOSED

next step if I could get this far would be AT+CIPSEND=0,49 (or 51 I’m not sure)
I’m looking for this chevron > then type {“k”:“ABCDWXYZ”, “d”:“Hello World”, “t”:“datatest”} ctrl z

Then presto the message body should go to the “all activity” on the dashboard.

Am I missing anything? I hope this gives you a bigger picture of my Delema.

Rick

Phil
Thanks for your input, you set me on track. Typing in commands never got me past CIPOPEN. By setting up a script it started working and sending the data to the dashboard. AT+CIPMODE=0 made a difference also. Thanks again

Great news! Seems like you’re making progress.

I meant to say, if you don’t already have it, you MUST get (download) the SIMCom documentation. A good start is the “SIM7500_SIM7600 Series_AT Command Manual” V3.00.

Cheers

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.