Cannot start BT747 twice on my mac (Leopard)

dargosch's picture

Hi,

I love the BT747, but I cannot get it to start twice in one session (i.e. without restarting the computer) due to the serial port not being released properly (I think). This is the information I get the second time I start the program and tries to connect to the serial port:

 

Below are informational messages that can help during debug.
------------------------------------------------
4844 - BT747 2.X.1580 Build:BT747_mdeweerd.1580.20091019003519956
4844 - Initial: 950x547  Screen: 1280x800 Final: 950x547
4845 - Mac OS X
4845 - i386
4845 - 10.5.8
4845 - 1.5.0_20
4845 - Fail javax.swing.plaf.mac.MacLookAndFeel
Fail com.apple.mrj.swing.MacLookAndFeel
Success apple.laf.AquaLookAndFeel
javax.swing.plaf.metal.MetalLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
apple.laf.AquaLookAndFeel

60371 - Classgps.connection.GPSRxTxPort

gnu.io.PortInUseException: Unknown Application
    at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
    at gps.connection.GPSRxTxPort.openPort(Unknown Source)
    at gps.connection.GPSrxtx.myOpenPort(Unknown Source)
    at gps.connection.GPSrxtx.setFreeTextPortAndOpen(Unknown Source)
    at bt747.model.Controller.openFreeTextPort(Unknown Source)
    at bt747.j2se_view.BT747Main.access$300(Unknown Source)
    at bt747.j2se_view.BT747Main$6.actionPerformed(Unknown Source)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5602)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5367)
    at java.awt.Container.processEvent(Container.java:2010)
    at java.awt.Component.dispatchEventImpl(Component.java:4068)
    at java.awt.Container.dispatchEventImpl(Container.java:2068)
    at java.awt.Component.dispatchEvent(Component.java:3903)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
    at java.awt.Container.dispatchEventImpl(Container.java:2054)
    at java.awt.Window.dispatchEventImpl(Window.java:1801)
    at java.awt.Component.dispatchEvent(Component.java:3903)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
65530 - Port opened

I am using the USB connection - the first startup works like it should though.

Very greatful for any help I can get on this.

/Fredrik

mdeweerd's picture

Hi Fredrik I just made a

Hi Fredrik

  1. I just made a change so that 2.X.1583 explicitally closes the serial connection.
  2. Does your problem happen only when the port is open when exiting BT747?
  3. Can you connect more than once inside BT747 (without closing)?
  4. When you can not reconnect in BT747, can you find the other instance of BT747 that is probably still running (using 'ps').  If yes, kill the other instance (or all instances) and then try to reconnect.  BT747 should be a process running 'java' or 'javaw'.

Hopefully the modification simply solves your issue.

dargosch's picture

Hi, Hmm, I cannot get this to

Hi,

Hmm, I cannot get this to work, I'm affraid. I can actually never disconnect sucessfully (any more). When I push the Disconnect button, the program just hangs. Please tell me what to do to investigate this further, and I'll do it.

Also, I discovered that AGPS uploading hangs now.. se log below. Again, if more information is needed, please don't hesitate to ask.

/Fredrik

11736 - BT747 2.X.1588M Build:.1588M.20091026012610015
11737 - Initial: 950x547  Screen: 1280x800 Final: 950x547
11737 - Mac OS X
11737 - i386
11737 - 10.5.8
11738 - 1.5.0_20
11738 - Fail javax.swing.plaf.mac.MacLookAndFeel
Fail com.apple.mrj.swing.MacLookAndFeel
Success apple.laf.AquaLookAndFeel
javax.swing.plaf.metal.MetalLookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
apple.laf.AquaLookAndFeel

42502 - Classgps.connection.GPSRxTxPort
RXTX Warning:  Removing stale lock file. /var/lock/LK.002.017.008
46732 - Port opened
46734 - Attempting saving settings to /Users/zak/BT747SettingsJ2SE.pdb
46736 - Writing settings success for /Users/zak/BT747SettingsJ2SE.pdb
115438 - Getting MTK7d.EPO data.
128012 - MTK7d.EPO data fetched.
During sendCmd gps.connection.GPSrxtx@f42ea0 gps.connection.GPSRxTxPort@2130d1
java.lang.NullPointerException
    at gps.connection.MtkBinWriter.sendCmd(Unknown Source)
    at gps.connection.MtkBinWriter.sendCmd(Unknown Source)
    at net.sf.bt747.gps.mtk.agps.AgpsUploadHandler.notifyRun(Unknown Source)
    at gps.mvc.GpsController.run(Unknown Source)
    at net.sf.bt747.j2se.system.J2SEThread.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:613)
During sendCmd gps.connection.GPSrxtx@f42ea0 gps.connection.GPSRxTxPort@2130d1
java.lang.NullPointerException
    at gps.connection.MtkBinWriter.sendCmd(Unknown Source)
    at gps.connection.MtkBinWriter.sendCmd(Unknown Source)
    at net.sf.bt747.gps.mtk.agps.AgpsUploadHandler.notifyRun(Unknown Source)
    at gps.mvc.GpsController.run(Unknown Source)
    at net.sf.bt747.j2se.system.J2SEThread.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:613)
146071 - AGPS upload stopped/finished
146071 - Exception created: Too many errors found during AGPS upload.<p>The upload was aborted<p>It is recommended that you clear the AGPS data and start again.
Handler:
bt747.sys.interfaces.BT747Exception: Too many errors found during AGPS upload.<p>The upload was aborted<p>It is recommended that you clear the AGPS data and start again.
    at net.sf.bt747.gps.mtk.agps.AgpsUploadHandler.notifyRun(Unknown Source)
    at gps.mvc.GpsController.run(Unknown Source)
    at net.sf.bt747.j2se.system.J2SEThread.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:613)

mdeweerd's picture

I fixed the issue(s) which

  1. I fixed the issue(s) which resulted in your AGPS upload problem in 2.X.1595.  I also rebuilt the J2ME version because that logically was impacted too.
    To the end user this bug was 'random'.  I was lucky to reproduce it too which helped me fix the visible issue and another one.
  2. This leaves us with the reconnect/exit issue.  What happens when you disconnect - any error message?  Regarding messages upon exit: you can either activate the Java Console to make sure that you see the error messages (given that BT747 hangs, you can not see them there), or you can launch BT747 through the startup script in a shell.  You can replace '$JAVA' with 'java' and you should see the console messages in the shell window.  Hopefully you get some interesting messages that will help us locate the problem.
dargosch's picture

Hi! Yes, regardning the first

Hi!

Yes, regardning the first issue, uploading AGPS data now seems to work. I get this message though (maybe it is nothing to worry about?)

....
303435 - <<MtkBinMsgType:2 Payload:0x2A0101
303457 - AGPS upload stopped/finished
304439 - Problem - report NMEA is 0 length
304688 - Problem - report NMEA is 0 length

Concerning the second issue, I can now magically disconnect and re-connect as much as I want (it seems). So, I guess that issue disappeared too? Related issue? Who knows... Thank you for the help anyway!

Great application this. :-)

/Fredrik

mdeweerd's picture

The NMEA 0 length report is

The NMEA 0 length report is 'normal' - it is not an issue so I am not spending actual effort on getting rid of this (I know why it happens) - it is a bit complex.

I can't think of a good explication why all your problems are gone, but the cause to effect is not 'impossible'.

Thanks for the feedback ;-).