Writing programs for the EV3

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

Moderators: roger, gloomyandy, skoehler

Writing programs for the EV3

Postby gloomyandy » Fri Aug 23, 2013 12:16 am

Folks, if any of you have an EV3 and would like to try out a very early version of leJOS for it, I've just created some instructions:
https://sourceforge.net/p/lejos/wiki/Home/

Please note that things are pretty complicated at the moment and you really need to be happy using Linux to use this stuff. Please let me know if there are problems with the instructions or if you run into issues. Also note that things will probably be changing pretty fast and that for now if you update your repository you will need to rebuild the SD card to match.

Please use this thread to report problems, make comments etc.

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

Re: Writing programs for the EV3

Postby lmcdaniel » Thu Sep 12, 2013 4:47 am

Hi Andy, not sure if this is the right place to post this, but I have a question about using the EV3 with Eclipse. I was following your guide at this link: http://sourceforge.net/p/lejos/wiki/Dev ... h%20leJOS/

I got to the section about "Download the current leJOS source code" and I seem to be stuck on step 4. I enter the repository's read only link, and when I click next I get the error "Couldn't create temporary repository." I'm not sure if the settings are correct, or if there is a special step I need to take to create the repository, is there any way you can lend some guidance here. I do not know much about using Git, but I'm willing to follow instructions to set something up. I saw the two links at the beginning of that section to learn more about Git, but I am kind of lost as to what to look for to get it working with Eclipse.

Thanks.
lmcdaniel
New User
 
Posts: 8
Joined: Sun Sep 08, 2013 10:37 pm

Re: Writing programs for the EV3

Postby butcher » Thu Sep 12, 2013 7:44 pm

lmcdaniel wrote:I got to the section about "Download the current leJOS source code" and I seem to be stuck on step 4.


Hi lmcdaniel!

I had the same problem, you can download the ev3classes project manually: http://sourceforge.net/p/lejos/ev3/ci/master/tree/
Last edited by butcher on Thu Sep 12, 2013 8:13 pm, edited 1 time in total.
butcher
New User
 
Posts: 1
Joined: Thu Sep 12, 2013 7:35 pm

Re: Writing programs for the EV3

Postby gloomyandy » Thu Sep 12, 2013 8:12 pm

What system are you installing this on? What directory was the repository set to be installed?

I created the instructions by starting with a clean system and following each step one at a time, so they certainly can work. But it is a lot of work to setup a system back to that basic stage, so please try and provide as much information about the problems you are seeing as possible.

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

Re: Writing programs for the EV3

Postby steveiswicked » Sat Sep 14, 2013 5:23 pm

Hello Andy, Many thanks for all the work on Lejos for EV3, I just installed Ubuntu on a 5 year old Laptop and it runs like it was new. My Linux is shakey but I followed all the instructions to the letter and have been able to compile and run HelloWorld and the Poweroff samples. (The PowerOff sample runs ok but it doesnt actually power off my brick, it just sits there saying closing down.) I'm looking forward to trying the other stuff. Once again, many thanks :D
steveiswicked
New User
 
Posts: 19
Joined: Sun Feb 06, 2011 11:22 pm

Re: Writing programs for the EV3

Postby gloomyandy » Sat Sep 14, 2013 6:21 pm

The thing with powering off the EV3 is that it is a two stage process. Stage one which is what the power off program does is to set a flag in one of the Lego kernel modules. Step two is to unload that module, when you do this the module turns of the power. The unloading of the modules is normally the last thing the EV3 does as part of the Linux shutdown (when you are using the leJOS SD card). So the power off program is not really a sample. it is a vital part of the leJOS SD card. To shutdown your EV3 simply use the Linux halt command, the system will close down and power off...

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

Re: Writing programs for the EV3

Postby lmcdaniel » Fri Sep 20, 2013 2:38 pm

gloomyandy wrote:What system are you installing this on?


Hi Andy,

I am using Windows 7 Home Premium 64 bit. I have heard some people say that it won't work on Windows at all. If I'm not really looking to dual-boot into Linux, would you think a Virtual Box would do the trick?
lmcdaniel
New User
 
Posts: 8
Joined: Sun Sep 08, 2013 10:37 pm

Re: Writing programs for the EV3

Postby gloomyandy » Fri Sep 20, 2013 3:10 pm

Yep that's exactly the setup I have Windows 7 with Virtual Box running a Linux guest... Can be a little tricky at times, but it seems to work pretty well...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3629
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Writing programs for the EV3

Postby lmcdaniel » Fri Sep 20, 2013 3:42 pm

Okay, I'll try that out. In the mean time, I have been messing with it using Eclipse on Windows, and the only issue I have is that it won't export the .jar fie. Have you had any issues like that before? The error message when it fails to export is this:

"JAR creation failed. See details for additional information. Class files on classpath not found or not accessible for: 'EV3FirstProgram/src/EV3FirstProgram.java'"

Also, when the instructions said " In the "Package Explorer" tab right click on "EV3FirstProgram" and choose "Export..."" Does that mean I right click the folder containing the code, or the actual EV3FirstProgram.java file itself?
lmcdaniel
New User
 
Posts: 8
Joined: Sun Sep 08, 2013 10:37 pm

Re: Writing programs for the EV3

Postby gloomyandy » Fri Sep 20, 2013 3:54 pm

When creating a jar you right click on the project entry (you are exporting the contents of the project) not the individual files.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3629
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Writing programs for the EV3

Postby lmcdaniel » Fri Sep 20, 2013 4:13 pm

I uploaded some screen shots I took to see if I am making any mistakes here that would cause the jar file to fail to be exported.

Link: http://i.imgur.com/ZwnJy7d.jpg
1. Export
2. Select JAR file
3. Select EV3FirstProgram
4. Error

Do you see anything wrong with the settings?
lmcdaniel
New User
 
Posts: 8
Joined: Sun Sep 08, 2013 10:37 pm

Re: Writing programs for the EV3

Postby gloomyandy » Fri Sep 20, 2013 4:17 pm

uncheck the classpath and project items. Also does your code actually compile? It looks like there may be errors in it. You need to get rid of any red error marks before you export the program.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3629
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Writing programs for the EV3

Postby lmcdaniel » Fri Sep 20, 2013 4:37 pm

gloomyandy wrote:Also does your code actually compile? It looks like there may be errors in it. You need to get rid of any red error marks before you export the program.


I see no visible errors when writing the program, but when I try to run it I get this error: http://i.imgur.com/yxSzKOE.jpg
lmcdaniel
New User
 
Posts: 8
Joined: Sun Sep 08, 2013 10:37 pm

Re: Writing programs for the EV3

Postby gloomyandy » Fri Sep 20, 2013 4:57 pm

Well the program won't run on your PC anyway, but I wouldn't expect that error. What about your jar file have you been able to create it yet? Do you have any *.class files in your project bin directory?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3629
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Writing programs for the EV3

Postby lmcdaniel » Fri Sep 20, 2013 5:00 pm

gloomyandy wrote: Do you have any *.class files in your project bin directory?
No I do not. The only thing I have in there is the EV3FirstProgram.jar even though it kept telling me it failed to export...
lmcdaniel
New User
 
Posts: 8
Joined: Sun Sep 08, 2013 10:37 pm

Next

Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff