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.openDataInputSt ream();
Rcvhttp = connection.getResponseMess age();
connection.close();
}
catch (IOException e)
{
}
with Rcvhttp == "" when the exception gets thrown
any suggestions welcome
Thanks
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.openDataInputSt
Rcvhttp = connection.getResponseMess
connection.close();
}
catch (IOException e)
{
}
with Rcvhttp == "" when the exception gets thrown
any suggestions welcome
Thanks
what exception do you get?
ASKER
java io exception
Yeah, can you post the stack trace?
It should give more information...
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...
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.openDataInputSt ream();
Rcvhttp = connection.getResponseMess age();
connection.close();
}
catch (IOException e)
{
}
which the exception occurs in?
try
{
HttpConnection connection = (HttpConnection) Connector.open(URL);
connection.openDataInputSt
Rcvhttp = connection.getResponseMess
connection.close();
}
catch (IOException e)
{
}
which the exception occurs in?
ASKER
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
thx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.