# ed\_SocketTCPStart returning ERR\_INVALID\_ID

**URL:** <https://forum.sierrawireless.com/t/ed-sockettcpstart-returning-err-invalid-id/484>\
**Category:** Open AT\
**Created:** [May 30, 2006, 2:25pm UTC](https://forum.sierrawireless.com/t/ed-sockettcpstart-returning-err-invalid-id/484 "2006-05-30T14:25:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![veranith](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@veranith](https://forum.sierrawireless.com/u/veranith)\
**Post date:** [May 30, 2006, 2:25pm UTC](https://forum.sierrawireless.com/t/ed-sockettcpstart-returning-err-invalid-id/484/1 "2006-05-30T14:25:15Z")

</div>

Hi,

I want to sent dome data through a TCP socket.  
once everything is initialised (SIM ready, GPRS attached…).  
I call :

```auto
ed_SocketSetConfig(ED_ID_TCPSOCKET_2, &scannerParams.socket);
```

then, later I send data :

```auto
ed_SendDataExt(Buff,(u16)strlen(Buff),FALSE,ED_ID_TCPSOCKET_2);
```

if ed\_SendDataExt returns -63 (ERR\_ID\_INACTIVE), I (re)start the TCP Socket :

```auto
if (result == ED_ERR_ID_INACTIVE)//-63
{// the service is inactive 
	result = ed_SocketTCPStart(ED_ID_TCPSOCKET_2, 0, SocketRspCbk, SocketDataHnd, SocketDataRequest);
	TRACE((8, "ScannerSocket Started again -> ed_SocketTCPStart :%d ",result));
}
```

Here, ed\_SocketTCPStart returns -62 (ERR\_INVALID\_ID).  
I’m quite astonished to see this error that I don’t understand.

Does anyone know what can cause this error to appear ?

Thanks,

Veranith

---

<div class="post-metadata">

**Author:** ![OpenAT\_Fan](https://avatars.discourse-cdn.com/v4/letter/o/f07891/32.png) [@OpenAT\_Fan](https://forum.sierrawireless.com/u/OpenAT_Fan)\
**Post date:** [May 31, 2006, 9:24am UTC](https://forum.sierrawireless.com/t/ed-sockettcpstart-returning-err-invalid-id/484/2 "2006-05-31T09:24:06Z")

</div>

Hi Veranith,

It seems that you are calling ed\_SendDataExt () function without opening the TCP socket. In other words, your Socket is not opened (ed\_SocketTCPStart () has not been called) before calling ed\_SendDataExt ().

I hereby dictate the steps that you need to follow:

1. Attach to GPRS.
2. Call ed\_DialupConnectionStart () and receive the IP.
3. Set the Socket configuration parameters (using ed\_SocketSetConfig).
4. I hope that you are doing things correctly upto this point.
5. Call ed\_SocketTCPStart () function to start the socket. When you receive ED\_INFO\_WAITING\_FOR\_DATA, it means that your socket is now active. Only after receiving this event, you should call ed\_SendDataExt () function.  
Also make sure that you call ed\_SendDataExt () only after receiving a call to pfRequestCallback\_f function (after reading the MaxLen parameter).  
This should solve the problem of ED\_ID\_INACTIVE.

The problem of ERR\_INVALID\_ID can be attributed to the fact that sometimes when an Open-AT application is executed in debug mode (which uses the TCP socket), it gives the same error. To solve this problem, please delete the contents of rte/objects folder present in the directory which contains your Open-AT project.

Hope, this solves the problem.  
Best Regards,  
Open AT Fan.
