Setup simple TCP connection with server. Unable to send data. | Thales IoT Developer Community
November 20, 2014 - 1:09pm, 5206 views
Hello there,
Im currently working with the BGS2-W. Im trying to setup a TCP connection with my server but when Im at the point to send data, its not going through. I use the following AT commands:
AT+CREG? To see if Im registered with the network
AT^SCFG="Tcp/WithURCs",on Enable URC ****
AT^SICS=0,conType,GPRS0 Select connection type GPRS0
AT^SICS=0,APN,"apn_url_here" APN to access the GPRS services
AT^SISS=0,SRVTYPE,TRANSPARENT Select service type "Transparent".
AT^SISS=0,ADDRESS,"ip:port" Specify server address
AT^SISO=0 The host opens service profile 0.
wait for response ^SISW: 0,1 Socket service is ready for upload.
AT^SICI? Check the state of the Internet connection profile
wait for response ^SICI: 0,2.. Up
AT^SISI? Check service state of service profile 0
wait for response ^SISI: 0,4.. Up
Untill here, everything seems fine. When I try to send data with AT^SIWS, I always receive ^SISW: 0, 0, 0. I have tried several versions of AT^SIWS but none of them seem to give the right answer.
For example
AT^SISW=0,10 gives ^SISW: 0, 0, 0
I have also tried using the interactive write **** but I dont understand which parameters to use.
I hope anyone can help me understand what Im doing wrong.
Hi Chikhaoui,
I can't see where you select the connection profile 0 with the following command:
at^siss=0,conId,0
But you probably do that if you are able to open the connection.
You are opening the transparent connection here. So now you can enter the transparent data **** by issuing the command: at^sist=1
After that you can send and receive data in a transparent way: what you write on the terminal will be transmitted and what the other party sends will be displayed on the terminal.
To leave this **** you need to write +++ Then you are back in the AT command **** and you can for example check the connection state.
There are very nice examples for different connection types in the AT Commands Specification document.
For instance please see 10.15.16 Creating Transparent TCP Socket Client and 10.15.17 Opening and Closing Transparent TCP Service.
Best regards,
Bartłomiej
Thank you very much. I will try this first thing tomorrow. Ill edit this comment with my results.
EDIT:
Thank you again! I now have a working connection and am able to send data. Now I have the following problem. Im trying to leave the transparant **** by sending +++ but after this, the module doesnt respond to AT commands. Ive send the ascii values and the "+++" itself. Both dont work.
To prevent the +++ character sequence from being misinterpreted as data, it must be preceded and followed by
I have added a 1 second pause before and after the +++ as stated in the AT command set and im not using it in multiplex ****.
I use ASC1
Hi Chikhaoui,
Please try to do the same on ASC0 to verify if it's working there.
I assume that you send the +++ sequence fast enough without adding any brakes between characters.
As an alternative you can also try the following:
• DTR line ON-OFF transitions (see AT&D for configuring DTR line)
• "etx" parameter set within the server address for transparent access **** (see AT^SISS, <srvParmTag> "address"
Please check the AT commands specification for more details.
Please also write what terminal setting you are using while connecting to the interface and AT^SCFG? output.
Regards,
Bartłomiej