leJOS and Lego Mindstorms EV3

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

Moderators: roger, gloomyandy, skoehler

Re: leJOS and Lego Mindstorms EV3

Postby jwebber23 » Tue Oct 08, 2013 4:39 am

Yes it shows a LMS2012 and the VBOXADDITIONS_4.2.18_88780 so that would explain why it creates a LMS20121 partition.... I used sudo rm -rf LMS2012 to remove the phantom LMS2012 drive without the USB reader plugged in and then tried again and it worked....

Thanks for your help on solving this.

I have used PuTTY in windows to connect to it via USB and ran the EV3HelloWorld so very happy with that :D

Still working on my WiFi setup, i have WPA2-PSK security so working through the correct setup for that.
jwebber23
New User
 
Posts: 8
Joined: Sat Oct 05, 2013 9:26 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Tue Oct 08, 2013 11:52 am

If you can't get things working you may want to try using TKIP rather than AES (you will need to change your WiFi router settings to get this) as a few people have reported issues with AES (though this may have been fixed by the new AES modules in 0.4.0, it is on my list to test).

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

Re: leJOS and Lego Mindstorms EV3

Postby hwkramer » Wed Oct 09, 2013 10:22 am

Dear leJOS/EV3 developpers,

I am to prepare a leJOS robotics workshop for early next year.
Topics will be based on the stuff described in Bagnalls leJOS/NXT books.

As I have to buy some hardware, I have to decide whether to buy new EV3 kits or "old" NXT educational kits.

Question: Will "leJOS and Lego Mindstorms EV3" be in a productive stage by then (including sensor support etc.)?

Hans
hwkramer
New User
 
Posts: 2
Joined: Thu Sep 26, 2013 9:09 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Thu Oct 10, 2013 10:29 am

Hi,
unfortunately this is a difficult question to answer as it depends mainly on how much progress the development team makes and they are doing all of this work in their own time. My opinion is that if you are talking about a course that will begin early in 2014 then leJOS will probably not be in a state good enough to support your course. I think it is just too soon for use to have good support for Windows (which I assume will be your development platform) and have a stable set of classes. Also there is a very good chance that leJOS on the EV3 will be rather different in terms of class structures and many other details to the NXT version, so it may not match the book too well. This structure is currently changing a lot, and if it was my course I don't think I would base it on the EV3...

Just my thoughts which others in the dev team may not agree with.

If your course is starting in sept 2014 then things may very well be different...

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

Re: leJOS and Lego Mindstorms EV3

Postby jerryP » Fri Oct 11, 2013 4:06 am

Andy,

I am still learning lejos but I can't for the life of me figure out why this works:

EV3IRSensor irSensor = new EV3IRSensor(SensorPort.S4);

but this does not:

EV3UltrasonicSensor sonar = new EV3UltrasonicSensor(SensorPort.S3);

it gives a gives compile error 'actual argument Port cannot be converted to UARTPort by method invocation conversion'

Before the latest changes to the ev3classes (with the new hardware package), I was able to get both the IR and Ultrasonic sensors to work. Any ideas?

Jerry
jerryP
New User
 
Posts: 18
Joined: Mon Aug 19, 2013 12:32 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Fri Oct 11, 2013 9:08 am

Hi,
Did you have read the note I added to the 0.4.0-alpha thread:
viewtopic.php?f=18&t=4671

Anyway the Ultrasonic driver has not been updated to match the new way of doing things because I knew that another dev was working on that. You have 4 choices:
1. Pickup up the tagged sources for 0.4.0-alpha
2. Wait for us to finish the changes and release 0.5.0
3. Add the following code to your version of the EV3Ultrasonic driver:
Code: Select all
    /**
     * Create the sensor class. The sensor will be set to return measurements in CM.
     * @param port
     */
    public EV3UltrasonicSensor(Port port)
    {
        super(port);
    }


4. Change your code to read:
Code: Select all
EV3UltrasonicSensor sonar = new EV3UltrasonicSensor(SensorPort.S3.open(UARTPort.class));


Note: that if you continue to use the git master you may well run into other problems. Some of which may not be easy to resolve.


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

Re: leJOS and Lego Mindstorms EV3

Postby jerryP » Fri Oct 11, 2013 5:05 pm

Thanks Andy,

Sorry I didn't notice the warning about the master's risks. I guess I got too excited about trying new things :-)
I'll experiment with your suggestions in any case. It's a good learning experience. Thanks for the excellent work
you and your team are doing; it is very impressive!

Jerry
jerryP
New User
 
Posts: 18
Joined: Mon Aug 19, 2013 12:32 am

Re: leJOS and Lego Mindstorms EV3

Postby csu98135 » Mon Dec 16, 2013 4:21 am

