Hi, You are using JavaComm, right? There are reports of problems with JavaComm v3 and certain linux distros. Can you please remove JavaComm, install RxTx and try again?
On Mar 9, 8:31 pm, aathisankar c <[email protected]> wrote: > hi hari, > thank you very much for the useful information i found my nokia phone > connected to ttyACM0 port... > i got error like this when running the program, > [r...@technocraft killing process]# java SendMessagel > Enter the GSM Modem name: > nokia > Enter the model number: > n72 > Enter the port where gsm modem connected to: > /dev/ttyACM0 > Enter the pin no: > 0000 > Enter the recipient number: > +919943425268 > org.smslib.GatewayException: Comm library exception: > java.lang.RuntimeException: javax.comm.NoSuchPortException > at > org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:92) > at org.smslib.modem.AModemDriver.connect(AModemDriver.java:110) > at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:126) > at org.smslib.Service$1Starter.run(Service.java:222) > > My source code is > import org.smslib.IOutboundMessageNotification; > import org.smslib.Library; > import org.smslib.OutboundMessage; > import org.smslib.Service; > import org.smslib.modem.SerialModemGateway; > import java.io.*; > > public class SendMessagel > { > public void doIt() throws Exception > { > Service srv; > OutboundMessage msg; > OutboundNotification outboundNotification = new OutboundNotification(); > BufferedReader stdin = new BufferedReader(new > InputStreamReader(System.in)); > String phname,modelno,portno,pin,recino; > > srv = new Service(); > > System.out.println("Enter the GSM Modem name:"); > phname=stdin.readLine(); > > System.out.println("Enter the model number:"); > modelno=stdin.readLine(); > > System.out.println("Enter the port where gsm modem connected to:"); > portno=stdin.readLine(); > > System.out.println("Enter the pin no:"); > pin=stdin.readLine(); > > System.out.println("Enter the recipient number:"); > recino=pin=stdin.readLine(); > > SerialModemGateway gateway = new SerialModemGateway("modem.com1", portno, > 57600, phname, modelno); > gateway.setInbound(true); > gateway.setOutbound(true); > gateway.setSimPin("0000"); > srv.setOutboundNotification(outboundNotification); > srv.addGateway(gateway); > srv.startService(); > System.out.println(); > System.out.println("Modem Information:"); > System.out.println(" Manufacturer: " + gateway.getManufacturer()); > System.out.println(" Model: " + gateway.getModel()); > System.out.println(" Serial No: " + gateway.getSerialNo()); > System.out.println(" SIM IMSI: " + gateway.getImsi()); > System.out.println(" Signal Level: " + gateway.getSignalLevel() + "%"); > System.out.println(" Battery Level: " + gateway.getBatteryLevel() + "%"); > System.out.println(); > > // Send a message synchronously. > > msg = new OutboundMessage(recino, "welcome to sms lib"); > srv.sendMessage(msg); > System.out.println(msg); > System.out.println("Now Sleeping - Hit <enter> to terminate."); > System.in.read(); > srv.stopService(); > } > > public class OutboundNotification implements IOutboundMessageNotification > { > public void process(String gatewayId, OutboundMessage msg) > { > System.out.println("Outbound handler called from Gateway: " + gatewayId); > System.out.println(msg); > } > } > > public static void main(String args[]) > { > SendMessagel app = new SendMessagel(); > try > { > app.doIt(); > } > catch (Exception e) > { > e.printStackTrace(); > } > } > > } > > could you plz tell me what error is that,.,. > thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SMSLib User 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 -~----------~----~----~----~------~----~------~--~---
