Pi4 good, Pi5 bad?

hairydog12 days ago

I am trying to install traccar 6.5 on a Raspberry Pi 5.

Last week I followed the instructions and successfully installed Traccar on a Pi 4.

This week I thought I'd compare how it runs on a Pi5. And so far, 'not at all' is how it runs.

As far as I can tell, I have done exactly the same things both times, but nothing happens on the Pi5 when I try to start traccar. There are no entries in the log, and when I try:

:/opt/traccar#  /opt/traccar/jre/bin/java -jar ./tracker-server.jar

I get:

bash: /opt/traccar/jre/bin/java: cannot execute: required file not found

I am not sure which required file is not found, though.
Is there some issue with the Pi5 that doesn't affect the Pi4, or have I done something wrong?

odhiambo12 days ago

The only difference is Java jre. Check carefully.

hairydog12 days ago

Check /what/ carefully?

Track-trace12 days ago

How about making sure java can be executed.

Going to a command line and typing java -version can tell us for sure if Java is installed.

hairydog12 days ago

I was under the impression that Traccar included java runtime. I didn't install java on the Pi4 and that responds like this

:/opt/traccar $ java -version
-bash: java: command not found

But traccar works just fine on that machine

Do the same thing on the Pi5 and I get the same result:

:/opt/traccar# java -version
bash: java: command not found

The difference is that traccar is running on the Pi4 and is not running on the Pi5

odhiambo12 days ago

Your command presumes that the java binary is in your $PATH. And it is not. Since traccar is running on the Pi4, why don't you check where the java binary it's using is by doing 'systemctl cat traccar'

hairydog11 days ago

Pi 4 (traccar working) result:

$ sudo systemctl cat traccar
'# /etc/systemd/system/traccar.service
[Unit]
Description=traccar
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/traccar
ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
SyslogIdentifier=traccar
SuccessExitStatus=143
WatchdogSec=600
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

'# /etc/systemd/system/traccar.service.d/run-as-user.conf
[Service]
User=www-data
Group=www-data

Pi 5 result (Traccar not working)

'# /etc/systemd/system/traccar.service
[Unit]
Description=traccar
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/traccar
ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
SyslogIdentifier=traccar
SuccessExitStatus=143
WatchdogSec=600
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

'# /etc/systemd/system/traccar.service.d/run-as-user.conf
[Service]
User=www-data
Group=www-data

So I don't think that is the difference. They seem much the same as one another.

hairydog11 days ago

On the Pi4 (working):

:/opt/traccar/jre/bin $ ./java -version
openjdk version "21.0.4" 2024-07-16 LTS
OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode)

On the Pi5 (not working)

:/opt/traccar/jre/bin $ ./java -version
-bash: ./java: cannot execute: required file not found

At least there is a difference! The problem is that I don't know what that difference could be.
The directory listings on both machines look exactly the same

hairydog11 days ago

Aha! I found the problem. The Pi5 is running on 32-bit Debian.

That's a bit annoying to fix, but at least it explains the problem.

Thanks, everyone, for your help with this.

hairydog11 days ago

Sorry, my optimism was misplaced.

Pi4:

uname -a
Linux pi4.redacted.uk 6.6.62+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux

Pi5:

uname -a
Linux pi5.redacted.uk 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux

what is different is
Pi4:

getconf LONG_BIT
64

Pi5:

getconf LONG_BIT
32

How do I fix this?

odhiambo11 days ago

It appears to me that you installed the 32-bit version of Pi OS on the Pi5. You have to wipe the media and install the 64-bit OS.

hairydog11 days ago

Sadly, that is a non-trivial task. That Pi has a lot of other stuff on it. I think I'll run tracccar on a different server.