Can leJOS run on ev3dev?

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

Moderators: roger, gloomyandy, skoehler

fgfanta
New User
Posts: 10
Joined: Sun Nov 30, 2014 12:18 am

Can leJOS run on ev3dev?

Postby fgfanta » Sun Nov 30, 2014 12:24 am

I have seen several references to ev3dev in this group. Is it possible to use leJOS with the EV3 brick running ev3dev?

skoehler
leJOS Team Member
Posts: 1550
Joined: Thu Oct 30, 2008 4:54 pm

Re: Can leJOS run on ev3dev?

Postby skoehler » Sun Nov 30, 2014 12:28 am

fgfanta wrote:I have seen several references to ev3dev in this group. Is it possible to use leJOS with the EV3 brick running ev3dev?

At the moment it is not. leJOS uses different drivers for the hardware inside the EV3 like sensor ports and motor ports. Like the ev3dev drivers, the leJOS drivers are derived from Lego's source code. However, the leJOS drivers have been enhanced and extended independently from the ev3dev drivers. Currently, it seems like the leJOS drivers support features that the ev3dev do not support.

However, if you write Java classe implementing the basic leJOS interfaces (like I2CPort, UARTPort, etc.) it might be possible to make some things work on ev3dev.

fgfanta
New User
Posts: 10
Joined: Sun Nov 30, 2014 12:18 am

Re: Can leJOS run on ev3dev?

Postby fgfanta » Sun Nov 30, 2014 9:39 am

I see. Thanks.
So, does leJOS provide its own drivers but keep the rest of the Linux operating system provided by Lego?

skoehler
leJOS Team Member
Posts: 1550
Joined: Thu Oct 30, 2008 4:54 pm

Re: Can leJOS run on ev3dev?

Postby skoehler » Sun Nov 30, 2014 2:12 pm

fgfanta wrote:So, does leJOS provide its own drivers but keep the rest of the Linux operating system provided by Lego?

Yes, that is the current status.

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Sun Nov 30, 2014 3:22 pm

Actually the answer is sort of. We use an enhanced version of the same kernel used by Lego, we add a number of additional drivers and have also added various bug fixes to fix various problems that exist in the base kernel. The file system also has a number of extra utilities and packages added to it (mainly network related). All of the Lego supplied kernel modules have been substantially modified.

PheniX
Novice
Posts: 47
Joined: Sun Feb 11, 2007 11:30 am
Location: Rome

Re: Can leJOS run on ev3dev?

Postby PheniX » Thu Mar 19, 2015 12:33 pm

Hi, (I really hope I am not touching a sensitive topic ...)

Has the Lejos developers team considered the idea to join forces with the ev3dev project?
42

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Thu Mar 19, 2015 5:37 pm

Yes we have considered it several times, and perhaps if we were starting to develop leJOS today we might choose to go that route and at some point we may port leJOS to run on (probably a forked version of) ev3dev, but we currently have no firm plans to do so.

The two projects are not totally incompatible, so in theory it would be possible to host leJOS on ev3dev. But to do so would require a considerable amount of work to essentially get leJOS back to the state it is in today but running on ev3dev. In addition basing leJOS on a fast moving project like ev3dev would require the leJOS developers to track and test the updates and changes being made in ev3dev (hence why any port would more than likely be to a fork in ev3dev ). At this stage I don't think the gains that would be obtained are worth this additional pain.

The projects have different aims. As a result the low level interfaces used by leJOS and ev3dev are different. The ev3dev project aims to do things in the Linux way and is aimed mainly at people that are familiar with Linux, hence each sensor/motor/device has a Linux driver of some sort that is typically accessed via the sysfs file system. In leJOS we try to do as much as we possibly can in Java, including low level device I/O, doing things this way means that a larger number of leJOS developers (who are familiar with Java but not with Linux kernel device drivers), can work on those low level components. leJOS treats the OS and Linux system Libraries very much as an embedded platform to run leJOS Java programs rather than as a general purpose Linux system.

PheniX
Novice
Posts: 47
Joined: Sun Feb 11, 2007 11:30 am
Location: Rome

Re: Can leJOS run on ev3dev?

Postby PheniX » Thu Mar 19, 2015 6:25 pm

