Solved

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

Posted on 2003-11-20
9
1,324 Views
Last Modified: 2013-12-09
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
0
Comment
Question by:scurtis_1
  • 4
  • 3
  • 2
9 Comments
 
LVL 4

Expert Comment

by:SimonTay
ID: 9971484
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
 
LVL 4

Accepted Solution

by:
SimonTay earned 250 total points
ID: 9985076
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
 
LVL 4

Expert Comment

by:SimonTay
ID: 10250922
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 5

Assisted Solution

by:andres101
andres101 earned 250 total points
ID: 10288160
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
 
LVL 5

Expert Comment

by:andres101
ID: 10288164
the above commands are for a Wavecom FastTrack modem
0
 

Author Comment

by:scurtis_1
ID: 10288265
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
 
LVL 5

Expert Comment

by:andres101
ID: 10288896
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
 
LVL 5

Expert Comment

by:andres101
ID: 10676564
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
 

Author Comment

by:scurtis_1
ID: 10676628
Ooops! Clicked the wrong button! :-) Enjoy the points!
0

Featured Post

Register Today - IoT Current and Future Threats

Are you prepared to protect your organization from current and future IoT Threats?  Join our Wi-Fi expert in episode three of our webinar series for a look at the current state of Wi-Fi IoT and what may lie ahead. Register for our live webinar on April 20th at 9 am PDT!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
Multi-source agreements are important because they set standards that all manufacturers should follow to ensure that devices are compatible with multiple vendors. The multi-source agreement (MSA) is an agreement that establishes how multiple vendors…
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

713 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