BUGgps

IPositionSubscriber is the Bug Labs asychronous API that is broken in 1.4.2

The Bug Labs asynchronous GPS API that we can't get working (mentioned in the previous blog post) with Simon's identicon program is: IPositionSubscriber

I'll report this in the Bug Labs forums and then update this post.

Bug Labs Release 1.4.2 - asynchronous GPS API broken, synchronous works but requires polling

Back in August using Bug Labs Release 1.4.1, Simon Lewis and I got his Bug Labs bug identicon app that generates identicons based on GPS coordinates to work. Unfortunately that used the Bug Labs synchronous API i.e. polling which runs down the battery. The working version is 1.0.3 and you can see the output of 1.0.3 in the video above.

It's still broken in Bug Labs Release 1.4.2  Full yak shaving details after the jump!

So the next step was to try the asychronous API. It didn't work. The Concierge component framework would crash:

root@bug:~# tail -f /var/log/concierge.log
[Thu Jan 01 00:01:39 GMT 1970] [INFO] CoolApp 1.1.1: code != lastCode
[Thu Jan 01 00:01:39 GMT 1970] [INFO] IdenticonComponent: Initialized image and got sun.awt.qt.QtImage@86b11f3a
[Thu Jan 01 00:01:39 GMT 1970] [INFO] IdenticonComponent: image == sun.awt.qt.QtImage@86b11f3a
[Thu Jan 01 00:01:39 GMT 1970] [INFO] CoolApp 1.1.1: CoolApp.newIdenticon(...)
[Thu Jan 01 00:01:39 GMT 1970] [INFO] CoolApp 1.1.1: CoolApp.newIdenticon(...): Writing /usr/share/java/./storage/default/39/data/identicons/4915.17N_1234.19W.png
[Thu Jan 01 00:01:40 GMT 1970] [INFO] CoolApp 1.1.1: Got position update
[Thu Jan 01 00:01:40 GMT 1970] [INFO] CoolApp 1.1.1: Latitude[0.8596597123194212 rad] Longitude[-2.1480144386300855 rad]
[Thu Jan 01 00:01:40 GMT 1970] [INFO] CoolApp 1.1.1: Computing digest
[Thu Jan 01 00:01:40 GMT 1970] [INFO] CoolApp 1.1.1: Got digest
[Thu Jan 01 00:01:40 GMT 1970] [INFO] CoolApp 1.1.1: code == lastCode

II) every other time it didn't appear to run, it just hangs after it starts

