BUG Community

Welcome! Log In

Forums Recent Posts

Subscribe to Recent Posts 11,751 posts found

May 8, 2008 11:32am
akravets 25 posts

Topic: BUG SDK / Programmatic Bug Shutdown?

finsprings,

The JavaDocs for all bundles that run on the BUG are generated right now, but they are kept in each bundle’s root directory. We’ll change the build so that these docs are moved to public website and are easily accessible.

May 8, 2008 10:47am
Medium kschultz 107 posts

Topic: BUG SDK / java.lang.NoClassDefFoundError on startup

Tuxinator

Is this true for when a service becomes unavailable as well but instead of calling start it would call stop? I take it services can include software and hardware services?


Correct, that is how the modules can be hot swapable, because the OSGi stuff handles the "life cycle" management. OSGI services can be hardware or software. A good example is my GPSUtilities package, it is a software service accessed the same way as a hardware module (or really I guess the hardware modules work like software services since OSGi was first for software only). Also the services are independant of the hardware, i.e. we could create a IPositionProvider based on a technology other than GPS that would be possible, or if we wanted to create a module that had a camera and a GPS, both could be offered up by one module. For right now when there are only 4 modules and a handful of software services the OSGi stuff might not seem necessary, but when we have 50 modules and there are 100 software services on BUGnet it will be worth the added complexity because it allows software to be independent of the hardware configuration.
May 8, 2008 10:41am
Medium jconnolly 285 posts

Topic: BUG SDK / Programmatic Bug Shutdown?

finsprings
Nice! I didn't realize we had exec access! I'll be sure not to try it with the VirtualBug though :-)



Dave,

The vm is running as root, so be careful with exec access. :wink:

Which brings to mind another question: is there a page with the javadoc or equivalent for the SDK now? There used to be one on bugbeta.com but it's not there anymore. I only found the OSGIi shutdown by trawling the java files in SVN.


I'm constantly badgering our development team to get the master javadoc generated with each build. I'm not really privy to all of the details of the build process, but I know that using Ant it should be a matter of adding the appropriate javadoc build commands in the build scripts. This is a great request to add to our bugzilla, at http://bugcommunity.com/bugzilla . We need the feedback so we can prioritize our next build accordingly. :)
May 8, 2008 10:27am
Tuxinator 6 posts

Topic: BUG SDK / java.lang.NoClassDefFoundError on startup

[quote="kschultz"]

Ok I know where all this is stemming from then, when you create a new project there is a list of services in the center of the screen, you have to highlight the modules you want. So there is a button to start a Virtual BUG, you plug in the modules you want your app to use, and Dragonfly will generate all the OSGi based on that. I think there are detailed instructions somewhere, I'm on a computer without Dragonfly installed so I can't give you detailed directions at the moment. This is a common mistake I make when I'm rushing I skip right over that and end up with just an activator class. The activator, manifest.mf, and the servicetracker should all be generated for you and then all you have to do is hook into your application from the doStart() method of the servicetracker.


I see your point. When I created the project I gave it a name clicked on finish instead of next. The following screen is very good in allowing you to select and generate the classes for you. Maybe in future releases disabling the finish button until you get to the last screen? If people only want to create an empty project they can just click next and then finish without starting the Virtual Bug and selecting the services.
akravets

Here are the instructions on what Kevin was talking about: http://bugcommunity.com/wiki/index.php/Create_a_basic_application_with_the_Motion_Sensor_module

Also, the reason service tacker is there is so your application can run when certain requirements exist. For example, let say in order for service A to function property service B must be present in the system. If I try to execute service A without B present then my application will not work. But if I have a service tracker that will track for presence of service B, then when service B becomes available my service A will be happy and do its thing.


Is this true for when a service becomes unavailable as well but instead of calling start it would call stop? I take it services can include software and hardware services?
May 8, 2008 10:22am
Medium finsprings 268 posts

Topic: BUG SDK / Programmatic Bug Shutdown?

Nice! I didn’t realize we had exec access! I’ll be sure not to try it with the VirtualBug though :-)

Which brings to mind another question: is there a page with the javadoc or equivalent for the SDK now? There used to be one on bugbeta.com but it’s not there anymore. I only found the OSGIi shutdown by trawling the java files in SVN.

May 8, 2008 10:21am
Medium jconnolly 285 posts

Topic: BUGbase / No Wi-Fi???

thejbsmith
Any word on this yet? I've been waiting to place my order for months but am still waiting until it has integrated WiFi.


