RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Oct 16, 2021 10:18 am

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 37 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Linux J2534 Support
PostPosted: Tue Feb 24, 2015 2:39 am 
Offline
Newbie

Joined: Wed Mar 26, 2014 6:24 pm
Posts: 12
Here you go:

https://github.com/NikolaKozina/j2534

Requires libusb. Just run (as root)
Code:
make && make install


To apply my RomRaider patch, run this in RomRaider/ directory:

Code:
patch -p0 src/main/java/com/romraider/io/connection/ConnectionManagerFactory.java < RomRaider-j2534-linux.patch


Make sure you don't have an SD card in your Tactrix cable, since it changes the USB product ID.

Let me know if it works. I'll be in #romraider on freenode.


Top
 Profile  
 
 Post subject: Re: Installing RomRaider on Ubuntu
PostPosted: Tue Mar 03, 2015 9:04 pm 
Offline
Experienced

Joined: Wed Aug 29, 2012 1:52 pm
Posts: 110
Location: MA
Finally had a chance to try this out. I'm been banging at it for like 20 minutes and I cant get past fatal error: libusb.h: no such file or directory. Even stack overflow is no help. Whats extra odd is that I literally navigated to the file path that your install file is referencing and the f*** file is right there, everything is named correctly. I did have to install libusb-1.0-0-dev to get it this far and didnt restart, not that that should matter. Yeah, I'm stuck.


Top
 Profile  
 
 Post subject: Re: Installing RomRaider on Ubuntu
PostPosted: Thu Mar 05, 2015 3:00 am 
Offline
Newbie

Joined: Wed Mar 26, 2014 6:24 pm
Posts: 12
Leafy wrote:
Finally had a chance to try this out. I'm been banging at it for like 20 minutes and I cant get past fatal error: libusb.h: no such file or directory. Even stack overflow is no help. Whats extra odd is that I literally navigated to the file path that your install file is referencing and the f*** file is right there, everything is named correctly. I did have to install libusb-1.0-0-dev to get it this far and didnt restart, not that that should matter. Yeah, I'm stuck.


What's the output of
Code:
pkg-config --cflags --libs libusb


Top
 Profile  
 
 Post subject: Re: Installing RomRaider on Ubuntu
PostPosted: Thu Mar 05, 2015 7:12 pm 
Offline
Experienced

Joined: Wed Aug 29, 2012 1:52 pm
Posts: 110
Location: MA
impulse wrote:
Leafy wrote:
Finally had a chance to try this out. I'm been banging at it for like 20 minutes and I cant get past fatal error: libusb.h: no such file or directory. Even stack overflow is no help. Whats extra odd is that I literally navigated to the file path that your install file is referencing and the f*** file is right there, everything is named correctly. I did have to install libusb-1.0-0-dev to get it this far and didnt restart, not that that should matter. Yeah, I'm stuck.


What's the output of
Code:
pkg-config --cflags --libs libusb


Code:
-lusb


Good/bad?


Top
 Profile  
 
 Post subject: Re: Installing RomRaider on Ubuntu
PostPosted: Fri Mar 06, 2015 9:24 am 
Offline
Newbie

Joined: Wed Mar 26, 2014 6:24 pm
Posts: 12
Leafy wrote:
Code:
-lusb

Good/bad?

Bad. Mine says:
Code:
-I/usr/include/libusb-1.0 -lusb

Do you have the non-dev version of libusb installed?
Make this the second line in your makefile:
Code:
CFLAGS+='-I/usr/include/libusb-1.0 #or whatever the path is to libusb.h on your system


Top
 Profile  
 
 Post subject: Re: Installing RomRaider on Ubuntu
PostPosted: Fri Mar 06, 2015 9:40 am 
Offline
Experienced

Joined: Wed Aug 29, 2012 1:52 pm
Posts: 110
Location: MA
I made sure to install the dev version according to package manager I have both libusb-1.0-0-dev and libusb-dev installed. There was a passing mention of some problem that could be caused by having both installed for some reason on one of the post on stackoveflow for someone but their problem ended up just having only installed libusb-dev and not libusb-1.0-0-dev which put the header file in different locations.


Top
 Profile  
 
 Post subject: Re: Installing RomRaider on Ubuntu
PostPosted: Fri Mar 06, 2015 11:05 am 
Offline
Newbie

Joined: Wed Mar 26, 2014 6:24 pm
Posts: 12
Did the fix work? BTW, we probably should've started a new thread for this.


Top
 Profile  
 
 Post subject: Re: Installing RomRaider on Ubuntu
PostPosted: Fri Mar 06, 2015 11:09 am 
Offline
Experienced

Joined: Wed Aug 29, 2012 1:52 pm
Posts: 110
Location: MA
I'm at work. I'll try the fix when I get home.


