|
RomRaider
Documentation
Community
Developers
|
| Author |
Message |
|
equinox92
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Sun Apr 28, 2019 10:14 pm |
|
 |
| Newbie |
Joined: Tue Nov 21, 2017 11:56 pm Posts: 82
|
Alright so I figured it out! I was able to download the rxtxlib for the Pi itself, rename the file to rxtxSerial.so and replace the original library. Loaded er up and BOOM! good to go! Also modified my VAG COM so that the pins were correct for the Subaru OBD port... going to give the OP2.0 drivers a try a bit later tonight. https://www.youtube.com/watch?v=ekpuAHC ... e=youtu.be
_________________ 98 Impreza RS - V8 STi EJ207 Swapped
|
|
| Top |
|
 |
|
Iceman.kcmo
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Sun Jun 16, 2019 12:11 am |
|
 |
| RomRaider Donator |
Joined: Fri Oct 07, 2016 4:36 am Posts: 77
|
|
Can someone point me toward a resource on how to compile this? I am an absolute noob when it comes to this. I have googled and looked on youtube for what I need, but am not sure I am searching for the right thing. I currently have romraider running on a RPI 3b+, and want to get it working with my tactrix 2.0 adapter. Would it be easier to set it up with a VAG-COM cable? Those are dirt cheap and I though about integrating it directly in with my wiring.
In summary, I need to learn how to compile (and what compiling is exactly) and do not know where go go to learn. Any help would be appreciated.
Thanks.
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Wed Jun 19, 2019 1:14 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
|
What car are you logging? If you only need logging support for SSM then a simple VAG-COM will work.
To compile the j2534 library, you just run 'make' in the directory where you saved the source code.
|
|
| Top |
|
 |
|
equinox92
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Wed Jun 19, 2019 5:36 pm |
|
 |
