Solved

GPRS / PC Communications

Posted on 2004-04-16
9
2,452 Views
Last Modified: 2007-11-27
Hi. I have a device that will transmit text data (engine temperature, oil pressure, etc.) via the GPRS network to a PC. My job is to recieve this data on the PC and show the information graphically. How would I actually access the GPRS network from this PC (which has a constant Internet connection) to read this data that is streaming through? Once I can read it, the rest (decoding, displaying the data, etc.) is no problem. I just need access to the GPRS network to read the data that this device is transmitting. Can this be done via the Internet (through a standard internet connection) or do I have to use a GSM modem connected to the PC? If it can be done through a standard internet connection, how would I go about doing this? What information do I need to know? Any help will be greatly appreciated. Thanks
0
Comment
Question by:f_rodriguez
  • 3
  • 3
9 Comments
 
LVL 1

Expert Comment

by:dapcom
Comment Utility
Hello,

how does the device sends it sata? is it a SMS message? Is the device e-mail capable?

Most of the mobile provider offers the possibility to send email on reception of a sms. That could be an easy way as receiving a mail is easier than a sms.

Just an idea I tought could help...

Dan
0
 
LVL 5

Expert Comment

by:danielsonchris
Comment Utility
GPRS and GSM  typically will support TCP/IP and/or UDP packets.  Many of the unist also support serial interface etc.   You need to aqcuire some protocol specs here on the device that will be sending the message to you.  After doing that you will need to more than likely write a service of some nature that sits on the packet receiving pc and listens in for the data.  I'm currently developing something very similar (this weekend).  

>How would I actually access the GPRS network from this PC (which has a constant Internet connection) to read this data that is streaming through?

All you will need to do is get the specs on the GPRS device you are using and find in there how to configure the "host ip address" and "host port".  That will be your pcs IP address and port of your service running.  You may need to spend some more time configuring the device too based upon your needs.

>Can this be done via the Internet (through a standard internet connection) or do I have to use a GSM modem connected to the PC?

All you need is a good old friendly connection to the internet.

>If it can be done through a standard internet connection, how would I go about doing this? What information do I need to know?

All you need is an internet connection, the devices protocol specification, more than likely a serial port to initially configure your device to tell it where to send it's data and configure it.

That should be about it.  Hope all is going well.
Regards,
Chris
0
 
LVL 5

Accepted Solution

by:
danielsonchris earned 250 total points
Comment Utility
Seems like you are really on track here.  To change the port and ip use the following as you're more than likely already on top of.  :)

AT#SKTSET = 0,<your port>,"<your ip or domain name>"

Honestly, I think you should write a socket server and collect the data from that point using good old TCP/IP.  IMHO, email messaging seems really tacky.  I've been doing a lot of work on a satellite network that uses email at the gateway level to send it's messages...  ick!

So let's say you wrote a TCP based socket server that runs on port 3000 at say ip address... 207.167.xx.xx
you would configure the GPRS/GSM unit with the correct settings such as:
AT+CGDCONT =
1,"IP","internet.gprs","0.0.0.0",0,0<cr>(1-GPRS context setting)
AT#USERID = "Happy User"<cr>(2-Authentication setting)
AT#PASSW = "EASY GPRS"<cr>(2-Authentication setting)
AT#SKTSET= 0,3000,"207.167.xx.xx"

At this stage you would then need to create a protocol that allows your socket server to handle requests and responses accordingly.  Because you are using GPRS and speed is a factor (of course UDP will be faster than TCP/IP, but no guarrantees that your packet will get where it was supposed to go) you more than likely will want to keep your query (request) packets down to the size of no more than 10 bytes.  Your response can then be parsed by the embedded C code and acted upon accordingly.  The whole gist of this is fairly simple.  But really the way to do this is by writing a socket server.  Either way, the embedded C programmer is going to have to code out some sort of protocol in order to allow your communications to be understood by the device.  
I hope I haven't gone off on too much of a tangeant.  What is funny is I have the very same deadline as you.. this friday for a gprs device.
Good luck,
Chris
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:f_rodriguez
Comment Utility
Hi Chris

Thank you very much for your support. As you can see, I have accepted your answer and awarded you 250 points. I just want to know a few more things if possible:

Could you please explain the parameters in the first line of the AT connection string (AT+CGDCONT = 1,"IP","internet.gprs","0.0.0.0",0,0<cr>)? The second and third lines look easy enough (username and password) and the fourth line, as you confirmed, was just as I suspected - the IP address and port on which to transmit/receive. Obviously the first line is connection information. The "IP" string I'm guessing just states the protocol which will be used. What would "internet.gprs" be? Then "0.0.0.0" I'm guessing would be the IP address of my GSM Service Provider? I don't know what the last two parameters are either (0, 0).

