Advice please for converting legacy P1.5 app to P3.5 to run on Raspberry Pi (or run 1.5 on Pi)

So, I have an extensive application written in P1.5 years ago and exported as an application to run on Linux (Ubuntu). It’s been working fine all those years but now I have to make it run on a Raspberry Pi 4 (4Gb). I need a strategy to get from here to there. I tried converting to the new P version 3.5, but the libraries don’t all have upgrades and the G4P library is giving me grief as I have an interface built with it’s v1.5 tool.

I was going for P3.5 because it supports ARM. However, because I can’t convert up to the new version (without an extensive if not complete re-write) I tried installing P1.5 on the Pi to see if I could get the old version running with the original working libraries, but ran into issues with the JRE6 dependencies (can’t find Java 6 jdk to install, all links give “cannot find” errors in the CLI). That still may be the easiest option if I can find JRE6 for the Pi, get the app running and compile it on the Pi.

Anyone been through this? Any recommendations? Thanks in advance.

Without any code or some more clues, any advice would be hypothetical (you have more clues at your disposal so will know better what the issues are). I would advise against your JRE6 idea, RaspberryPI4 might at a pinch work with jdk8 but all recent distros support jdk11+. Indeed I have had good success with ManjaroARM(64 bit) on the RaspberryPI4.

Yes indeed, just not sure where to start with code/specifics. My app is a P1.5 front end running on linux driving a Teensy that controls stepper drivers via USB. It is large at over 2,300 lines of code (the Processing end, before counting the Teensy code).

Trying to run P1.5 on the Pi as a starting point seemed the best strategy just to get the legacy app functional but I quickly ran into no available RTXcomm.jar without JRE6, and the app crashing as a result. I was using this post as a resource. I thought that if I could get the original working and compile it, I’d be good (I can get the original working without issue on a fresh Windows 10 install of P1.5)

Trying to convert to P3.5 ARM runs into issues with the gaps/changes between library versions. In particular, G4P has a gui building tool that has changed and won’t load the interface designed using it in P1.5. I use dropdown selectors that have changed, and because the GUI is built by the tool, I can’t simply edit, search and replace code. Rebuilding a new GUI (also problematic as I can run the prior app on the Pi to see it again to copy layout and function) would be a significant rewrite if I can even hook everything back together.

So did you manage to run P1.5 on the Pi using the ManjaroARM OS?

I have not tried running anything other than the development version of processing on ManjaroARM. If you could possibly avoid using the processing Ide, you should do so, you probably only need processing core to run your app. The processing pre-processor has really no place in a real application.

So I installed Manjaro on the Pi and it’s pretty cool. However, I’m having difficulty launching anything from a shell script. Even when set as an executable script, it launches a text editor. I thought that if I could load P1.5 in Manjaro on the Pi, I could load and run my original app. I’m having difficult launching P1.5 and I’m starting to think that maybe it’s because it’s not an ARM version of Processing?

When I check he terminal output of my exported linux application running on Manjaro on the Pi, it looks like it’s running but gets stalled out on trying to load librxtxSerial.so and the RXTXCommDriver.

Is there an ARM version of RXTXcomm.jar I could use/install?

Here’s where it stalls out:

java.lang.UnsatisfiedLinkError: /home/stephen/Desktop/Jupiter for Linux/application.linux64/librxtxSerial.so: /home/stephen/Desktop/Jupiter for Linux/application.linux64/librxtxSerial.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: /home/stephen/Desktop/Jupiter for Linux/application.linux64/librxtxSerial.so: /home/stephen/Desktop/Jupiter for Linux/application.linux64/librxtxSerial.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1973)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1898)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1888)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1090)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at processing.serial.Serial.<init>(Unknown Source)
at processing.serial.Serial.<init>(Unknown Source)
at Jupiter_v0_4_6.setup(Jupiter_v0_4_6.java:275)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)

Thoughts…?

I’m making some progress, but back on Raspbian.

I downloaded ARM version of RXTX with sudo apt-get install librxtx-java

A search then found librxtxSerial.so in .usr/lib/jni/, so I copied that over the one in my exported application.linux64 folder that came from my Windows PC. Now my app runs!! <dance of joy!>

However, while the app runs and functions, the serial comms are still not working so I’m still unable to control the Teensy. In the console I get the following:

WARNING:  RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
java.lang.NullPointerException
at processing.serial.Serial.write(Unknown Source)
at processing.serial.Serial.write(Unknown Source)

So I feel like I’m almost there. If I can clear this mismatch it hopefully will work again.

So, what I’m wondering is, how to resolve this conflict? Do I change the “native” version, and if so how? Or how do I change the jar version?

Any assistance is very welcome.

After digging around, I found that in the ./usr/share/java folder there was a RXTXComm-2.2pre2.jar file with a symlink to is as “RXTXComm.jar”. Copying the RXTXComm-2.2pre2.jar to my application.linux64/lib folder and renaming it to RXTXComm.jar solved my issue.

I have yet to fully test the hooked-up Teensy functioning under control of my Processing 1.5 app running on Raspberry Pi, but the application is running and talking to the Teensy fine so far. I think the problem may well be resolved!

1 Like

@hondaman900 I’m not sure processing-1.5 was built with any arm support, later versions specifically targeted the Raspbian distro (32 bit), and as such included appropriate jre. The main problem with development version (4.0) is that it does not include the appropriate jdk on ManjaroARM this is fixed as described here.

@hondaman900, glad to hear you are making progress, if you can get it to run on ManjaroARM you should in theory get better performance.

Thanks Monkstone, I really liked Manjaro on the Pi (thanks again for the tip) and once I get this confirmed-running on Raspbian I’ll go back to my Manjaro SD card and see if I can replicate running the P1.5 exported application with the same mods. My preference for this project would be Manjaro both for performance and more modern interface. Thanks for the help and I’ll circle back with updates.