Using Java to Make a GPRS Connection with a Wavecom Fasttrack (GPRS) Modem

Hi,

I have a basic Java application that communicates with over a GPRS connection. Until now we have been using the Motorola v66e GPRS mobile phone connected to a USB port as our GPRS modem. This phone comes with a handy tool called GPRS Manager which is used to make the initial connection to the APN (or whatever?).

I now have write a Java application that actually makes the connection aswell as communicate over it, but using a new Wavecom GPRS Modem connected to com1 and installed as a Standard Windows Modem (9600). I was wondering if there was a Java API out there that would allow me to make a connection (with the least hassle - ie with the smallest learning curve, as I know near to nothing about AT commands etc) or if someone has a simple piece of code in Java that can make a GPRS connection using the Wavecom Modem (or any modem, as I can adapt it to my own needs if I have to)?

Thanks
Scott Curtis
scurtis_1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SimonTayCommented:
The Siemens TC45 includes a JVM, so the whole application will run on the module.  The TCP/IP stack is also included.  See www.tdc.co.uk for more information.  TDC also have a terminal (i.e. boxed, ready to go TC45) if you need one.  It's not on the web site, yet, but you can get more information if you email TDC.

Simon
0
SimonTayCommented:
In the TC45, we simply do this :

      // Setup Gprs
      String response;
      response = ata.send("AT^SJNET=GPRS," + gprsPoint + "," + gprsUser + "," + gprsPass + "\r");

      if (response.indexOf("OK") >= 0)
      {
        System.out.println("GPRS Setup : OK " + gprsPoint);
      }
 

Easy!

Simon
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SimonTayCommented:
I've also put a presentation about the TC45 at www.tdc.co.uk.

http://www.tdc.co.uk/presentations/tc45_intro.htm

Simon
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

andres101Commented:
I'm working on the exact same thing. I am able to connect GPRS, but not use it. I still need to implement an IP Stack. Have you made any progress? Please post if you do, I'll do the same!

In my code, I have a Modem class with a method sendCommand that takes two parms. The first parm is the command to send over the port, the second is what response it should expect from the modem. if the second parm is false, it doesn't wait for a response. methos return true or false. the apn in the third command should be set to your apn (normally "internet"). also change 115200 to your baud rate.

These are the AT Commands to start the GPRS.
            if (modem.sendCommand("AT+FCLASS=0;&W\r\n","OK")) {
                  //set modem into GPRS mode
                  if (modem.sendCommand("AT+CGATT=1\r\n","OK")) {
                        if (modem.sendCommand("AT+CGDCONT=1,\"IP\",\""+ apn +"\"\r\n","OK")) {
                              if (modem.sendCommand("AT+CGQREQ=1,0,0,3,0,0\r\n","OK")) {
                                    if (modem.sendCommand("AT+CGACT=1,1\r\n","OK")) {
                                          if (modem.sendCommand("AT+IPR=115200;&W\r\n","OK")) {
                                                //connect GPRS
                                                modem.sendCommand("ATD*99***1#",false);
0
andres101Commented:
the above commands are for a Wavecom FastTrack modem
0
scurtis_1Author Commented:
I did manage to get this working but it had to be fudged slightly.

We had to set the modem up as a standard windows modem with some particular settings (give me a shout if you want them and I can email a document explaining how we got it working - scott_b_curtis@mailblocks.com)

I had to make the modem connect before my java stuff happened (every 15 minutes) so I used Windows Schedular to run a batch file which used RASDIAL to dial the modem and then, once connected, my java process was kicked off. With my short time scales I didn't have enough time to make it completely Java driven as you (andres101) seem to be close to doing! If you do get a complete example together I would be really be glad to see a copy so that I can make my own system cross platform again!!

Thanks
Scott
0
andres101Commented:
i have it set up as a windows modem, but we are porting from C++ to Java as we are going to use the product on Linux. I think I will follow your route and set the connection to automatically connect and retry on failure. In my code I will just keep on trying to connect to the server.
0
andres101Commented:
thx for the assist... not sure i deserved it though...

technically i answered your question: "or if someone has a simple piece of code in Java that can make a GPRS connection using the Wavecom Modem" - my code makes a connection... just can't do anything with it.

have you made any progress or are you still using the windows dialup?

i have found a tcpip stack written completely in java:
http://www.jopdesign.com/ejip/

i can't make any sense of it though... but i must admit, i didn't try very hard.
0
scurtis_1Author Commented:
Ooops! Clicked the wrong button! :-) Enjoy the points!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Wireless Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.