Secondly, if I wanted to use UDP instead of TCP, which I know is a connectionless protocol and has less overhead, wold it be very different? Could you maybe show me the AT commands required in this case?

Thirdly, once connected, can the unit simply transmit data to the GSM/GPRS modem as though we had a direct connection (such as a dial-up)? In other words, once the connection has been made, can the unit simply stream text data through its serial port to the GPRS modem and it will get streamed through the Internet to the specified IP address and port so that on my side, I can receive this stream of data by listening on that same port?

And last question, how can we know (from the unit side or from my side) when the connection has been established and when the connection drops? I read somewhere that if you lose the connection, the GSM/GPRS modem will generate the message "NO CARRIER", just like when you lose the connection in a standard dial-up connection. Is this true? Is it safe to assume that when we connect it will also generate a similar message, like the dial-up "CONNECT 9600" message?

I have 170 points left which I can award, although I'm not sure how I would do this since I seem to have closed the question by accepting your previous question. I'll ask the moderator....

Again, thanks for all your help Chris. If there is anything I can assist you in, please let me know. I've got lots of experience in serial port communications, SMS/Dial-Up connections, GPS and GIS (digital mapping).

Regards
Fabricio
0
 

Author Comment

by:f_rodriguez
Comment Utility
Oh, by the way, it interesting that both our deadlines for our GPRS projects is on Friday. Luckily, mine is going to be extended because the developer developing the unit is having problems. Isn't it wonderful when your deadline gets extended because of someone elses fault? :)

Funny enough, I seem to have struck another coincidence with Dan Rollins - the editor of this page. It appears we both began our programming careers on a Radio Shack TRS-80. Small world.... ;)
0
 
LVL 5

Expert Comment

by:danielsonchris
Comment Utility
Sorry about the delay in response.  
I was going to start typing a ton for the AT+CGDCONT cmd, but lookie here..
http://www.experts-exchange.com/Programming/Wireless_Programming/GPRS/Q_20653264.html
--or-- C & P

AT+CGDCONT=<cid>, <PDP_Type>, <APN>, <PDP_Addr>

This command specifies PDP context parameter values for a PDP context
identified by  the (local) context identification parameter, <cid>.  A special
form of the set command, +CGDCONT= <cid> causes the values for con-
text number <cid> to become undefined.

<cid>
This PDP Context Identifier is a numeric parameter
which specifies a particular PDP context definition.
The parameter is local to the TE-MT interface and is
also used in other PDP context-related commands. If
no cid is given, nothing will be changed (neither
context definition nor undefinition)

<PDP_Type>
Packet Data Protocol type is a string parameter which
specifies the type of packet data protocol:

Values:
IP    Internet Protocol (IETF STD 5)


<APN>
Access Point Name is a string parameter (framed by
quotation marks) which is a logical name that is used
to select the GGSN or the external packet data net-
work. If the value is null or omitted, then the subscrip-
tion value will be requested.

<PDP_Addr>
String parameter that identifies the MT in the address
space applicable to the PDP (e.g. IP V4 address for
PDP type IP). If the value is null or omitted, then a
value may be provided by the TE during the PDP
startup procedure or, failing that, a dynamic address
will be requested.

====================
>Secondly, if I wanted to use UDP instead of TCP, which I know is a connectionless protocol and has less overhead, wold it >be very different? Could you maybe show me the AT commands required in this case?
>

In my current circumstance using UDP is something that is handled in my configuration string per the IntelliTrac X8 unit.  Other than that... I would think it really depends on the modem you're using.  Mine is literally flipping a bit to 0 or 1 for UDP or TCP/IP.  And it's in a non-AT command that get's filtered by a Toshiba micro-controller.

When you connect you should be able to query that you are in fact connected.  The best thing you can do is find out which modem you are focusing on and go download the manual for it.  There you will find all the commands that you need.  
Here are a few to start:
AT+CREG?     check to see if the GSM network is registered (result should be +CREG: 0,5)

AT+CGATT?    check to see if GPRS is ready and available (result should be +CGATT:1)

Well, sorry gotta run and get my project up and running!
Interesting coincidences you were mentioning.
Take care,
Chris
0
 

Author Comment

by:f_rodriguez
Comment Utility
Thank you very much for all your support Chris. To be honest, didn't understand too much the above reply, but not because you didn't explain it properly, but simply because I am very new in this field and my terminology is limited. However, I'm sure it will help me. Also thanks for the suggestion of downloading the manual for the modem I'm using. I will do that immediately. I can't believe it never occured to me to do so before. For interests sake, I'm using a Falcom Tango GSM/GPRS modem (www.falcom.de).

Regards
Fabricio
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wordsWithoutList  challenge 24 73
noX challenge 17 76
word0 challenge 4 52
eclipse package explorer vs project explorer view 2 27
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now