Something stupid I know

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

Something stupid I know

Postby spiked3 » Sat Feb 11, 2012 4:45 am

First, just to give you an idea of my frustration level, I have spent over a year trying to get anything in Robotics to work. I spent months trying to copy LeJOS functionality into c# (and gave up). I spent weeks fighting linux, to then have ROS installs fail. I spent a week fighting Java PC with LeJOS to give on up a poor excuse for anything resembling a modern UI (JavaFX2 may be ok towards the end of 2014 if schedules are kept, lol). I spent a couple of days (best yet) on Mindstorms C#, before I realized, remote bluetooth just wasn't fast enough to do anything useful. So I'm back to LeJOS JVM mode.

I run
LCD.drawString("hello world", 1,1);

and the brick reboots.

I re-installed current JDK 32 bit, re-installed LeJOS, I did not re-install eclipse but it seems ok. Brick firmware update went fine. Compile and download give no error messages, and that's when the brick reboots, so something is happening.

Should I just give up? (yes, I know I should, now I understand why the local robotics club only builds arduinos that flash LEDs).

Anyone seen a instant reboot when running a LeJOS JVM program? Any solutions?
spiked3
New User
 
Posts: 18
Joined: Tue Feb 01, 2011 3:20 am
Location: east TN, US

Re: Something stupid I know

Postby skoehler » Sat Feb 11, 2012 8:52 am

If your main() method conists of the LCD.drawString and nothing else, then your program terminates before you even see the result. Add Button.waitForAnyPress() to the end of your main method. BTW: that is also covered by the tutorial. Maybe you should follow it for a start.
skoehler
leJOS Team Member
 
Posts: 1390
Joined: Thu Oct 30, 2008 4:54 pm

Re: Something stupid I know

Postby spiked3 » Sat Feb 11, 2012 3:50 pm

Fair enough. Although I will add that in 35+ year of programming, I have never seen a program (or specifically an OS) that reboots when a program is finished. I do not see that mentioned in the tutorials. Actually is does say "it will display Hello World” and then immediately return to the menu", and that is NOT what is happening. If it was, I would have known right away what was going on. Also, there is no 'waitForAnyPress' method as, suggested by your and the tutorials. Has the API changed and the tutorials not?
spiked3
New User
 
Posts: 18
Joined: Tue Feb 01, 2011 3:20 am
Location: east TN, US

Re: Something stupid I know

Postby traisen » Sat Feb 11, 2012 4:19 pm

I'm wondering what version of Lejos, Java, and Eclipse you are using.

When I have gotten stuck, I went back to the Lejos command interface. If that worked I knew Lejos was installed right.
Usually my problem was having multiple Java's installed and having the system variables not set right.

Try this first program tutorial: http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/FirstProgram.htm

Hope this helps, because I know I hate to be left hanging.
traisen
New User
 
Posts: 23
Joined: Mon Dec 15, 2008 6:53 am

Re: Something stupid I know

Postby gloomyandy » Sat Feb 11, 2012 4:53 pm

leJOS is not rebooting. The firmware is simply reloading the menu program (which is also a Java program), after running your program to completion. There is no visual difference between the menu running for the first time (after a reboot) and running after a user program completes, there may be a slight difference in time due to extra initialisation during the boot sequence.

The Button.waitForAnyPress() method exists in the latest version of leJOS and is documented here:
http://lejos.sourceforge.net/nxt/nxj/ap ... rAnyPress().
Which version of leJOS are you running?

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3892
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Something stupid I know

Postby spiked3 » Sat Feb 11, 2012 5:11 pm

I installed from leJOS_NXJ_0.9.0-Setup.exe dated 1/29/2012 (might be my download date?)

I just saw that in the current API, but it is NOT available, and indeed generates an error in Eclipse.
Button.waitForPress(); works fine.

OK, I'll admit the 'exact same sequence' through me off - if it was just the menus, that would be one thing, but the LeJOS logo and sound being the same - fooled me.

I just reformatted this computer and spent the 30+ hours installing getting it back (scribbler bot totally wiped out windows bluetooth). if Java is hosed up it will have to wait another year to get fixed.
spiked3
New User
 
Posts: 18
Joined: Tue Feb 01, 2011 3:20 am
Location: east TN, US

Re: Something stupid I know

Postby gloomyandy » Sat Feb 11, 2012 5:29 pm

0.9.1 is the current release (released 9/feb/2012). The API docs and Tutorial will refer to this version. The Button API was revised in 0.9.1...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3892
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Something stupid I know

Postby spiked3 » Sat Feb 11, 2012 6:20 pm

Got it. And Button.waitForAnyPress(); was there. Thanks. BTW, the 'Looking for the latest version?' on sf still point to the older version.

Also, FYI: console viewer has a screenshot of the logger, not console viewer (http://lejos.sourceforge.net/nxt/nxj/tu ... ols.htm#10)
spiked3
New User
 
Posts: 18
Joined: Tue Feb 01, 2011 3:20 am
Location: east TN, US

Re: Something stupid I know

Postby skoehler » Sat Feb 11, 2012 11:50 pm

spiked3 wrote: I do not see that mentioned in the tutorials. Actually is does say "it will display Hello World” and then immediately return to the menu", and that is NOT what is happening. If it was, I would have known right away what was going on.


A quote from http://lejos.sourceforge.net/nxt/nxj/tu ... rogram.htm
If you run this program as it is, it will display Hello World” and then immediately return to the menu, so you will not be able to see what is displayed (unless you are very quick).


Also note, that the HelloWorld program on that page contains a Button.waitForAnyPress().
Sorry, if displaying the menu after a program has terminated seemed far fetched to you.
skoehler
leJOS Team Member
 
Posts: 1390
Joined: Thu Oct 30, 2008 4:54 pm

Re: Something stupid I know

Postby skoehler » Sun Feb 12, 2012 12:06 am

spiked3 wrote:BTW, the 'Looking for the latest version?' on sf still point to the older version.


Because the guy who did the release (me) didn't have a clue that feature existed. It's fixed now.
However, the release of 0.9.1 has been announced in several places.

spiked3 wrote:Also, FYI: console viewer has a screenshot of the logger, not console viewer (http://lejos.sourceforge.net/nxt/nxj/tu ... ols.htm#10)

Fixed.
skoehler
leJOS Team Member
 
Posts: 1390
Joined: Thu Oct 30, 2008 4:54 pm

Re: Something stupid I know

Postby spiked3 » Sun Feb 12, 2012 12:39 am

skoehler wrote:
spiked3 wrote: I do not see that mentioned in the tutorials. Actually is does say "it will display Hello World” and then immediately return to the menu", and that is NOT what is happening. If it was, I would have known right away what was going on.


A quote from http://lejos.sourceforge.net/nxt/nxj/tu ... rogram.htm
If you run this program as it is, it will display Hello World” and then immediately return to the menu, so you will not be able to see what is displayed (unless you are very quick).


Also note, that the HelloWorld program on that page contains a Button.waitForAnyPress().
Sorry, if displaying the menu after a program has terminated seemed far fetched to you.


Our definition of immediately must be different. And yes, what you have now seems very far fetched to me and leads to these misunderstanding. But thanks to all for the help. There is definitely an a bit of frustration in my first post, after spending a couple days building a C# WPF GUI and trying remote access and watching gears grind because the motors can not even limit themselves to only turning a certain amount (and having the MotorControl program that was suppose to fix that also fail). Bottom line, failure after failure after failure after failure after failure. Then I go yet another direction, click on get 'latest version', and its not. Sigh.
spiked3
New User
 
Posts: 18
Joined: Tue Feb 01, 2011 3:20 am
Location: east TN, US


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 1 guest

more stuff