ar]:
java.lang.LinkageError: trying to redefine class com.buglabs.bug.jni.common.CharDevice (bad class loader?)
    at java.lang.Class.addToLoaderCache(Native Method)
    at java.lang.Class.loadSuperClasses(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at ch.ethz.iks.concierge.framework.BundleClassLoader.findOwnClass(Unknown Source)
    at ch.ethz.iks.concierge.framework.BundleClassLoader.findDelegatedClass(Unknown Source)
    at ch.ethz.iks.concierge.framework.BundleClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Compiled Method)(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.loadSuperClasses(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at ch.ethz.iks.concierge.framework.BundleClassLoader.findOwnClass(Unknown Source)
    at ch.ethz.iks.concierge.framework.BundleClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Compiled Method)(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at com.buglabs.bug.input.pub.InputEventProvider.run(Unknown Source)
    at java.lang.Thread.startup(Unknown Source)
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registering info service.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet /support
STARTING file:./com.buglabs.bug.service.jar
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet /service
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet at /service.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered resources /
STARTING file:./com.buglabs.bug.program.jar
[Thu Aug 06 21:46:14 UTC 2009] [INFO] UserAppManager init: false
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet /program
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet /configuration
STARTING file:./com.buglabs.bug.module.jar
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet /module
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet at /module.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet /package
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Registered servlet at /package.
STARTING file:./com.buglabs.bug.bmi.jar
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.gps (0001) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.camera (0005) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.lcd (0003) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.motion (0002) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.vonhippel (0007) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.audio (000A) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.wifi (0008) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Added modlet factory com.buglabs.bug.module.bugbee (0009) to map.
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Creating pipe /tmp/eventpipe
[Thu Aug 06 21:46:14 UTC 2009] [INFO] Execution Completed.  Response:
[Thu Aug 06 21:46:15 UTC 2009] [INFO] Initializing existing modules
[Thu Aug 06 21:46:15 UTC 2009] [INFO] Registering existing module with message: 0003 0 0 ADD
[Thu Aug 06 21:46:15 UTC 2009] [INFO] Started modlet from factory com.buglabs.bug.module.lcd...
[Thu Aug 06 21:46:15 UTC 2009] [INFO] Registering existing module with message: 0001 0 1 ADD
[Thu Aug 06 21:46:15 UTC 2009] [INFO] GPSModlet setting active (external) antenna
CoolAppServiceTracker: start
[Thu Aug 06 21:46:16 UTC 2009] [INFO] CoolApp 1.1.1: CoolApp.start()
[Thu Aug 06 21:46:16 UTC 2009] [INFO] Started modlet from factory com.buglabs.bug.module.gps...
[Thu Aug 06 21:46:16 UTC 2009] [INFO] Listening to event pipe. /tmp/eventpipe
STARTING file:./com.buglabs.bug.event.jar
[Thu Aug 06 21:46:16 UTC 2009] [INFO] Registered servlet /event
[Thu Aug 06 21:46:16 UTC 2009] [INFO] Registered servlet at /event.
STARTING file:./com.buglabs.bug.slp.jar
---------------------------------------------------------
  Framework restarted in 7.075 seconds.
--------------------------------------------------------- 

So I had high hopes for the recently introduced Bug Labs Release 1.4.2. I hoped that the asynchronous API would be fixed. Based on the 1.4.2 release notes, I didn't think it was fixed and today I am blogging this to confirm it's still broken in 1.4.2 Instead of a crash with a nice traceback, I now just get signal 11 with no traceback:

Poky Linux 3.1 on BUG
root@bug:~# tail -f /var/log/concierge.log 
RESTORED BUNDLE file:./com.buglabs.bug.program.jar
RESTORED BUNDLE file:./com.buglabs.bug.module.jar
RESTORED BUNDLE file:./com.buglabs.bug.bmi.jar
RESTORED BUNDLE file:./com.buglabs.bug.event.jar
RESTORED BUNDLE file:./com.buglabs.bug.slp.jar
RESTORED BUNDLE file:/usr/share/java/apps/CoolApp.jar
STARTING file:./service-tracker.jar
STARTING file:./com.buglabs.osgi.shell.jar
Process #3983 received signal 11
Process #3983 being suspended

Bug Labs Release 1.4.1 fixes my GPS issues

I finally upgraded my Bug Labs Bug kernal and root file system to 1.4.1 (instructions on my Bug Adventures wiki under July 26, 2009) and my GPS now works! yes! Now to write some fun software!

BUG Adventures - GPS still not getting a fix, need another antenna perhaps or is GPSConfig not working?

Well it's been 2 weeks and I've been too busy to do much with my BUG Labs BUG but here's the current state of affairs:

  1. fixed my compiler in Eclipse to be R1.4 compliant by setting Preferences->Compiler->Compiler compliance level to 1.4
  2. Started my Bug and the following log is displayed in /var/log/concierge:
    1. [Sun Apr 05 21:32:13 GMT 2009] [INFO] GPSModlet defaulting to passive (external) antenna
    2. [Sun Apr 05 21:32:13 GMT 2009] [INFO] Started modlet from factory com.buglabs.bug.module.gps...
  3. I take it this means that the antenna is set to use the external antenna
  4. Wait 7 minutes and I still see the BUG with no fix
  5. Then I download the GPSConfig app as recommended by the BUG Labs folks and I see:
    1. GPSConfigServiceTracker: start
    2. status=3939
    3. [Sun Apr 05 21:40:31 GMT 2009] [INFO] AppManager started /usr/share/java/apps/GPSConfig.jar
  6. Then I tried using the joystick controller and the select button to configure the GPSConfig app to use the external antenna (and see this log:
    1. status=4003
    2. Switching to external (passive) antenna
    3. ret=0
  7. But the GPS Module display on the 2 line LCS still shows Passive which means it's NOT using the external antenna
  8. Help!
    1. Do I have a defective antenna?
    2. Am I doing something wrong with the GPSConfig app?
    3. Or is the GPS Module incorrect when it states that the antenna is Active i.e. internal antenna instead of Passive i.e. external antenna?

 

"Bug Adventures" II - Why doesn't my GPS work?

(Part 2 of my Bug Adventures series, for more real time wiki action check out my Bug Adventures wiki where I flesh out my thoughts before posting them here!)

Why doesn't my GPS aka BUGgps seem to work?
By "not working", I mean it doesn't get a GPS satellite lock which
results in a Java exception for those using the high level API and void
values e.g. "$GPGLL,,,,,022837.595,V*1D "for apps reading the RAW GPS
sentences.  My guess is it's a low level software bug that will be
fixed in the "real soon now" R1.4 software release. Note that I have
attached the external antenna and put it on the window sill where my
other GPSes (Nokia LD-4W, Nokia E71) have no problems obtaining a GPS
lock!

Herewith my debugging notes:

  1. http://bugcommunity.com/forums/viewtopic.php?t=351 seems to be the definitive source of how to fix your GPS! the fix in the thread:
    1. "navigate the front-panel menu to the GPS module
      and you will be able to see fix: True/False and IOX, which is the value
      of the IOX register:"

      1. (front panel led sequence is: modules->GPS->IOX) I get 0x63 which means
        1. bit  0: 1 == no GPS fix, since fix is active low
        2. bit 1: 1 = no overcurrent condition
        3. bit 2: 0 = no wakeup from sleep
        4. bit 3: 0 = don't know what this is, guess is 0 means don't download firmware
        5. bit 4,5 unused
        6. bit 7,6 0,1 == external antenna
  2. Other people's code I have tried
    1. GPSRawFeedExample always outputs "V*blah" which I think means void!
      1. e.g. $GPGLL,,,,,051302.397,V*10
    2. GPSLoggerSimpleGUI - the GUI doesn't work but at least the program doesn't crash :-)
    3. GPSLogger2 creates a zero length file in /tmp but does nothing else e.g. /tmp/GPSSun Jan 04 20:25:49 UTC 2009.log
    4. GpsLogger_1.1 java.lang.NullPointerException
      at com.buglabs.bug.module.gps.GPSModlet.getLatitudeLongitude(Unknown Source)
    5. My friend Simon's app has the same bug as GPS Logger 1.1 i.e. java.lang.NullPointerException
      at com.buglabs.bug.module.gps.GPSModlet.getLatitudeLongitude(Unknown Source)

      1. Simon's guess: the NMEA sentence they are getting from the underlying
        hardware isn't quite in the format they expect, so they end up trying
        to get a double out of the string  ","
      2. http://lists.buglabs.net/pipermail/bug-dev/2008-December/000167.html seems to be the same problem!
  3. Evidence that this is a Bug that's being worked on:
    1. this fix went into  svn trunk (svn://svn.buglabs.net/bug/trunk  ) on December 14, 2008, http://svn.buglabs.net/svn/!revision/7632
      // default to passive (external) antenna, until
      // such time as we have confidence in the internal            
      // antenna's ability to obtain a fix          
      log.log(LogService.LOG_DEBUG, "GPSModlet defaulting to passive (external) antenna");              
      setPassiveAntenna();       
Subscribe to RSS - BUGgps