How do your Java classes interface with the kernel modules, via JNA? Can you point me to the section of your source code which is responsible for kernel module integration?

Also, apart from the above native integration, are there any other moving parts, or does it boil down to a standard Java program running on the stock embedded JVM provided by Oracle which in turn runs on a stock Linux kernel?
csu98135
New User
 
Posts: 4
Joined: Mon Dec 16, 2013 4:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Mon Dec 16, 2013 7:52 am

Hi,
I can provide the information you ate looking for, but I can probably give better answers is you tell us why you want to know/what it is you want to do...

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

Re: leJOS and Lego Mindstorms EV3

Postby csu98135 » Tue Dec 17, 2013 8:43 am

Hi Andy,

What I asked was mostly out of curiosity, to be honest. This time around, I'm getting a much better chance to see what's happening behind-the-scenes, given how raw things still are for the EV3. And as a professional Java developer, I'm very interested in how the Java code I write translates into executable code for the EV3 brick. I'm guessing Oracle has helped greatly by providing Java SE Embedded (which I'm assuming provides any required byte-code interpretation and JIT capabilities etc.), so then the biggest question is how the Java SDK you provide (ev3classes.jar) interfaces with the EV3 hardware. I just wanted to see what that piece of interfacing code looked like and how it worked.

I'm guessing you've also made some Linux kernel enhancements so that the system boots into the leJOS interface, but that kind of low-level stuff isn't really my domain, so I won't bother you with that :-)
csu98135
New User
 
Posts: 4
Joined: Mon Dec 16, 2013 4:08 am

Re: leJOS and Lego Mindstorms EV3

Postby csu98135 » Tue Dec 17, 2013 9:52 am

In fact, I dug into the code a bit, and your NativeDevice/NativeFile classes seem to be the primary entry points into the hardware. Would it be accurate to say that you interact with the hardware essentially by performing I/O against a set of special file descriptors (e.g. /dev/lms_sound)? E.g. move a motor by writing the byte-array representation of the move command to a specific file, and read a sensor value by reading a byte/set of bytes from a specific memory-mapped portion of a specific file? And the kernel modules provided by Lego take care of the rest (e.g. pick up the command written to a file descriptor and execute it on the brick)?
csu98135
New User
 
Posts: 4
Joined: Mon Dec 16, 2013 4:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Tue Dec 17, 2013 2:45 pm

Hi,
yes that is essentially how it works. However the file operations are a rather odd mixture of read/write plus ioctl and shared memory (and Java is not very good at the last two). Also as we evolve leJOS on the EV3 we are moving away from using the Lego kernel modules "as is", towards ones designed for use with leJOS. So for instance I'm currently working on moving the time critical parts of the motor controller into a kernel module.

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

Re: leJOS and Lego Mindstorms EV3

Postby csu98135 » Wed Dec 18, 2013 4:20 am

Thanks for the info. How high on your priority stack is IDE connectivity over Bluetooth? Right now, the massive Wifi dongle sticking out from the side of the brick gets in the way of a lot of builds. Even I could take a shot at it if you haven't started on it yet, though given my background as an enterprise server-side developer, I can't promise any results.
csu98135
New User
 
Posts: 4
Joined: Mon Dec 16, 2013 4:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Wed Dec 18, 2013 8:03 am

There are solutions already with the existing sdcard image (and better ones with the one we will releasing soon). You can use Bluetooth PAN to simply run TCP/IP over Bluetooth (and then use ssh, nfs etc.), or you can simply use a micro ethernet dongle (we support a number of them). The new sdcard image has a full leJOS menu system that supports program download and execute. The major item we are missing at the moment is a plugin for eclipse, but you can already use ant to script a compile/download/run setup.

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

Re: leJOS and Lego Mindstorms EV3

Postby roamingbot » Fri Dec 20, 2013 3:51 pm

Andy
Got almost everything working and can run a program using eclipse and from a telnet session. I am running win 8.1 pro from an Acer Iconia tablet PC using an Edimax micro dongle.
The only thing I cannot get to work is the USB interface which is supposed to be simpler to get working than the WiFi interface. When I plug in a USB cable the EV3 starts up and shiws the LeJos logo. On the PC side it only exposes the same HID device as the standard Lego firmware shows.
Diving a bit deeper I thought that the etc/network/interfaces file on the sdcard should contain an entry with iface usb0 inet dhcp. But I cannot find this entry. The problem could also be with Win 8.1 but it is supposed to have the rndis drivers already. Can you give me any hint where to look further?
I also tried with a machine running XP with the same result. Any ideas?
Regards
Peter van Lith
RoboCopJunior Netherlands
roamingbot
New User
 
Posts: 2
Joined: Thu Dec 19, 2013 7:10 pm

PreviousNext

Return to EV3 Software

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

more stuff