Fail to establish TCP connection using BC95-G


During my development of NBIOT modem, I am able to establish a stable UDP communication using BC95G. Since this device supports TCP protocol, we tried a sequence of AT command: and we were not able to deliver the TCP packet to the server although it respond to ping request. and the tcp connection command resturns OK. At server side: the TCP connection request is not reaching. are what we doing correct? what could be the reason of the TCP connection failure?

<<<: AT+CGMM\r\n
>>>: \r\nBC95GJB-02-STD\r\n\r\nOK\r\n

<<<: AT+CFUN=1\r\n
>>>: \r\nOK\r\n

<<<: AT+CGDCONT=1,"IP","enjizmosos"\r\n
>>>: \r\nOK\r\n

<<<: AT+CGATT=1\r\n
>>>: \r\nOK\r\n

<<<: AT+CGATT?\r\n
>>>: \r\n+CGATT:1\r\n\r\nOK\r\n

<<<: AT+CGPADDR\r\n
>>>: \r\n+CGPADDR:0,\r\n+CGPADDR:1\r\nOK\r\n

<<<: AT+CGMR\r\n
>>>: \r\nSSB,V150R100C10B200SP1\r\n\r\nSECURITY_A,V150R100C20B300SP2\r\n\r\nPROTOCOL_A,V150R100C20B300SP2\r\n\r\nAPPLICATION_A,V150R100C20B300SP2\r\n\r\nSECURITY_B,V150R100C20B300SP2\r\n\r\nRADIO,Hi2115_RF0\r\n\r\nOK\r\n

<<<: AT+NBAND?\r\n
>>>: \r\n+NBAND:28,5,20,8,3,1\r\n\r\nOK\r\n

<<<: AT+CSQ\r\n
>>>: \r\n+CSQ:13,99\r\n\r\nOK\r\n

<<<: AT+NSOCR=STREAM,6,1024,1\r\n
>>>: \r\n1\r\n\r\nOK\r\n

<<<: AT+NPING=\r\n
>>>: \r\nOK\r\n
>>>: \r\n+CSCON:1\r\n\r\n+NPING:,124,420\r\n

<<<: AT+NSOCR=STREAM,6,0,1\r\n
>>>: \r\n2\r\n\r\nOK\r\n

<<<: AT+NSOCO=2,,32010\r\n
>>>: \r\nOK\r\n

<<<: AT+NSOSD=2,4,4D324D3E,0x000,2\r\n
>>>: \r\n2,4\r\n\r\nOK\r\n
>>>: \r\n+NSOSTR:2,2,0\r\n\r\n+NSOCLI: 2\r\n
>>>: \r\n+CSCON:0\r\n

Best regards.

Hi Ahmad
If no flags are set, a value of 0 should be provided.

Hi Abner,

Thank you for your response, I tried several flag values, it does not matter what is the flag used … It always fails.

<<<: AT+NSOSD=3,4,3C4675AA,0,2\r\n
>>>: \r\n+CSCON:1\r\n
>>>: \r\n3,4\r\n\r\nOK\r\n
>>>: \r\n+NSOSTR:3,2,0\r\n\r\n+NSOCLI: 3\r\n

<<<: AT+NSOSD=2,3,3C4D32,0x100,101\r\n
>>>: \r\n2,3\r\n\r\nOK\r\n
>>>: \r\n+NSOSTR:2,101,0\r\n\r\n+NSOCLI: 2\r\n

I have tested the server side, it receives UDP and remote TCP connections, but not the connection we made through the TCP socket of BC95-G.

Hi Ahmad
What is the return channel of Create a socket? Is this channel used to send data?

Hi Abner,

Ok, I do not currently use the 1024 socket, It is a TCP server listening socket at port 1024, I will use it later for receiving TCP connections.

Do you mean this first socket creates an issue?

Hi Ahmad
Each time a socket is created, a different channel number is returned. If the channel number cannot be matched when sending data, the server cannot receive data.