Hi all I'm evaluating SMSLib for using it in an application. First of all I did a very easy junit test to try to send a SMS using this library. I'm using rxtx. I found a few issues until I got (almost) everything working:
first of all, I found no way of getting the notorious Java Standard Extension javax.comm V3, Sun is now part of Oracle and I found this library in no place in their webpage. The only links that work now are: - The description (with no download link) http://www.oracle.com/technetwork/java/index-jsp-141752.html - The reference API http://download.oracle.com/docs/cd/E17802_01/products/products/javacomm/reference/api/index.html - The User's guide (again, no download link) http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Second problem: I installed the rxtx library instead, and in the instructions I read that the library librxtxSerial.so must be copied into jre/bin. This configuration was not working for me, and after try and error I got it working placing it in jre/lib/amd64 , note that there are other .so libraries there (I'm using x86_64), so I think (unless I'm wrong) that It if fix Third problem: After having everything ready to start my test, I wrote a small junit test that looks like that (really easy) package test; import java.io.File; public class TestClass { private org.apache.log4j.Logger logger = Logger.getLogger(TestClass.class); private Service service = Service.getInstance(); @Test public void test() throws IOException, InterruptedException, SMSLibException { System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyACM0"); //Configure a serial modem gateway SerialModemGateway serialModemGateway = new SerialModemGateway("mygateway", "/dev/ttyACM0", 57600, "Wavecom", ""); serialModemGateway.setProtocol(Protocols.PDU); serialModemGateway.setInbound(true); serialModemGateway.setOutbound(true); //serialModemGateway.setSimPin("XXXX"); //add the gateway service.addGateway(serialModemGateway); service.startService(); // point where the application fail! //create a message OutboundMessage outboundMessage = new OutboundMessage("XYZ", "Hellow World!"); boolean send = service.sendMessage(outboundMessage, "mygateway"); if (!send) { throw new RuntimeException("The message cannot be send"); } } } It fails, this is the detailed log file: INFO smslib - SMSLib: A Java API library for sending and receiving SMS via a GSM modem or other supported gateways. This software is distributed under the terms of the Apache v2.0 License. Web Site: http://smslib.org INFO smslib - Version: 3.5.0 INFO smslib - JRE Version: 1.6.0_27 INFO smslib - JRE Impl Version: 20.2-b06 INFO smslib - O/S: Linux / amd64 / 2.6.37.6-0.7-desktop DEBUG smslib - Initialized. DEBUG smslib - Running... DEBUG smslib - NotifyQueueManager running... INFO smslib - Queue directory not defined. Queued messages will not be saved to filesystem. DEBUG smslib - Initialized. DEBUG smslib - Running... DEBUG smslib - DelayQueueManager running... DEBUG smslib - Initialized. DEBUG smslib - Running... INFO smslib - GTW: mygateway: Starting gateway, using Wavecom (Generic) AT Handler. INFO smslib - GTW: mygateway: Using polled serial port mode. INFO smslib - GTW: mygateway: Opening: /dev/ttyACM0 @57600 Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 INFO smslib - GTW: mygateway: Closing: /dev/ttyACM0 @57600 DEBUG smslib - NotifyQueueManager end... DEBUG smslib - DelayQueueManager end... DEBUG smslib - Running... DEBUG smslib - NotifyQueueManager running... DEBUG smslib - Stopped. INFO smslib - GTW: mygateway: Stopping gateway... DEBUG smslib - GTW: mygateway: SEND :AT+WATH=31(cr) Experimental: JNI_OnLoad called. And last, the exception java.lang.NullPointerException at org.smslib.modem.SerialModemDriver.write(SerialModemDriver.java:166) at org.smslib.modem.AModemDriver.write(AModemDriver.java:302) at org.smslib.modem.athandler.ATHandler_Wavecom.done(ATHandler_Wavecom.java:52) at org.smslib.modem.ModemGateway.stopGateway(ModemGateway.java:198) at org.smslib.Service.stopService(Service.java:353) at org.smslib.Service.startService(Service.java:232) at org.smslib.Service.startService(Service.java:195) [...] This is the information about the modem I'm using: [ 9703.809111] usb 4-3: new full speed USB device using ohci_hcd and address 2 [ 9703.965159] usb 4-3: New USB device found, idVendor=114f, idProduct=1234 [ 9703.965168] usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 9703.965174] usb 4-3: Product: WAVECOM MODEM [ 9703.965180] usb 4-3: Manufacturer: WAVECOM [ 9703.965184] usb 4-3: SerialNumber: BH1270174208100 [ 9704.664761] cdc_acm 4-3:1.0: ttyACM0: USB ACM device [ 9704.667244] usbcore: registered new interface driver cdc_acm [ 9704.667246] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters lsusb: Bus 004 Device 002: ID 114f:1234 Wavecom The modem is aFastrack Xtend FXT009 made by Sierra Wireless If you need any further information, I'm more than happy to provide it, an ideas would be really appreciated. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "SMSLib Discussion 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.
