Link to home
Start Free TrialLog in
Avatar of broodblik
broodblik

asked on

GPRS upload problem

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
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

what exception do you get?
Avatar of broodblik
broodblik

ASKER

java io exception
Yeah, can you post the stack trace?

It should give more information...
Get rid of this:

            System.out.println(e);

and replace them both with this:

            e.printStackTrace() ;

You'll get much better information...
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?
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
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.