JB,

We're working on a wifi module that is nearing the pre-manufacturing phase of completion. While it's not integrated wifi, when we have a concrete date for release, you can be sure there will be fireworks and confetti.
May 8, 2008 10:12am
Medium jconnolly 285 posts

Topic: BUG SDK / Programmatic Bug Shutdown?

finsprings
How does the Shutdown menu item work?
I wrote a quick little app that called:

getBundleContext().getBundle(0).stop()

on a KEY_UP from hotkey 4. This shuts down a VirtualBug but on the real bug it apparently just shuts down the whole OSGi/Concierge side of the world - the OS still runs. How do I make it go beyond that and truly shut down the bug?


Dave,

You'll have to execute an OS command, like shutdown or poweroff.

Runtime.getRuntime().exec("/sbin/shutdown");

You'll have to execute this command before shutting down the VM/OSGi runtime, otherwise the command may not be executed.

We're hoping to open power controls of the BUG via the API with the next release.

I should also note, if you're running on linux or OS X, before you try running this on the Virtual BUG, you'll probably want to make sure that this won't shut down your host computer accidentally.
May 8, 2008 9:21am
Medium finsprings 268 posts

Topic: BUG SDK / Requesting position before BUGlocate has a fix

Ah, I thought "bugnav" was referring to GPS, but it’s menu nav :-)
Makes sense now.

May 8, 2008 9:17am
Medium jconnolly 285 posts

Topic: BUG SDK / Requesting position before BUGlocate has a fix

finsprings
John, sorry for all the posts, but I powered the device on for a third time and it properly displays the antenna status and GPS Log (with no fixes) - previously it was just a blank window with no titles and no text.

Does Antenna On true/false refer to the internal or external antenna?

Also, in case its related, the bug's sys.log and kernel.log show quite a few entries like this:

May 8 02:53:26 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 1, Code: 258, Value: 0
May 8 02:53:26 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 0, Code: 0, Value: 0
May 8 02:53:26 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 1, Code: 258, Value: 1
May 8 02:53:26 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 0, Code: 0, Value: 0
May 8 02:53:27 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 1, Code: 258, Value: 0
May 8 02:53:27 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 0, Code: 0, Value: 0
May 8 02:53:30 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 1, Code: 258, Value: 1
May 8 02:53:30 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 0, Code: 0, Value: 0
May 8 02:53:30 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 1, Code: 258, Value: 0
May 8 02:53:30 localhost kernel: evbug.c: Event. Dev: bugnav, Type: 0, Code: 0, Value: 0

and the concierge.log shows:

Buttonevent: 1
Key: 1
Buttonevent: 0
Key: 1
Trying
Equality? false
ContositionProvrol Status:111110000011
11101000011
Equality? true
ContositionProvrol Status:11101000011
Buttonevent: 1
Key: 1
Buttonevent: 0
Key: 1
Trying
Equality? true
ContositionProvrol Status:111101000011
111110000011
Equality? false
ContositionProvrol Status:111110000011


Dave,

It's great that you're getting down to the bare metal with the GPS functionality.

It's true that the onboard antenna can take quite some time getting a location fix. At times, I've had to wait upwards of twenty minutes before getting a signal. This is very unfortunate, and I'm hoping that there is a fix for it soon, if there is a software remedy.

With regard to the kernel.log output, those events you're seeing correspond to button events generated from the joystick. You may also see output from touch events on the LCD screen, and others. I'll get the specifics of the output messages together and tailor a more informative post perhaps on the BUGmodules section of this forum.

The concierge.log output is from some System.out statements I had for debugging purposes when writing the app. I'll take a look at the source again, but this should either be thrown into the LogProvider.log mechanism, or at the very least only if a static final variable DEBUG is set to true. I just wanted to verify that the external antenna control is enabled/disabled at the hardware level, which involves bitmasking and the like, hence the output.
May 8, 2008 12:08am
Medium finsprings 268 posts

Topic: BUG SDK / Programmatic Bug Shutdown?

How does the Shutdown menu item work?
I wrote a quick little app that called:

getBundleContext().getBundle(0).stop()

on a KEY_UP from hotkey 4. This shuts down a VirtualBug but on the real bug it apparently just shuts down the whole OSGi/Concierge side of the world - the OS still runs. How do I make it go beyond that and truly shut down the bug?

Powered by Community Engine

Top
Login
Close
Bottom