geniousprogrammer / smslib

Automatically exported from code.google.com/p/smslib
0 stars 1 forks source link

.Net Example code not working with my modem #402

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi All,
i am using the smslib.net and want to send sms via a Teltonika USB Modem.
but not able to connect with the modem . i am using the esen and recieves 
examples with smslib.net
Following are the logs of the activity. kindly help me out thanks

0      2010-10-28 11:31:19,703 [Thread-0] INFO  org.smslib.helper.Logger  - SMSL
ib: A Java API library for sending and receiving SMS via a GSM modem or other su
pported gateways.
This software is distributed under the terms of the Apache v2.0 License.
Web Site: http://smslib.org
93     2010-10-28 11:31:19,796 [Thread-0] INFO  org.smslib.helper.Logger  - Vers
ion: 3.4.6
93     2010-10-28 11:31:19,796 [Thread-0] INFO  org.smslib.helper.Logger  - JRE
Version: 1.6.0
93     2010-10-28 11:31:19,796 [Thread-0] INFO  org.smslib.helper.Logger  - JRE
Impl Version: 0.40.0.1
93     2010-10-28 11:31:19,796 [Thread-0] INFO  org.smslib.helper.Logger  - O/S:
 Windows XP / x86 / 5.1
156    2010-10-28 11:31:19,859 [Thread-0] DEBUG org.smslib.helper.Logger  - Init
ialized.
172    2010-10-28 11:31:19,875 [DelayQueueManager] DEBUG org.smslib.helper.Logge
r  - Running...
172    2010-10-28 11:31:19,875 [Thread-0] DEBUG org.smslib.helper.Logger  - Init
ialized.
172    2010-10-28 11:31:19,875 [DelayQueueManager] DEBUG org.smslib.helper.Logge
r  - DelayQueueManager running...
187    2010-10-28 11:31:19,890 [NotifyQueueManager] DEBUG org.smslib.helper.Logg
er  - Running...
203    2010-10-28 11:31:19,906 [NotifyQueueManager] DEBUG org.smslib.helper.Logg
er  - NotifyQueueManager running...
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.6
265    2010-10-28 11:31:19,968 [Thread-0] DEBUG org.smslib.helper.Logger  - Init
ialized.
281    2010-10-28 11:31:19,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
281    2010-10-28 11:31:19,984 [Thread-5] INFO  org.smslib.helper.Logger  - GTW:
 modem.com5: Starting gateway, using Teltonika ModemUSB AT Handler.
297    2010-10-28 11:31:20,000 [Thread-5] INFO  org.smslib.helper.Logger  - GTW:
 modem.com5: Opening: 12000 @19200
Exception in thread "Thread-5" java.lang.ExceptionInInitializerError
        at org.smslib.helper.CommPortIdentifier.getPortIdentifiers(CommPortIdent
ifier.java)
        at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java
:92)
        at org.smslib.modem.AModemDriver.connect(AModemDriver.java:113)
        at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:187)
        at org.smslib.Service$1Starter.run(Service.java:322)
        at java.lang.Thread.threadProc(Thread.java:2297)
        at java.lang.Thread$1.Invoke(Thread.java:797)
        at cli.System.Threading.ThreadHelper.ThreadStart_Context(Unknown Source)

        at cli.System.Threading.ExecutionContext.Run(Unknown Source)
        at cli.System.Threading.ThreadHelper.ThreadStart(Unknown Source)
Caused by: java.lang.RuntimeException: CommPortIdentifier class not found
        at org.smslib.helper.CommPortIdentifier.<clinit>(CommPortIdentifier.java
:76)
        at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java
:92)
        at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114)
        at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:188)
        ... 6 more
15281  2010-10-28 11:31:34,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
30281  2010-10-28 11:31:49,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
45281  2010-10-28 11:32:04,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
60281  2010-10-28 11:32:19,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
75281  2010-10-28 11:32:34,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
90281  2010-10-28 11:32:49,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
105281 2010-10-28 11:33:04,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
120281 2010-10-28 11:33:19,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
135281 2010-10-28 11:33:34,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
150281 2010-10-28 11:33:49,984 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
165297 2010-10-28 11:34:05,000 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
180297 2010-10-28 11:34:20,000 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
195297 2010-10-28 11:34:35,000 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
210312 2010-10-28 11:34:50,015 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
230968 2010-10-28 11:35:10,671 [WatchDog] DEBUG org.smslib.helper.Logger  - Runn
ing...
=========================================================================

And Connection settings are as follows
===========================================

...
Comm2IP.Comm2IP com1 = new Comm2IP.Comm2IP(new byte[] { 127, 0, 0, 1 }, 12000, 
"com5", 19200);
....
....
...
SerialModemGateway gateway = new SerialModemGateway("modem.com5", "12000" , 
19200, "Teltonika", "ModemUSB");
//gateway.setIpProtocol(ModemGateway.IPProtocols.BINARY);
...
....
...

Original issue reported on code.google.com by syedwaq...@gmail.com on 28 Oct 2010 at 6:44

GoogleCodeExporter commented 8 years ago
With .NET, modems are defined as IP gateways. Look at the ReadMessage sample:

IPModemGateway gateway = new IPModemGateway("modem.com4", "127.0.0.1", 12000, 
"Huawei", "");

Your declaration as a SerialModemGateway is wrong.

Original comment by T.Delenikas on 28 Oct 2010 at 5:39