| Newbie |
Joined: Tue Nov 21, 2017 11:56 pm Posts: 82
|
Iceman.kcmo wrote: Can someone point me toward a resource on how to compile this? I am an absolute noob when it comes to this. I have googled and looked on youtube for what I need, but am not sure I am searching for the right thing. I currently have romraider running on a RPI 3b+, and want to get it working with my tactrix 2.0 adapter. Would it be easier to set it up with a VAG-COM cable? Those are dirt cheap and I though about integrating it directly in with my wiring.
In summary, I need to learn how to compile (and what compiling is exactly) and do not know where go go to learn. Any help would be appreciated.
Thanks. I can maybe help you out since I was (am) a Linux noob.. but it's amazing how quickly you can pick things up when you don't know anything! This is what I did, as posted a bit back in the thread: Quote: What I have done: -Downloaded dshultz's master j2534 folder -installed libusb-dev stuff -installed jna -Compiled j2534, no errors/warnings -moved the compiled j2534.so to the /usr/local/lib (should maybe modify the folder path so it is already in the spot but meh)
Stuck at the same point where I am getting the same error in RomRaider as above:
31379 INFO [Thread-2] - J2534 initialization: Could not initialize class com.sun.jna.NativeLong More info on your questions: Compiling is taking the "written in human language" code, and translating it into something the computer (RPi in this case) can read in it's language. The reason the code needs to be compiled is because each computer has a different language it speaks, even though the code is written in a common language. The code in the j2534 driver also has some reliance on outside code, called libraries. It uses "generic" code imported in, so in order to compile the j2534 code you must also have the other code it's calling upon to use. That is why I had to download lib-usb stuff, and jna stuff. You will need to do the same. To download these, google "apt-get install" and that should get you started on the right track to learn about that. In the j2534 folder there is a "makefile". This is the file that essentially tells the compiler (a program) how to work to turn the code into code the computer can run. Not always entirely true.. but close enough for a quick explanation. In linux you can just run files like a program, this is the file you must "run". Also, to run these files, you must have a terminal (the black hacker-text lookin' box thing) open in that folder to be able to run commands. If you aren't in that folder, you can run them by including a full filepath... but don't be super worried about that just yet. It's easier just to be inside the folder you want to work in for now. There's a lot of resources on youtube and the internet on how to do some of this, so hopefully this gives you a breif overview. It's SUPER daunting at first glace and often times just finding the right keyword to google unlocks all the answers. Hopefully some of the words I've said are keywords you needed. If you can get the j2534 stuff compiled and maybe only slightly working, I am willing to help debug it a little. I think we all left off with there being some Native Java error. Might be because (for the RPi at least) an ARM version of JNA is needed... I could be off in the weeds though. I should also have updated my last post saying I couldn't get the J2534 drivers to work on my setup (which is now in car and working beautifully with a vagcom). Would LOVE to be able to get them to work.. or maybe even use some RPi GPIO/serial to do J2534 flashing or something. Outside the scope of this thread I guess... Baby steps.
_________________ 98 Impreza RS - V8 STi EJ207 Swapped
|
|
| Top |
|
 |
|
Iceman.kcmo
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Thu Jun 20, 2019 3:25 am |
|
 |
| RomRaider Donator |
Joined: Fri Oct 07, 2016 4:36 am Posts: 77
|
|
Sweet! That exactly what I needed. I went ahead an ordered a vagcom cable since they are super cheap anyways. I like the idea of using the RPI to take over the flashing, and is where I would like to head when I get a little more experience. I am also currently learning Arduino. Between the two, there is probably some way to eliminate the tactrix and vagcom altogether.
Thanks for the update. I am keeping a small log of what I am doing and will post it up once I get things going. I am waiting on a 7" screen to come in and will start tinkering in the car. I also need to CAD and 3d print a housing on the dash to mount the screen and RPI inside of. I am trying to get all this finished up before the fall semester starts up.
|
|
| Top |
|
 |
|
equinox92
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Thu Jun 20, 2019 2:14 pm |
|
 |
| Newbie |
Joined: Tue Nov 21, 2017 11:56 pm Posts: 82
|
Iceman.kcmo wrote: Sweet! That exactly what I needed. I went ahead an ordered a vagcom cable since they are super cheap anyways. I like the idea of using the RPI to take over the flashing, and is where I would like to head when I get a little more experience. I am also currently learning Arduino. Between the two, there is probably some way to eliminate the tactrix and vagcom altogether.
Thanks for the update. I am keeping a small log of what I am doing and will post it up once I get things going. I am waiting on a 7" screen to come in and will start tinkering in the car. I also need to CAD and 3d print a housing on the dash to mount the screen and RPI inside of. I am trying to get all this finished up before the fall semester starts up. Again, not so much in the scope of this thread, but: https://www.rs25.com/forums/f145/3617589-post2460.html That's what I came up with. Also made and printed a faceplate too, but is not pictured
_________________ 98 Impreza RS - V8 STi EJ207 Swapped
|
|
| Top |
|
 |
|
Justin 05 STi
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Fri Aug 16, 2019 2:10 am |
|
 |
| Experienced |
 |
Joined: Thu Mar 02, 2006 2:51 am Posts: 345
|
Very nice work guys, I am glad to see this thread continuing to get bumped. I must report that I gave up, deciding if I wanted digital gauges I'll just use my AccessPORT. I ended up installing a JVC touch screen headunit in the STi and putting RetroPie on the Raspberry Pi to play old video games with my daughter. So while I was a little sad to admit defeat, there was a happy ending. The linux keywords I would read about are configure, make, and install. If you are given a makefile in theory there should be no need to create one using configure. Iceman are you in the Kansas City area? I live in Raymore.
_________________ - Justin download my ROM
|
|
| Top |
|
 |
|
Iceman.kcmo
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Fri Jan 17, 2020 11:06 pm |
|
 |
| RomRaider Donator |
Joined: Fri Oct 07, 2016 4:36 am Posts: 77
|
Justin 05 STi wrote: Very nice work guys, I am glad to see this thread continuing to get bumped. I must report that I gave up, deciding if I wanted digital gauges I'll just use my AccessPORT. I ended up installing a JVC touch screen headunit in the STi and putting RetroPie on the Raspberry Pi to play old video games with my daughter. So while I was a little sad to admit defeat, there was a happy ending. The linux keywords I would read about are configure, make, and install. If you are given a makefile in theory there should be no need to create one using configure. Iceman are you in the Kansas City area? I live in Raymore. I am originally from the KC area, but currently live in Rolla, MO for the next few years. I was able to get RomRaider up and running and accessing the gauges, I am just waiting on the time when I can design the housing for the touch screen to replace that panel on top/center of the dash. Where was it you stopped with the RPI?
|
|
| Top |
|
 |
|
Justin 05 STi
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Wed Jan 22, 2020 11:56 pm |
|
 |
| Experienced |
 |
Joined: Thu Mar 02, 2006 2:51 am Posts: 345
|
Iceman.kcmo wrote: I am originally from the KC area, but currently live in Rolla, MO for the next few years. I was able to get RomRaider up and running and accessing the gauges, I am just waiting on the time when I can design the housing for the touch screen to replace that panel on top/center of the dash. Where was it you stopped with the RPI? Gotcha. If you're ever going to be back in the area and bored, shoot me a PM! I couldn't figure out the "error sending init" stuff I posted on the first page from the debug logs. 
_________________ - Justin download my ROM
|
|
| Top |
|
 |
|
equinox92
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Mon Mar 09, 2020 2:59 am |
|
 |
| Newbie |
Joined: Tue Nov 21, 2017 11:56 pm Posts: 82
|
Figured I'd give this a bump since I was working a bit on this tonight. So here's what I've done to get the OP2.0 working on my RPi: -Compiled j2534 files -Installed j2534 driver -Compiled JNA natively (ran into one of the same errors as OP did, but only 1 test failure, also updated a bunch of libs) -Copied my compiled jna.jar into the RomRaider/lib/common folder and replaced the jna.jar that was there When I booted up romraider I got a permissions error for the tactrix cable. I wrote a rules file to allow +rwx for any OP2.0 device. That solved that. Rules file: Code: SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", MODE="0666" SUBSYSTEM=="usb_device", ATTRS{idVendor}=="0403", MODE="0666"
Now when I load up romraider I am getting some weirdness from libusb. Here is my log file: Code: 0 INFO [main] - RomRaider 0.5.9 RC 3 Build: 769 3 INFO [main] - When requesting assistance at http://www.romraider.com please include the System Properties information below: 271 INFO [main] - Monday, 9 March 2020 02:44:20 GMT 291 INFO [main] - System Properties: {java.runtime.name=Java(TM) SE Runtime Environment awt.useSystemAAFontSettings=lcd sun.boot.library.path=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm java.vm.version=25.65-b01 sun.java2d.d3d=false java.vm.vendor=Oracle Corporation java.vendor.url=http://java.oracle.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io user.country=GB sun.java.launcher=SUN_STANDARD sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/usr/local/RomRaider java.runtime.version=1.8.0_65-b17 java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment java.endorsed.dirs=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/endorsed os.arch=arm java.io.tmpdir=/tmp line.separator=
java.vm.specification.vendor=Oracle Corporation os.name=Linux sun.jnu.encoding=UTF-8 java.library.path=lib/linux java.specification.name=Java Platform API Specification java.class.version=52.0 sun.management.compiler=HotSpot Client Compiler os.version=4.14.98-v7+ user.home=/home/pi sun.arch.abi=gnueabihf user.timezone=Europe/London java.awt.printerjob=sun.print.PSPrinterJob file.encoding=UTF-8 java.specification.version=1.8 java.class.path=/usr/local/RomRaider/RomRaider.jar user.name=pi java.vm.specification.version=1.8 sun.java.command=/usr/local/RomRaider/RomRaider.jar -logger java.home=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre sun.arch.data.model=32 user.language=en java.specification.vendor=Oracle Corporation awt.toolkit=sun.awt.X11.XToolkit java.vm.info=mixed mode java.version=1.8.0_65 java.ext.dirs=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/ext:/usr/java/packages/lib/ext sun.boot.class.path=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/resources.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/rt.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/jsse.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/jce.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/charsets.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/jfr.jar:/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/classes java.vendor=Oracle Corporation swing.aatext=true file.separator=/ java.vendor.url.bug=http://bugreport.sun.com/bugreport/ sun.io.unicode.encoding=UnicodeLittle sun.cpu.endian=little sun.cpu.isalist=} 2140 INFO [main] - Logger locale: en_GB 5495 INFO [main] - DYNO New Car Selected: 01 JDM WRX STi 6MT, Gears: 6 5502 INFO [main] - DYNO Car: 01 JDM WRX STi 6MT, Changed gear to: 4 (1.346) 9540 INFO [main] - 321 ECU definitions loaded from 1 files 9620 INFO [main] - Plugin loaded: AEM UEGO AFR [9600 baud] v0.05 14584 INFO [main] - loaded protocol SSM: 245 parameters, 172 switches from def version 346. 16880 INFO [Thread-2] - J2534 initialization: com.romraider.io.j2534.api.J2534_v0404$SCONFIG.setFieldOrder([Ljava/lang/String;)V, trying serial connection... 16890 INFO [Thread-2] - Error sending init: Parameter portName must not be null or empty 17921 INFO [Thread-2] - J2534 initialization: PassThruOpen error [14:ERR_DEVICE_IN_USE], , trying serial connection... 17922 INFO [Thread-2] - Error sending init: Parameter portName must not be null or empty 18956 INFO [Thread-2] - J2534 initialization: PassThruOpen error [14:ERR_DEVICE_IN_USE], , trying serial connection... 18957 INFO [Thread-2] - Error sending init: Parameter portName must not be null or empty
It looks like it's running the j2534 code! But what the log doesn't show is some other java callouts like: libusb: warning [libusb_exit] application left some devices open This happens right after the J2534 init. I'm going to guess that's why the device is in use and why it's throwing that error.. I'm going to try to update my libusb (or downgrade) but wanted to just document this. I'm also not sure if my rules file has anything to do with the error as well. Or hell, it could even bet the J2534 code too.. EDIT: Should also note I got this warning when compiling j2534.c: Code: j2534.c: In function ‘PassThruOpen’: j2534.c:313:13: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] pDeviceID = con->dev_handle;
Which is a bit curious
_________________ 98 Impreza RS - V8 STi EJ207 Swapped
|
|
| Top |
|
 |
|
equinox92
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Mon Mar 09, 2020 7:46 pm |
|
 |
| Newbie |
Joined: Tue Nov 21, 2017 11:56 pm Posts: 82
|
Recompiled JNA and Native after some effort.. When I run the tests they all pass but I get this warning: Code: [junit] ------------- Standard Error ----------------- [junit] Mar 09, 2020 7:32:52 PM com.sun.jna.Native getCharset [junit] WARNING: JNA Warning: Encoding 'unsupported' is unsupported (unsupported) [junit] Mar 09, 2020 7:32:52 PM com.sun.jna.Native getCharset [junit] WARNING: JNA Warning: Using fallback encoding UTF-8 [junit] ------------- ---------------- ---------------
Not sure if that matters since I can see the PassThru lib reacting properly to when the device in unplugged.. so I doubt it's sending it garbage. Also can see that my RXTX versions are mismatched: -Jar version: RXTX-2.1-7 -nativ lib version: RXTX-2.2pre2 I wonder if that's going to cause an issue.. Also got the log working for the j2534 code: this is what I get with a freshly created log file: Code: CPU Endian: little Opening... | pName: NULL Device Opened, Device ID:00 Cannot Claim Interface GetLastError | ErrorDescription: Cannot claim interface from kernel driver EndGetLastError CPU Endian: little Opening... | pName: NULL Device Opened, Device ID:00 Claimed Interface 1 Init sent Init acknowledged Interface Opened ReadVersion | fwVer : 1.17.4822 libVer: 2.0.3 apiVer: 04.04 EndReadVersion Connecting... | DeviceID: 00 protocolID: 03 flags: 00 baud: 4800 Connected
Should also note I'm a bit confused on how the log is supposed to update.. but.. working through it. Still getting the same errors in RomRaider as above.
_________________ 98 Impreza RS - V8 STi EJ207 Swapped
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Tue Mar 10, 2020 12:39 am |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
Code: ErrorDescription: Cannot claim interface from kernel driver https://github.com/dschultzca/j2534/blo ... 534.c#L319This means the kernel driver for the cable is still attached to the device and could no be detached by a libusb call. Maybe your libusb is still a problem? Detach it manually and then restart RR Logger? An environment variable of LOG_ENABLE set to 1 will enable the driver debug logging.
|
|
| Top |
|
 |
|
equinox92
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Tue Mar 10, 2020 1:32 am |
|
 |
| Newbie |
Joined: Tue Nov 21, 2017 11:56 pm Posts: 82
|
dschultz wrote: Code: ErrorDescription: Cannot claim interface from kernel driver https://github.com/dschultzca/j2534/blo ... 534.c#L319This means the kernel driver for the cable is still attached to the device and could no be detached by a libusb call. Maybe your libusb is still a problem? Detach it manually and then restart RR Logger? An environment variable of LOG_ENABLE set to 1 will enable the driver debug logging. No dice. did an Code: lsusb -t and got: Code: /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/3p, 480M |__ Port 1: Dev 5, If 0, Class=Vendor Specific Class, Driver=lan78xx, 480M |__ Port 2: Dev 17, If 0, Class=Communications, Driver=cdc_acm, 12M |__ Port 2: Dev 17, If 1, Class=CDC Data, Driver=cdc_acm, 12M
did a Code: sudo echo -n '1-1.1.2' > /sys/bus/usb/drivers/usb/unbind then did lsusb -t again and got Code: /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/3p, 480M |__ Port 1: Dev 5, If 0, Class=Vendor Specific Class, Driver=lan78xx, 480M
Looks like it's unbound.. launch RR and get the exact same results.. Should also note I redownloaded libusb and recompiled the j2534 stuff and did get 1 more warning: Code: j2534.c: In function ‘PassThruOpen’: j2534.c:299:2: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations] libusb_set_debug(con->ctx, 3); ^~~~~~~~~~~~~~~~ In file included from j2534.c:15:0: /usr/local/include/libusb-1.0/libusb.h:1307:18: note: declared here void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level); ^~~~~~~~~~~~~~~~
Doesn't look like it should matter.. but maybe I should update libusb or SOMETHING... :shrug:
_________________ 98 Impreza RS - V8 STi EJ207 Swapped
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Tue Mar 10, 2020 12:49 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
I'm sure I wrote it down somewhere, I just can't find it right now. I believe I added another rule to stop the default kernel driver from loading. But the detach request should take care of it unless something else latched onto the device once it loaded. I've since upgraded my Linux system to a 64bit OS and archived my 32bit files, so I don't have a dev system to look into this a test further right now. BTW: I use this rule: Code: SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cc4d", GROUP="dialout", MODE="0666"
|
|
| Top |
|
 |
|
equinox92
|
Post subject: Re: OpenPort 2.0 Linux j2534 driver? Posted: Tue Mar 10, 2020 3:23 pm |
|
 |
| Newbie |
Joined: Tue Nov 21, 2017 11:56 pm Posts: 82
|
|
Yep I ended up adding that rule to the rules file I made. I'll have to look more into how the kernal driver interacts with everything.. definitely lacking some knowledge here.
I'm not too sure what's exactly going on.. but I'll keep looking into it when I can. I've got vested interest on a project that requires the use of CAN through romraider on a linux machine so the motivation exists haha.
_________________ 98 Impreza RS - V8 STi EJ207 Swapped
|
|
| Top |
|
 |
Who is online |
Users browsing this forum: No registered users and 20 guests |
|
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
|
|