[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

GPRS upload problem

Posted on 2005-04-25
10
Medium Priority
?
224 Views
Last Modified: 2010-04-01
Hi, I use a TC45 module to transmit data via gprs.
This works fairly well abou 90% of the time, the rest returns java io exception. This does not happen in a specific order or at a specific time, just randomly. The fact that the network might be the problem have been ruled out.
I'm fairly new with cellfone modules and just took this code over so any help would be appreciated.

I initialize my GPRS in the beginning as follow:

        try
        {
            Jnet = "at^sjnet=ppp,\"\",\"\",\"\"";
            Kry = ATCmd.send(Jnet + "\r");
        }
        catch (ATCommandFailedException e)
        {
            System.out.println(e);
        }
        try
        {
            Jnet = "at^sjnet=gprs,internet,\"\",\"\"";
            Kry = ATCmd.send(Jnet + "\r");
            System.out.println(Kry) ;
        }
        catch (ATCommandFailedException e)
        {
            System.out.println(e);
        }  

and the following are repeated every say 3 minutes.

         try
         {
                 HttpConnection connection = (HttpConnection) Connector.open(URL);
                 connection.openDataInputStream();
                 Rcvhttp = connection.getResponseMessage();
                 connection.close();
          }
          catch (IOException e)
          {
          }

with Rcvhttp == "" when the exception gets thrown

any suggestions welcome

Thanks
0
Comment
Question by:broodblik
  • 5
  • 3
8 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 13858741
what exception do you get?
0
 

Author Comment

by:broodblik
ID: 13858833
java io exception
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13858859
Yeah, can you post the stack trace?

It should give more information...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 35

Expert Comment

by:TimYates
ID: 13858869
Get rid of this:

            System.out.println(e);

and replace them both with this:

            e.printStackTrace() ;

You'll get much better information...
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13858883
And I take it its the;

         try
         {
                 HttpConnection connection = (HttpConnection) Connector.open(URL);
                 connection.openDataInputStream();
                 Rcvhttp = connection.getResponseMessage();
                 connection.close();
          }
          catch (IOException e)
          {
          }

which the exception occurs in?
0
 

Author Comment

by:broodblik
ID: 13858928
yes the exception does occur in that part. I will put in the stack trace, the problem can take quite a few hours to occur, so i'll have to wait for that.
thx
0
 
LVL 35

Accepted Solution

by:
TimYates earned 200 total points
ID: 13858986
There isn't a limit to the size of data you can send via an AT command is there?  Could it be this?

I am not an expert in GPRS comms :-(

Maybe it would be worth your while posting a 20 point question here:  http://www.experts-exchange.com/Programming/Wireless_Programming/GPRS/

Asking people to come and have a look at this question...

I would also recommend you do something similar to:

         HttpConnection connection = null ;
         try
         {
                 connection = (HttpConnection) Connector.open(URL);
                 connection.openDataInputStream();
                 Rcvhttp = connection.getResponseMessage();
          }
          catch (IOException e)
          {
          }
          finally
          {
                 try { if( connection != null ) connection.close() ; } catch( IOException ex ) {}
          }

to ensure your connection is closed...

Tim
0
 

Author Comment

by:broodblik
ID: 13859161
Thanks I will simulate this code for the night and see if there is an improvement. I will further post a Q in the GPRS devision.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I came across an unsolved Outlook issue and here is my solution.
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month20 days, 8 hours left to enroll

868 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