Top
 Profile  
 
 Post subject: Re: Linux J2534 Support
PostPosted: Fri Mar 06, 2015 6:44 pm 
Offline
Experienced

Joined: Wed Aug 29, 2012 1:52 pm
Posts: 110
Location: MA
I believe it worked. Output of make && make install run as root was this.

Code:
gcc -g -shared j2534.o `pkg-config --cflags --libs libusb` '-I/usr/include/libusb-1.0' -o j2534.so
mkdir -p /usr/local/lib/
mkdir -p /usr/local/include/
cp j2534.h /usr/local/include/
cp j2534.pc /usr/lib/pkgconfig/
cp j2534.so /usr/local/lib//j2534.so


I'll test to see if the drivers worked with the cable in a couple hours.


Top
 Profile  
 
 Post subject: Re: Linux J2534 Support
PostPosted: Fri Mar 06, 2015 7:37 pm 
Offline
Newbie

Joined: Wed Mar 26, 2014 6:24 pm
Posts: 12
Don't forget to apply the .patch to your RomRaider tree.


Top
 Profile  
 
 Post subject: Re: Linux J2534 Support
PostPosted: Fri Mar 06, 2015 8:02 pm 
Offline
Experienced

Joined: Wed Aug 29, 2012 1:52 pm
Posts: 110
Location: MA
I'm hoping to not have to do that since I'll have to figure out how to patch the windows version. I couldnt get the linux version to install but the rest of the tuning software I use (hp tuners, aem tuner, etc) only have windows versions but their interfaces have functional linux drivers because they use standard serial to usb chips so they pass right through into my VM without me having to do any real thinking. And I hope to be able to say the same for ECU Flash since thats what really really needs to be able to talk to the tactrix cable for me on my laptop. Stuff like learning view working would also be a nice bonus.


Top
 Profile  
 
 Post subject: Re: Linux J2534 Support
PostPosted: Sat Mar 07, 2015 12:45 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 6689
Location: Canada eh!
You need to patch the Java source and recompile the Linux version so that the connection manager can locate and use your new library, otherwise the OP2 will not be recognized.

I tried this but Java is crashing when it attempts to use the new library. If I remove the library from the dir it defaults back to serial and works fine.

Various logs for your review.

I used this code as my patch.
Code:
            if (!isPlatform(WINDOWS)){
                final String j2534Lib = "/usr/local/lib/j2534.so";
                final File libFile = new File(j2534Lib);
                if (libFile.exists()) {
                    return J2534TransportFactory.getManager(
                            settings.getTransportProtocol().toUpperCase(),
                            connectionProperties,
                            j2534Lib);
                }
                else {
                    throw new RuntimeException("J2534 library not found in: " +
                            j2534Lib);
                }
            }

Crashes at line 584 'lib.PassThruOpen' of J2534Impl.java:
Code:
    public int open() {
        NativeLongByReference pDeviceID = new NativeLongByReference();
        NativeLong ret = lib.PassThruOpen(null, pDeviceID);


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: Linux J2534 Support
PostPosted: Sat Mar 07, 2015 4:56 pm 
Offline
Newbie

Joined: Wed Mar 26, 2014 6:24 pm
Posts: 12
dschultz wrote:
I tried this but Java is crashing when it attempts to use the new library. If I remove the library from the dir it defaults back to serial and works fine.

Try changing
Code:
#define LOGFILE "~/op.log"
in j2534.c to a file you can write to. I guess ~ doesn't expand in C. I had that hardcoded to my home directory and I changed it to ~ for release.


Top
 Profile  
 
 Post subject: Re: Linux J2534 Support
PostPosted: Sat Mar 07, 2015 5:17 pm 
Offline
Newbie

Joined: Wed Mar 26, 2014 6:24 pm
Posts: 12
Leafy wrote:
I'm hoping to not have to do that since I'll have to figure out how to patch the windows version. I couldnt get the linux version to install but the rest of the tuning software I use (hp tuners, aem tuner, etc) only have windows versions but their interfaces have functional linux drivers because they use standard serial to usb chips so they pass right through into my VM without me having to do any real thinking. And I hope to be able to say the same for ECU Flash since thats what really really needs to be able to talk to the tactrix cable for me on my laptop. Stuff like learning view working would also be a nice bonus.


Why can't you just install the windows tactrix drivers inside your VM and then pass USB through? That's what I've been doing with VirtualBox.


Top
 Profile  
 
 Post subject: Re: Linux J2534 Support
PostPosted: Sat Mar 07, 2015 5:32 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 6689
Location: Canada eh!
impulse wrote:
Try changing
Code:
#define LOGFILE "~/op.log"
in j2534.c to a file you can write to. I guess ~ doesn't expand in C. I had that hardcoded to my home directory and I changed it to ~ for release.

That helped a bit but it's still not working...


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl