Ok, forget about the CNMI problems for now (not important). What kind of messages do you have in your modem's inbox? SMSLib cannot read non-text messages (mms, vcards, etc) and that OutOfBounds exception usually comes from there. Could this be the case?
On Feb 10, 3:30 pm, KJ <[email protected]> wrote: > Hi, > > I've added a delay before COPS, but now the program breaks at two > different points instead: > > Example: Read messages from a serial gsm modem. > SMSLib: A Java API library for sending and receiving SMS via a GSM > modem or othe > r supported gateways. > This software is distributed under the terms of the Apache v2.0 > License. > Web Site:http://smslib.org > Version: 3.4.4 > 10-Feb-2010 21:16:25 org.smslib.helper.Logger logInfo > INFO: SMSLib: A Java API library for sending and receiving SMS via a > GSM modem o > r other supported gateways. > This software is distributed under the terms of the Apache v2.0 > License. > Web Site:http://smslib.org > 10-Feb-2010 21:16:25 org.smslib.helper.Logger logInfo > INFO: Version: 3.4.4 > 10-Feb-2010 21:16:25 org.smslib.helper.Logger logInfo > INFO: JRE Version: 1.6.0_18 > 10-Feb-2010 21:16:25 org.smslib.helper.Logger logInfo > INFO: JRE Impl Version: 16.0-b13 > 10-Feb-2010 21:16:25 org.smslib.helper.Logger logInfo > INFO: O/S: Windows XP / x86 / 5.1 > 10-Feb-2010 21:16:25 org.smslib.helper.Logger logInfo > INFO: GTW: modem: Starting gateway, using Generic AT Handler. > 10-Feb-2010 21:16:25 org.smslib.helper.Logger logInfo > INFO: GTW: modem: Opening: COM4 @115200 > 10-Feb-2010 21:16:45 org.smslib.helper.Logger logWarn > WARNING: GTW: modem: GSM: Not registered, searching for network... > 10-Feb-2010 21:16:50 org.smslib.helper.Logger logInfo > INFO: GTW: modem: GSM: Registered to home network. > 10-Feb-2010 21:16:50 org.smslib.helper.Logger logInfo > INFO: GTW: modem: MEM: Storage Locations Found: MESM > 10-Feb-2010 21:16:50 org.smslib.helper.Logger logWarn > WARNING: GTW: modem: Callback indications were *not* set succesfully! > 10-Feb-2010 21:16:50 org.smslib.helper.Logger logInfo > INFO: GTW: modem: Gateway started. > > >>> Gateway Status change for modem, OLD: STOPPED -> NEW: STARTING > >>> Gateway Status change for modem, OLD: STARTING -> NEW: STARTED > > Modem Information: > Manufacturer: BenQ > Model: M32 > IMEISV: 35243000715495-0800715495-1 > SIM IMSI: ** MASKED ** > Signal Level: 64% > Battery Level: 100% > > Now Sleeping - Hit <enter> to stop service. > > 1) Cannot set callback indications, even if I hard-code supported mode > into CNMIDetector.java. > 2) After the sleeping line, nothing happens for a few seconds before > it starts constantly spouting this block of errors: > > 10-Feb-2010 21:18:38 org.smslib.helper.Logger logError > SEVERE: Error! > java.lang.StringIndexOutOfBoundsException: String index out of range: > -12 > at java.lang.String.substring(Unknown Source) > at > org.smslib.modem.ModemGateway.readMessagesPDU(ModemGateway.java:527) > at > org.smslib.modem.ModemGateway.readMessages(ModemGateway.java:206) > at org.smslib.modem.AModemDriver > $CNMIEmulatorProcessor.process(AModemDri > ver.java:946) > at org.smslib.threading.AServiceThread.run(AServiceThread.java: > 117) > > I am totally out of my depth here now. The modem tells HyperTerminal > that +CNMI: (0-2), (0-3), (0,2), (0,1), (0,1) so I doubt that's the > issue. > > If anyone's interested, adding > > getModemDriver().write("AT+CREG=1\r"); > getModemDriver().getResponse(); > > only makes it spout "framing error" and refuse to register the GSM > network (i.e., original error). > > On Feb 9, 3:39 pm, Thanasis <[email protected]> wrote: > > > > > Hi, > > > You could experiment a bit with the COPS command. Its located in src/ > > java/org/smslib/modem/athandler/ATHandler.java. Try to add a delay and > > see what happens. > > > You can also add the following 2 lines in the same method where COPS > > is: > > > getModemDriver().write("AT+CREG=1\r"); > > getModemDriver().getResponse(); > > > You should recompile after every change. You can do this with ANT, or > > with the IDE you are working with. -- You received this message because you are subscribed to the Google Groups "SMSLib User Support Group" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/smslib?hl=en.