Thanks a lot for the very interesting answer!!!
I'll keep an eye on both projects (I'm both a Linux and a LeJOS user) and continue using LeJOS
42

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Sat Oct 24, 2015 5:15 pm

Hi, Andy, some moments ago, we were talking about this matter in the Facebook group:
https://www.facebook.com/groups/1719619 ... p_activity

I think that if we learn the integration points with busybox, more developers could help in the process to move LeJOS to a full-featured OS.
I am agree that this process is heavy for the team, in time terms, but it is necessary.

I suppose that if LeJOS approach is different that the approach used for other languages included in EV3Dev, we could use Java approach, but this fact is not compatible to migrate, I think.

Using technical documentation:
http://www.ev3dev.org/docs/ports/legoev3-input-port/
http://www.ev3dev.org/docs/ports/legoev3-output-port/

we could use them to integrate with leJOS base classes.

If we create a Github project describing the issues to do, I think that more active developers could join to execute the tasks.

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Sat Oct 24, 2015 7:21 pm

I'm not sure what busybox has to do with any of this, can you explain?

Anyway this is my view on all of this, note is is my view others may have a different opinion...

If you read my post above you will see some of the issues. The main aim of ev3dev is to expose as many of the features of Linux as possible on the EV3. The main aim of leJOS is to make it as easy as possible to run Java on the EV3. These two aims may not sit well together. If you read these forums you will see that many users struggle just getting basic things running with leJOS, I'm not sure that exposing an even more complex environment will make this any easier.

So we could port leJOS to run on top of the standard ev3dev, but what do we do about the parts of leJOS that duplicates ev3dev functions, in particular the leJOS menu system? This provides more than just the UI. It also supports the remote API and provides the mechanism for downloading code, running it etc. Some users may be happy using ssh to login and run things but I suspect many will not. So we would need to refactor things considerably to do this.

Then we have the issues of development, at the moment to add support for a new device, or to try adding a new feature you basically need to understand Java, with ev3dev you pretty much need to be a Linux hacker (all of the device drivers are built into the kernel). We simply don't have many Linux hackers working on leJOS. Yes we can take advantage of the great work that the ev3dev folks do, but what if they are not interested in that hardware? Basically you will be tying the two projects very closely together, and requiring updates to both to keep them in sync.

Next there is the issue of how the two projects support various types of hardware. There are some pretty fundamental differences that make it far from simple to simply adjust the leJOS base classes. Basically in ev3dev every device is exposed via sysfs. This is great in terms of making it simple to expose the devices to lots of languages, but it has issues. In particular how do you handle synchronization and other issues when setting multiple values basically requires multiple writes to the file system? The low level algorithms used for things like motor control are also different, I have no idea which works best as I've never tried to compare them, but I suspect that trying to get things like Aswin's Chassis code working using the ev3dev interface will not be easy.

Finally there is the issue of who would do all of this work and who would really benefit? I've spoken to most of the active leJOS developers and there is not a huge enthusiasm for moving to an ev3dev based version. Part of the problem is that just to get back to something like our current system would require a lot of work, but would not really show a lot of progress. From a personal point of view, I'm rather tired of doing system level stuff. I have a number of real robot projects that I would rather get on with.

So to sum things up. I'm sure it would be possible to do a port of leJOS to ev3dev. But what exactly would be the benefit? Without more work on the ev3dev drivers I'm pretty sure we would lose some functionality. Without in effect forking ev3dev I think we would make things much more complex for our users and only a few of them (that are Linux savvy) would be able to take advantage of that complexity. So basically I remain to be convinced that such a port is really worth the effort. Yes I'd like a nice new kernel, but what would it give me. What extra capabilities would we get? From my point of view if I need to add extra packages I can do it, I know how to download them and if needed cross compile them. Yes it is a pain, but not that much of a pain. At the moment I'd rather spend my time doing higher level stuff, like using webcams as a sensor, or getting one of the many gyro/compass/accelerometers to actually work as an IMU.

