Hi,
I'm new to Smslib. I'm trying to make a simple test case on my Raspberry pi.
I installed Rxtx library that works fine:

root@raspberrypi:~# javaDjava.library.path=/usr/lib/rxtx:/usr/lib/jni -jar 
smslib-dep-dev-20140810.184201-3-all.jar 
log4j:WARN No appenders could be found for logger (org.smslib.threading.
CallbackManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for 
more info.
SMSLib - A universal API for sms messaging
Copyright (c) 2002-2014, smslib.org
This software is distributed under the terms of the
Apache v2.0 License (http://www.apache.org/licenses/LICENSE-2.0.html).
SMSLib Version: dev-SNAPSHOT
OS Version: Linux / arm / 3.18.5+
JAVA Version: 1.8.0_33
JAVA Runtime Version: 1.8.0_33-b05
JAVA Vendor: Oracle Corporation
JAVA Class Path: smslib-dep-dev-20140810.184201-3-all.jar

Running port autodetection / diagnostics...

WARNING:  RXTX Version mismatch
        Jar version = RXTX-2.2pre1
        native lib Version = RXTX-2.2pre2
====== Found port: /dev/ttyUSB1
>> Trying at   9600...  Getting Info... Found: AT+CGMME220
>> Trying at  14400...  Getting Info... Found: AT+CGMME220
>> Trying at  19200...  Getting Info... Found: AT+CGMME220
>> Trying at  28800...  Getting Info... Found: AT+CGMME220
>> Trying at  33600...  Getting Info... Found: AT+CGMME220
>> Trying at  38400...  Getting Info... Found: AT+CGMME220
>> Trying at  56000...  Getting Info... Found: AT+CGMME220
>> Trying at  57600...  Getting Info... Found: AT+CGMME220
>> Trying at 115200...  Getting Info... Found: AT+CGMME220
====== Found port: /dev/ttyUSB0
>> Trying at   9600...  Getting Info... Found: AT+CGMME220
>> Trying at  14400...  Getting Info... Found: AT+CGMME220
>> Trying at  19200...  Getting Info... Found: AT+CGMME220
>> Trying at  28800...  Getting Info... Found: AT+CGMME220
>> Trying at  33600...  Getting Info... Found: AT+CGMME220
>> Trying at  38400...  Getting Info... Found: AT+CGMME220
>> Trying at  56000...  Getting Info... Found: AT+CGMME220
>> Trying at  57600...  Getting Info... Found: AT+CGMME220
>> Trying at 115200...  Getting Info... Found: AT+CGMME220

Test complete.


This is my simple code:

public static void main(String[] args) {
        try {
            log.debug("Avvio il servizio");
            Service.getInstance().start();

            Modem modem = new Modem("modem1", "/dev/ttyUSB1", "115200", 
"0000",
                    "0000", "");
            Service.getInstance().registerGateway(modem);
            log.debug("Modem registrato");
            OutboundMessage m = new OutboundMessage("393470841943",
                    "Hello there!");
            Service.getInstance().send(m);
            log.debug("Invio sms");

            log.debug("Stop servizio");
            Service.getInstance().stop();
            Service.getInstance().terminate();
        } catch (Exception e) {
            log.error("", e);
        }

    }

but I've this exception:

 java -Djava.library.path=/usr/lib/rxtx:/usr/lib/jni -jar gsmgateway-jar-
with-dependencies.jar 
04/02/2015 19:26:44 DEBUG Main:13 - Avvio il servizio
04/02/2015 19:26:46 ERROR Main:29 - 
java.lang.ArrayIndexOutOfBoundsException: 5
        at org.smslib.gateway.modem.Modem.<init>(Modem.java:72)
        at it.pianetatecno.gsmgateway.Main.main(Main.java:16)


I'm doing something wrong?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"SMSLib Discussion Group" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/smslib/49e9836a-6917-49a3-884c-ae81fef975a8%40googlegroups.com.

Reply via email to