When executing the code
String apn = "\"gprs\",\"internet\",\"gdata\",\"gdata\",,0";
System.out.println(atcommand.send( "AT^SJNET=" + apn +
"\r" ));
,it always return
>AT^SJNET="gprs","internet","gdata","gdata",,0
>
>
>ERROR
but when I execute the same command directly using terminal program,
it always says
>Sent: AT^SJNET="gprs","internet","gdata","gdata",,0
>
>OK
I've found a workaround and connecting to internet via URL parameters
and everything is ok
String destHost = "www.myhost.ru";
String scriptPath = "/debug/setvalue.php";
String connProfile =
"bearer_type=gprs;access_point=internet;username=gdata;password=gdata";
String openParm = "http://" + destHost + scriptPath + ";" +
connProfile;
System.out.println("Connector open: " + openParm);
postViaHttpConnection(openParm, params);
int postViaHttpConnection(String url, FormField[] formdata) throws
IOException {
HttpConnection c = null;
InputStream is = null;
OutputStream os = null;
int rc;
try {
c = (HttpConnection) Connector.open(url);
.........................and so on........
it returns no error and successfully posts a form
>Connector open: http://www.myhost.ru/debug/setvalue.php;bearer_type=gprs;access_point=internet;username=gdata;password=gdata
I think that using AT^SJNET is better way connecting to net, but I
still can't understand what I'm doing wrong. Anybody have thoughts
about this?
Maybe number zero may need the "".
String apn = "\"gprs\",\"internet\",\"gdata\",\"gdata\",\"\",\"0\"";
I think this should solve your syntax problem.
Your AT+CMEE=2 advice is cool, I didn't know that!
The original string returns that:
| AT^SJNET="gprs","internet","gdata","gdata",,0
|
| +CME ERROR: invalid input value
Unfortunately, inserting quotes in DNS field didn't help:
| AT^SJNET="gprs","internet","gdata","gdata","",0
|
| +CME ERROR: invalid input value
enquoting the 0 didn't help, it returns the same thing:
| AT^SJNET="gprs","internet","gdata","gdata","","0"
|
| +CME ERROR: invalid input value
even if I try not to set DNS and timeout, still:
| AT^SJNET="gprs","internet","gdata","gdata"
|
| +CME ERROR: invalid input value
Note that when I execute the same command directly using terminal
program,
it says OK
tried to play with APN, LOGIN and PASSWORD parameters - no use :-(
Other suppositions?
> > >Connector open:http://www.myhost.ru/debug/setvalue.php;bearer_type=gprs;access_point...
--
You received this message because you are subscribed to the Google Groups "Cinterion Java enabled chips support" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javacint+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javacint?hl=en.
If you know how to ensure that GPRS session is not closed as much as
it can while using Connector.open url parameters to open GPRS
connection, please tell me!
--
Nikita
> > javacint+u...@googlegroups.com<javacint%2Bunsubscribe@googlegroups.com>
It is AT+CSCS="UCS2" command! Before I use it, AT^SJNET works good,
but after I set the encoding to UCS2, AT^SJNET fails. If I set the
encoding to GSM with AT+CSCS="GSM", then AT^SJNET returns OK - maybe
it wants me to send parameters of AT^SJNET as IRA characters?.. I
think, I'll just change the encoding to GSM in my program before
setting AT^SJNET.
> > > javacint+u...@googlegroups.com<javacint%2Bunsubscr...@googlegroups.com>