So that's my view on this at the moment. Sorry if it sounds a little negative, but I think I have a pretty good idea about how much work a port would be and a reasonable understanding of the issues involved. Other devs may have a different point of view and be more willing to take on the task, I will let them speak for themselves. If I ever did want to update things I'd be tempted just to update the kernel, rootfs and our drivers, rather than doing an ev3dev port. I like our current approach rather than the more general one used by ev3dev. I'd also rather avoid making the two projects have big dependencies, I've spent too much time worrying about that sort of stuff without wanting to go there on a project I do for fun. I'm sure I would fork some parts of ev3dev (like the base kernel), and adopt some of the things they have (it's a great project and no doubt many things are better than what we have at the moment). I've no idea how the other devs or ev3dev folks would feel about this though!

So convince me that I'm wrong. If there are lots of people out there that want to take on this work then step up (and while you are at it, help out a bit with our existing users on this forum). Tell me what features I would gain by doing all of this extra work. Convince me that it will be more fun than building some actual robots! Show me how much better the ev3dev motor control system is than the one we have with leJOS, do the comparison, run the tests. Show me that the latest WiFi drivers are X times faster, that the newer Bluetooth code provides better EV3 to EV3 performance. Seriously I would love to see people doing those sorts of tests and establishing good reasons for us to update.
leJOS news https://lejosnews.wordpress.com/

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Sun Oct 25, 2015 10:11 am

Oh and by all means let's talk about things that are missing, things that you think will be easier with a full blown Linux. Things that you would like to do. It may be that you can do them with the existing leJOS, or that they need a bit more work. It is not hard to add extra packages (from Debian Squeeze) to the existing system. Yes Squeeze is a bit on the old side, but really things have not changed that much over the last few years (especially with the hardware of the EV3). I'd like to understand what it is that folks think we are missing (and why that is important) and how having something like ev3dev would help.

If you think supporting things like PiStorms would be good, tell us why. What is it that you want to do, why that hardware is good for that. I'd also love to hear from anyone that is using this hardware and how well it has been working for you. My experience with previous stuff like this has not been good, yes it worked, but things like the motor control was not great (and it was hard to make it better). Give us good reasons for wanting to spend time supporting this sort of hardware (other than it is new). So for instance it has a touch screen, but why is this a good thing? Personally I only use the buttons on the EV3 to turn it on (and sometimes as an emergency stop), virtually all my robots are controlled either via shell or have a PC based program that lets me interact with the software running on the robot, I don't make much use of the screen or the buttons. Often you can't even see the screen due to how the robot is constructed. What would you use it for?
leJOS news https://lejosnews.wordpress.com/

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Mon Oct 26, 2015 9:59 am

Good morning Andy,

I was reading with detail last comments and it is true that the project has a level of development and the number of issues in low level to adjust are several but it is not a impossible if we create a GIT branch and more users participate in the process. In my personal opinion, Why I ask this request?

** Reasons:

* Linux generation: (I think that EV3 is the Internet generation too, but this feature is covered 100%)
This hardware generation, EV3 Brick, has the possibility to not use a Firmware to interact with the hardware. LeJOS project is a project to develop software for robots using Java and in previous generations, RCX & NXT, we used only the language to develop the projecs but with EV3, we added Busybox in the architecture and we discovered that we could interact with the environment to enrich the project in the same way that we do with a real OS but Busybox is not a real Unix system and it is closed. When I say that it is closed, I say that it complex to add modules and the knowledge and effort to run a new module in the system and the knowledge on internet about advanced features for busybox is limited but in the Mindstorms community exist another project, EV3Dev, where the dev-team develop a full-featured OS, Debian, and the environment allow developing with others general programming languages (Python, Go, C++), not only with the traditional programmming language oriented for Lego mindstorms as NXC or RobotC and I think that LeJOS Community should invest time to migrate the architecture to replace Busybox to a Linux OS to avoid losing the experience to develop software with Java and Linux too.

* Innovation:
Evolving this piece of software, OS, in LeJOS architecture we could add a new innovation factor to LeJOS community. Software for robots is not only a task for the programming language. It is very nice when you explore a new fresh idea or develop some project in Java and you install your module in the OS using apt and you test the combination. If we offer a full-featured OS, we will offer an open environment to innovate but currently with Busybox users doesn't have some tool to search and install modules in internet to create complex projects. Linux is not the solution but the enrich the experience to develop interesting projects with LeJOS. If you observe the forum, many times developers asks new features and it is very complex to add due to:

    -- Modules are not available for Busybox
    -- Modules are not available for Arm5
