Drop the previous message. I found the nullpointer exception, but
still have trouble:
I run the example with the command:
/usr/lib/jvm/java-6-openjdk/bin/java -Djava.library.path=. -
cp .:smslib-3.4.5.jar:RXTXcomm.jar:slf4j-api-1.5.10.jar:slf4j-
log4j12-1.5.10.jar:log4j-1.2.15.jar misc/ReadMessages
Service object is made and instratiated: = OK!
Gateways are added = OK!
but when I reach the line:
System.out.println(" Manufacturer: " + gateway.getManufacturer());
it stops and times out, and I get:
xperimental: JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
>>> Gateway Status change for ttyS0, OLD: STOPPED -> NEW: RESTART
>>> Gateway Status change for ttyS0, OLD: RESTART -> NEW: STOPPING
>>> Gateway Status change for ttyS0, OLD: STOPPING -> NEW: STOPPED
org.smslib.TimeoutException: No response from device.
at org.smslib.modem.AModemDriver$CharQueue.get
(AModemDriver.java:531)
at org.smslib.modem.AModemDriver.getResponse(AModemDriver.java:
329)
at org.smslib.modem.athandler.ATHandler.getSimStatus
(ATHandler.java:132)
at org.smslib.modem.AModemDriver.connect(AModemDriver.java:
129)
at org.smslib.modem.ModemGateway.startGateway
(ModemGateway.java:186)
at org.smslib.Service$1Starter.run(Service.java:257)
b...@littlegeek:~/Programming/NetBeansProjects/CellPhoneTest/src$
Now, You told me to insert the line:
<ServiceObject>.getSettings().SERIAL_RTSCTS_OUT = false.
BUT! That should is not effecting the serviceObject as it is only a
return value.
Would the correct way not be:
Settings tempSettings = srv.getSettings();
tempSettings.SERIAL_RTSCTS_OUT = false;
srv.setSettings(tempSettings);
... but unfortunately the setSettings(Settings) is for some reason a
private function and can not be accessed.
Any other ideas? I am pretty sure the RTSCTS is the problem!
On Jan 16, 9:28 pm, Thanasis <[email protected]> wrote:
> No...
> Are you getting the NPE on the "x = new Service()" call?
>
> On Jan 16, 6:39 pm, Bo Visfeldt <[email protected]> wrote:
>
> > Got the CommTest to work.
> > Tried the ReadMessages example, but I keep getting a nullpointer when
> > trying to instantiate the service object.
> > Any idea why?
>
> > On Jan 15, 10:04 pm, Thanasis <[email protected]> wrote:
>
> > > Hi Bo,
>
> > > Leaving CommTest aside, you can accomplish the same in your SMSLib app
> > > by setting the SERIAL_RTSCTS_OUT variable to true or false and check
> > > if this works.
> > > Immediately after the initialization of the Service object, you can
> > > write:
>
> > > <ServiceObject>.getSettings().SERIAL_RTSCTS_OUT = true; (or false).
>
> > > This way, you won't need to modify the sources.
> > > Try to run the ReadMessages sample with the above change and let me
> > > know if it works.
>
> > > On Jan 15, 10:49 pm, Bo Visfeldt <[email protected]> wrote:
>
> > > > Yes. am using smslib v 3.4.5
> > > > and CommText.java will only run if I *remove* line 53 which is:
> > > > serialPort.setFlowControlMode(SERIALPORT.FLOWCONTROL_RTSCTS_IN
>
> > > > On Jan 15, 3:42 pm, Thanasis <[email protected]> wrote:
>
> > > > > Are you using the latest v3.4.5 SMSLib version?
>
> > > > > On Jan 15, 2:20 pm, Bo Visfeldt <[email protected]> wrote:
>
> > > > > > Sorry, I ment that it worked when i removed the line
> > > > > > serialPort.setFlowControlMode(SERIALPORT.FLOWCONTROL_RTSCTS_IN)
> > > > > > from the CommTest
> > > > > > How will that effect the usage of smslib?
>
> > > > > > On Jan 15, 7:54 am, Thanasis <[email protected]> wrote:
>
> > > > > > > Hmmm... There is no such comment in the current version, is
> > > > > > > there???
> > > > > > > What smslib version are you using?
>
> > > > > > > On Jan 15, 1:06 am, Bo Visfeldt <[email protected]> wrote:
>
> > > > > > > > OK, I think I got it to work.
> > > > > > > > I gathered from the comm exception that there was somthing
> > > > > > > > wrong with
> > > > > > > > properties of the serialport and uncommented the line:
> > > > > > > > serialPort.setFlowControlMode(SERIALPORT.FLOWCONTROL_RTSCTS_IN).
> > > > > > > > After that it worked perfectly.
> > > > > > > > Iguess that mean that I am running without flowcontrol.
> > > > > > > > Will that work in the long run?
>
> > > > > > > > On Jan 14, 11:21 pm, Bo Visfeldt <[email protected]> wrote:
>
> > > > > > > > > Yes. First I created the file gnu.io.rxtx.properties in
> > > > > > > > > jre/lib/rxt
> > > > > > > > > with the following line in it:
> > > > > > > > > gnu.io.rxtx.SerialPorts=/dev/usb/ttyUSB0
> > > > > > > > > (Also placed it in the executing directory, which is in the
> > > > > > > > > classpath
> > > > > > > > > just to be sure)
> > > > > > > > > Did not work.
>
> > > > > > > > > then I created a symbolic link from /dev/ttyUSB0 to
> > > > > > > > > /dev/ttyS20 as
> > > > > > > > > surgested, but still did not work.
>
> > > > > > > > > ... But i do not think that the port is the problem as the
> > > > > > > > > CommTest
> > > > > > > > > says:
> > > > > > > > > Found port: /dev/ttyUSB0
> > > > > > > > > Trying at 9600... no device found
> > > > > > > > > Trying at 19200... no device found
> > > > > > > > > Trying at 38400... no device found
> > > > > > > > > Trying at 57600... no device found
> > > > > > > > > Trying at 115200... no device found
>
> > > > > > > > > It seems that the port is detected but the reply does not
> > > > > > > > > somehow get
> > > > > > > > > through.
> > > > > > > > > Any other ideas?
>
> > > > > > > > > On Jan 14, 8:10 am, Thanasis <[email protected]> wrote:
>
> > > > > > > > > > Have you read
> > > > > > > > > > this:http://smslib.org/doc/smslib/troubleshooting/#Linux_and_undetectable_...
> > > > > > > > > > ?
>
> > > > > > > > > > On Jan 13, 9:14 pm, Bo Visfeldt <[email protected]> wrote:
>
> > > > > > > > > > > I am having huge trouble getting the CommTest to work.
> > > > > > > > > > > The device is a Sony Ericsson k300i, should be supported
> > > > > > > > > > > and is
> > > > > > > > > > > connected to /dev/ttyUSB0.
> > > > > > > > > > > It works perfectly if i use a terminal to access it.
>
> > > > > > > > > > > When I try with RxTx i get:
> > > > > > > > > > > Found port: /dev/ttyUSB0
> > > > > > > > > > > Trying at 1200... no device found
> > > > > > > > > > > Trying at 2400... no device found
> > > > > > > > > > > Trying at 4800... no device found
> > > > > > > > > > > Trying at 9600... no device found
> > > > > > > > > > > Trying at 19200... no device found
> > > > > > > > > > > Trying at 38400... no device found
> > > > > > > > > > > Trying at 57600... no device found
> > > > > > > > > > > Trying at 115200... no device found
>
> > > > > > > > > > > I tried switching RxTx with Java Comm v3. ... and it
> > > > > > > > > > > works -
> > > > > > > > > > > SOMETIMES.
> > > > > > > > > > > More specifically: It works at all the above baudrates IF
> > > > > > > > > > > the comm
> > > > > > > > > > > library has tried and failed on ttyS0 first.
> > > > > > > > > > > If It does not - it fails.
>
> > > > > > > > > > > if using the comm library AND i manage to get it to
> > > > > > > > > > > work,i get errors
> > > > > > > > > > > anyway:
> > > > > > > > > > > Trying at 4800...java.io.IOException: Not all
> > > > > > > > > > > params are
> > > > > > > > > > > supported by kernel
> > > > > > > > > > > at
> > > > > > > > > > > com.sun.comm.LinuxSerial.nativeSetSerialPortParams(Native
> > > > > > > > > > > Method)
> > > > > > > > > > > at com.sun.comm.LinuxSerial.setFlowControlMode
> > > > > > > > > > > (LinuxSerial.java:374)
> > > > > > > > > > > at
> > > > > > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > > > > > > > > Method)
> > > > > > > > > > > at sun.reflect.NativeMethodAccessorImpl.invoke
> > > > > > > > > > > (NativeMethodAccessorImpl.java:57)
> > > > > > > > > > > at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > > > > > > > > > > (DelegatingMethodAccessorImpl.java:43)
> > > > > > > > > > > at java.lang.reflect.Method.invoke(Method.java:
> > > > > > > > > > > 616)
> > > > > > > > > > > at org.smslib.helper.SerialPort.setFlowControlMode
> > > > > > > > > > > (SerialPort.java:580)
> > > > > > > > > > > at misc.CommTest.main(CommTest.java:53)
> > > > > > > > > > > Getting Info... Found: AT+CGMMAAB-1021071-
> > > > > > > > > > > BV
>
> > > > > > > > > > > Am really not sure what to do.
> > > > > > > > > > > would prefer rxtx if I could get it to work, but it does
> > > > > > > > > > > appearently
> > > > > > > > > > > not detect the modem. the comm library is quite odd and
> > > > > > > > > > > does not seem
> > > > > > > > > > > stable.
>
> > > > > > > > > > > what to do?
>
>
--
You received this message because you are subscribed to the Google Groups
"SMSLib for Java 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.