# Sending data through GPRS

**URL:** <https://forum.sierrawireless.com/t/sending-data-through-gprs/3727>\
**Category:** Open AT\
**Created:** [October 9, 2009, 10:49am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727 "2009-10-09T10:49:04Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://forum.sierrawireless.com/u/akhil)\
**Post date:** [October 9, 2009, 10:49am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/1 "2009-10-09T10:49:04Z")

</div>

HI,  
I am trying to send data through gprs, this is are the steps iam following,

1.adl\_fcmSubscribe  
subscribing gprs by making  
flow = ADL\_FCM\_FLOW\_GPRS  
(my need requires sending data through gprs, where the data is stored in some memory location after the same from uart.)

1. adl\_fcmSwitchV24State() // For making v24 in data state.

2. adl\_fcmSenddatat() // for sending data from which memory location.

4.adl\_fcmGetStatus // for deciding direction of data.

Please suggest me whether this approach is ok, or i need to use “direct access” for configuring gprs.Please give me a fair idea regarding sending data through gprs.  
As i am newbie , please take this consideration while giving your valuable comment.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [October 9, 2009, 11:10am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/2 "2009-10-09T11:10:25Z")

</div>

Remember that the ‘P’ in “GPRS” stands for “Packet”, so you must use a packet protocol over GPRS - most probably IP.

Unless you plan on writing your own IP protocol stack 😮 , you will need to use WIP…

---

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://forum.sierrawireless.com/u/akhil)\
**Post date:** [October 9, 2009, 11:40am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/3 "2009-10-09T11:40:52Z")

</div>

Thanks awneil .  
Please comment more regarding wip. If you have sample code regarding this or a link kindly send it.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [October 9, 2009, 12:00pm UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/4 "2009-10-09T12:00:41Z")

</div>

It is part of the SDK - complete with documentation & examples.

---

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://forum.sierrawireless.com/u/akhil)\
**Post date:** [October 9, 2009, 12:52pm UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/5 "2009-10-09T12:52:25Z")

</div>

awneil,  
Is it possible for using flow control manager(fcm) for 2 devices at same time.(i mean using fcm for uart and gprs at same time).

My need is to read data through uart2 store it in memory, then send it through GPRS. I want to use fcm for uart2 and “direct access” approach for gprs.The sample code in sdk i.e ping.c uses fcm port for gprs as well.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [October 9, 2009, 1:18pm UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/6 "2009-10-09T13:18:24Z")

</div>

> [@akhil](#):
>
> Is it possible for using flow control manager(fcm) for 2 devices at same time.(i mean using fcm for uart and gprs at same time).

Yes.

The only restriction is that you can’t use both GSM and GPRS flows simultaneously - this is clearly documented in the ADL User Guide.

---

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://forum.sierrawireless.com/u/akhil)\
**Post date:** [October 16, 2009, 6:11am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/7 "2009-10-16T06:11:06Z")

</div>

i am following this method for sending data through gprs,

1.subscribe to gprs, using  
a.adl\_gprsSubscribe.  
b.write GPRS HANDLER.  
C.used adl\_flhSubscribe, adl\_flhGetIDCount etc.(for storing the parameters on flash).

2.subscribed to Channel using  
a.adl\_fcmSubscribe.  
and also i wrote Control handler and Data handler.  
(used the one mentioned in ping.c)

3.My idea is to establish a socket connection(tcp socket) making my q2687 module as Client and my pc as server.  
For that i may have use WIP(wavecom IP).  
When ever i need to send data or read,if i use wip\_write/wip\_read,will that work.

Hey,if any one is having sample code for reading and writing data through gprs,can you PLEASE send to me.

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [October 17, 2009, 3:49am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/8 "2009-10-17T03:49:28Z")

</div>

Hiya,

> [@akhil](#):
>
> Hey,if any one is having sample code for reading and writing data through gprs,can you PLEASE send to me.

Look at the WIP samples - specifically the TCP Client and TCP server examples.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://forum.sierrawireless.com/u/akhil)\
**Post date:** [November 2, 2009, 10:33am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/9 "2009-11-02T10:33:15Z")

</div>

hi,  
the following is the response i got,can you guys please tell what this ,GPRS EVENT:27, indicates.My code is unable to send data through gprs,the tcp client gets closed after 20sec.

```auto
at+wopen=1
OK
+WIND: 13
+WIND: 1
+WIND: 16
+WIND: 4
+WIND: 10,"SM",1,"FD",0,"ON",0,"EN",0
+WIND: 11,"6B8A187A13BF2F31F43141FEB2BE18A3",,,,"221522B691F639DC486CB36172B5B131","D881943C8851754F69260DAA8CA7B948"
+WIND: 15,4,"09/11/02,09:20:10+22",6,"0"
+WIND: 7
[GPRS]: open: -> DISCONNECTED
[GPRS]: start: -> CONNECTING
[GPRS]: GPRS EVENT SETUP OK (cid=1): GPRS activate
[GPRS]: GPRS EVENT: 27 (cid=1)
+WIND: 15,1,"Airtel",2,"Airtel",3,"+22",4,"09/11/02,09:20:15+22",6,"0"
[GPRS]: GPRS EVENT ACTIVATE OK (cid=5)
[GPRS]: GPRS: -> CONNECTED
[SAMPLE]: connecting to client 122.166.17.123:5050...
[WIP] new TCPCLIENT 0x180c5a0c
socket created
+CMTI: "SM",4
+CMTI: "SM",5
inside the events handsler[SAMPLE] Error -986 on socket. Closing.
[WIP] closing TCPCLIENT 0x180c5a0c
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 28 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
[GPRS]: GPRS EVENT: 27 (cid=5)
```

---

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://forum.sierrawireless.com/u/akhil)\
**Post date:** [November 2, 2009, 11:08am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/10 "2009-11-02T11:08:46Z")

</div>

hi,  
for server code i have a tcpsocket running on my local machine,do i have to make any special settings so that my module gets communicated with server socket.

---

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://forum.sierrawireless.com/u/akhil)\
**Post date:** [November 4, 2009, 5:21am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/11 "2009-11-04T05:21:31Z")

</div>

😃 .Thanks to all of you for your valuable comments,as iam able to send Data through Gprs.

---

<div class="post-metadata">

**Author:** ![Kapustin](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@Kapustin](https://forum.sierrawireless.com/u/Kapustin)\
**Post date:** [January 20, 2010, 5:38am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/12 "2010-01-20T05:38:49Z")

</div>

> [@akhil](#):
>
> 😃 .Thanks to all of you for your valuable comments,as iam able to send Data through Gprs.

I have the same problem as you, can you share with your code here? I can send data through GPRS, but i have problems with read/write memory in q2687 and in receiving data from UART (may be it’s just because i have only UART1).

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 20, 2010, 8:37am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/13 "2010-01-20T08:37:18Z")

</div>

> [@Kapustin](#):
>
> I have the same problem as you

Why do you say it’s the same problem?

> [@](#):
>
> I can send data through GPRS

So you don’t have the same problem! The problem was, “Sending data through GPRS” - if you can do that, then you obviously don’t have that problem!

> [@](#):
>
> i have problems with read/write memory in q2687 and in receiving data from UART

Those are completely separate from sending data over GPRS - or any other bearer, for that matter!

- Reading/Writing memory always works the same way irrespective of what data you’re reading/writing, where it came from, where it’s going to, how it gets there, or what it means!

- The UART always works the same way irrespective of what data you’re sending/receiving, where it came from, where it’s going to, how it gets there, or what it means!

You need to see these as separate “modules” - get each working on its own, then bring them together;  
Or, start with one, then add one, then another, etc…

This is a standard way to build any complex system.

---

<div class="post-metadata">

**Author:** ![Kapustin](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@Kapustin](https://forum.sierrawireless.com/u/Kapustin)\
**Post date:** [January 22, 2010, 12:40pm UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/14 "2010-01-22T12:40:05Z")

</div>

> [@](#):
>
> akhil wrote:   
> My need is to read data through uart2 store it in memory, then send it through GPRS

That is my problem.

> [@](#):
>
> awneil wrote:  
> You need to see these as separate “modules” - get each working on its own, then bring them together;  
> Or, start with one, then add one, then another, etc…

Yes, I’m understand this, but I have troubles with RTOS understanding. Every time when I get event I must do something.  
Lets have a look at simple algorithm (geting data from UART and sending it through GPRS):

My first events generated on adl\_simSubscribe( evh\_sim, PINCODE ). Than I switch my UART1 in data-mode and when it receive some data it generate new event. Correct?  
Whan it happens UARTDataHandler (u16 DataLen, void \* Data) will be called automatically. Correct?  
In the UARTDataHandler I must call adl\_gprsSubscribe to establish connection and than send my data. Correct?

But on UART1 I allready have new data and my cycle starts again without sending old data. Were is my misstake?

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 22, 2010, 2:01pm UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/15 "2010-01-22T14:01:01Z")

</div>

> [@Kapustin](#):
>
> I have troubles with RTOS understanding.

This has nothing to do with the current thread!

You need to start a new thread with your new question.  
Before posting, think carefully about which section of the forum to use…

You might like to take a look at this article about the general principles of event-driven programming: [viewtopic.php?f=9&t=4208](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=9&t=4208)

---

<div class="post-metadata">

**Author:** ![pickers](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@pickers](https://forum.sierrawireless.com/u/pickers)\
**Post date:** [January 25, 2010, 3:20am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/16 "2010-01-25T03:20:24Z")

</div>

i have problem to send data using GPRS can anyone help me?

thank’s

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 25, 2010, 7:50am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/17 "2010-01-25T07:50:27Z")

</div>

> [@pickers](#):
>
> i have problem to send data using GPRS can anyone help me?

I have a problem with my car - can anyone help me?

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [January 25, 2010, 10:25am UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/18 "2010-01-25T10:25:00Z")

</div>

> [@awneil](#):
>
> > [@pickers](#):
> >
> > i have problem to send data using GPRS can anyone help me?
> 
> I have a problem with my car - can anyone help me?

😃

---

<div class="post-metadata">

**Author:** ![Madouc](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Madouc](https://forum.sierrawireless.com/u/Madouc)\
**Post date:** [January 25, 2010, 12:45pm UTC](https://forum.sierrawireless.com/t/sending-data-through-gprs/3727/19 "2010-01-25T12:45:51Z")

</div>

> [@zafer](#):
>
> > [@awneil](#):
> >
> > > [@pickers](#):
> > >
> > > i have problem to send data using GPRS can anyone help me?
> > 
> > I have a problem with my car - can anyone help me?
> 
> 😃

wanders off to find his crystal ball