But if we had a full-featured system, we could use the module repository from Debian for example which offers more modules than Busybox does. I think that it is the main reason why EV3Dev is popular for this Mindstorm generation.

* OS Layer with capabilities to use in multiple boards:
If you observe in EV3Dev page (https://github.com/ev3dev/ev3dev/tags) they have a solution to deploy a new release for EV3 and RPi with few effort. Currently in LeJOS, we don't have a stable solution for another board, for example BrickPI, so we have another reason to explore the possibibily to use EV3Dev.

** Pros/Cons:

Once I have explained the reasons to replace Busybox by Linux (EV3Dev has an example with Debian) in LeJOS architecture, I will analyze Pros and Cons:

Pros:

+ Add a Linux full-featured OS with a package manager to install/uninstall modules
+ Increate the number of possiblities to create LeJOS robots. When you have a problem with the system, the time to solve will decrease.
+ Add more users to community

Cons:

+ Time to adjust current development is high.
+ UI should be refactored. In this case, I think that LeJOS UI has some features for Networking better than EV3Dev UI does.

Reading some arguments about the usage of sysfs is focused for motors but for sensors, I think that we shouldn't have many problems, so for motors, we could use another approach. (Personal opinion)

** Pilot:

I think that we could do a Pilot with a board as BrickPi/PiStorm for example. I know that Lawrie has BrickPi unit but I am not sure if he has time and motivation. In my case I will receive soon a unit for PiStorm. We could develop a Pilot to try to integrate LeJOS with PiStorm. This development doesn't impact current architecture but it could offer a window to offer new possibilities. I am not sure why I have to give you arguments about some development for RaspberryPi, it is a huge success in robotics and computers so simply, it is a opportunity to develop software for robots using LeJOS. In this comment, I don't add Arduino, because many of Arduino's product are more closed to NXT than EV3. LeJOS is the sum of firmware/busybox + APIs and APIs has the focus on Sensors provided by Lego ecosystem and the APIs for Local navigation are the best so BrickPi/PiStorm fits nice because, developers could increate the CPU / Memory to develop better software and continue using Lego sensors. I think that we could increase the scope of LeJOS and I think that we could try a pilot with BrickPi/PiStorm for example. Besides, in the process we will add more documentation about details of the development.

What is your opinion?

Cheers

Juan Antonio
Last edited by esmetaman on Mon Oct 26, 2015 10:06 am, edited 2 times in total.
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Mon Oct 26, 2015 10:02 am

Andy, In relation to this observation: (and while you are at it, help out a bit with our existing users on this forum) I will try to give more support.

Cheers
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

skoehler
leJOS Team Member
Posts: 1550
Joined: Thu Oct 30, 2008 4:54 pm

Re: Can leJOS run on ev3dev?

Postby skoehler » Mon Oct 26, 2015 10:30 am

Replace BusyBox with Linux? BusyBox is an application and Linux is a kernel.

BusyBox is a compact but sometimes rather minimal replacement for various applications. It integrates a shell, dhcp client/server, and what the collection of tools that is also known as coreutils (ls, cp, ...). These tools would otherwise take up previous diskspace and RAM.

What you're asking for is probably a fully fledges userland, that is classic bash, coreutils, etc. - but why replace BusyBox?

I'm pretty sure we don't need to delete BusyBox if we should chose to provide bash, coreutils, and other fully fledged versions of all the other tools. Instead, we can use BusyBox in our scripts (and save precious RAM) and use the fully fledged environment for user shells, if they the user so wishes.

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Mon Oct 26, 2015 11:07 am

Do you mean modules or packages? All modules have to be recompiled for use with a particular kernel and can typically not be simply downloaded and used. Packages can be downloaded and used and there is nothing to stop you from doing this with the current leJOS setup, you simply need to use a Linux host to do so (and if you use ev3dev you will almost certainly need one of these as well to do anything meaningful). To see how you can add extra packages look at how we create the sdcard, you just download a package from the Debian Squeeze repo (select the armel architecture), expand it and copy the files to the EV3 it really is not that hard. We use this to things like additional Bluetooth tools, etc.

Having said that, I'm still waiting to see what packages you want to install and why, what is it that you think is actually missing? What are all of these features that people keep asking for?
leJOS news https://lejosnews.wordpress.com/


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 5 guests