====== Installing MIX on a Raspberry Pi ======
Complete [[BaseRaspberryPiSetupBookworm]|Raspberry Pi Base Setup]] first.
These instructions install MIX in:
/home/mix/mixruntime
MIX requires **Java 25**.
The validated Raspberry Pi installation used:
/opt/java/zulu25.34.17-ca-fx-jdk25.0.3-linux_aarch64
The normal MIX web port is **7226** unless ''%%mix.port%%'' in ''%%mix.properties%%'' has been changed.
The MIX setup page is:
http://:7226/setup.html
After an MIStudio project is deployed, the validated application URL is:
http://:7226/index.html
===== 1. Copy the MIX runtime to the Raspberry Pi =====
On the Windows computer, open PowerShell and change to the MIX installation directory for the software release being deployed.
For example:
Set-Location "C:\ET\\MIX"
Create the MIX runtime directory on the Raspberry Pi:
ssh mix@ "mkdir -p /home/mix/mixruntime"
Copy the contents of the MIX runtime directory:
scp -r .\* mix@:/home/mix/mixruntime/
After the copy completes, connect to the Pi:
ssh mix@
Verify the runtime files:
ls -la /home/mix/mixruntime
ls -la /home/mix/mixruntime/scripts
The MIX runtime should contain files and directories including:
mix.jar
mix.properties
htmlroot/
lib/
log4j/
logs/
scripts/
security/
The Linux startup script is:
/home/mix/mixruntime/scripts/MIX.sh
Make the Linux scripts executable:
chmod +x /home/mix/mixruntime/scripts/MIX.sh
chmod +x /home/mix/mixruntime/scripts/stopmix.sh
chmod +x /home/mix/mixruntime/scripts/restartmix.sh
If the copied MIX installation contains an ''%%ErgoIOTLicense_*.lic%%'' file from another computer, remove or move that file before starting MIX.
Each Raspberry Pi must use the runtime license associated with that Pi.
===== 2. Verify Java 25 =====
Verify the Java installation:
/opt/java/zulu25.34.17-ca-fx-jdk25.0.3-linux_aarch64/bin/java -version
The validated installation reports:
openjdk version "25.0.3"
MIX can use this Java installation directly without changing the Raspberry Pi's system-wide Java default.
===== 3. Start MIX manually =====
Change to the MIX runtime directory:
cd /home/mix/mixruntime
Start MIX with Java 25:
MIX_JAVA_HOME=/opt/java/zulu25.34.17-ca-fx-jdk25.0.3-linux_aarch64 \
./scripts/MIX.sh
Startup output should identify the MIX installation, Java executable, and configured port.
For example:
MIX_INSTALL_DIR: /home/mix/mixruntime
MIX_WORK_DIR: /home/mix/mixruntime
MIX properties: /home/mix/mixruntime/mix.properties
Java executable: /opt/java/zulu25.34.17-ca-fx-jdk25.0.3-linux_aarch64/bin/java
Native libraries: /home/mix/mixruntime/lib
Debug port: 18050
MIX should also report:
mix.port:7226
and its MIX build number.
If a Raspberry Pi runtime license has not yet been installed, MIX will display the system's pre-license key:
Initializing MIX runtime with prelicense key:
Keep this key for the license request.
===== 4. Install the Raspberry Pi runtime license =====
Each Raspberry Pi requires an ErgoTech runtime license associated with that system.
The pre-license key is shown during MIX startup. It can also be viewed from the MIX setup page:
http://:7226/setup.html
Select **Get Pre-License Key** and send the displayed key to ErgoTech.
Copy the license provided for the Raspberry Pi into:
/home/mix/mixruntime
The filename may include the pre-license key, for example:
ErgoIOTLicense_.lic
If TransSECS has already been licensed on the same Raspberry Pi using the same pre-license key, the Pi-specific ErgoIOT runtime license can also be copied into the MIX runtime directory.
Start MIX again:
cd /home/mix/mixruntime
MIX_JAVA_HOME=/opt/java/zulu25.34.17-ca-fx-jdk25.0.3-linux_aarch64 \
./scripts/MIX.sh
Verify that startup contains:
Valid IOT System Runtime License detected.
===== 5. Verify the MIX web server =====
While MIX is running, verify that port 7226 is listening:
sudo ss -ltnp | grep 7226
A normal result contains:
LISTEN ... *:7226 ... java
From a browser on another computer, open:
http://:7226/setup.html
Verify that the MIX setup page loads.
===== 6. Deploy an MIStudio project to the Raspberry Pi =====
In MIStudio, select the project's **MIX Target**.
Configure the target with the Raspberry Pi address.
For example:
Host Name:
Mix Login Name: ergouser
Port: 7226
Target Name: MIX
Enter the configured MIX password.
Save the MIStudio project and select **Deploy**.
During a successful deployment, MIX should:
* authenticate the MIStudio deployment request,
* stop the currently loaded application logic,
* replace the deployed application files,
* receive the new ''%%VIBLogic.jar%%'' and application files,
* reload the application logic,
* continue running without requiring the MIX process to be stopped manually.
After deployment, open:
http://:7226/index.html
Verify that the newly deployed application loads.
The MIX console should show the deployment files being received and the application logic being reloaded.
===== 7. Stop the manual MIX process =====
Before configuring automatic startup, stop the manually started MIX process.
If MIX is running in the foreground, press:
Ctrl+C
Verify that no MIX HeadlessController process remains:
pgrep -af 'com.ergotech.mix.server.HeadlessController'
No output should be returned.
===== 8. Run MIX automatically as a Linux service =====
Create the log directory if it does not already exist:
mkdir -p /home/mix/mixruntime/logs
Create:
sudo nano /etc/systemd/system/mix.service
Paste:
[Unit]
Description=MIX Service
After=network-online.target
Wants=network-online.target
[Service]
User=mix
WorkingDirectory=/home/mix/mixruntime
Environment="MIX_JAVA_HOME=/opt/java/zulu25.34.17-ca-fx-jdk25.0.3-linux_aarch64"
ExecStart=/bin/sh /home/mix/mixruntime/scripts/MIX.sh
Restart=always
RestartSec=60
StandardOutput=append:/home/mix/mixruntime/logs/runmix-console.log
StandardError=append:/home/mix/mixruntime/logs/runmix-console.log
[Install]
WantedBy=multi-user.target
Save with **Ctrl+O**, **Enter**, **Ctrl+X**.
Reload systemd, enable MIX at boot, and start it:
sudo systemctl daemon-reload
sudo systemctl enable mix
sudo systemctl start mix
Verify the service:
systemctl status mix --no-pager
Look for:
Active: active (running)
Verify the MIX Java process:
pgrep -af 'com.ergotech.mix.server.HeadlessController'
The process should use:
/opt/java/zulu25.34.17-ca-fx-jdk25.0.3-linux_aarch64/bin/java
Verify that MIX is listening on port 7226:
sudo ss -ltnp | grep 7226
===== 9. Verify MIX console logging =====
MIX console output is written to:
/home/mix/mixruntime/logs/runmix-console.log
Verify:
tail -n 40 /home/mix/mixruntime/logs/runmix-console.log
Check the MIX build, pre-license key, and license result:
grep -E "Running MIX Build|Valid IOT System Runtime License detected|Initializing MIX runtime" \
/home/mix/mixruntime/logs/runmix-console.log | tail -n 10
A successfully licensed startup should contain lines similar to:
Running MIX Build
Initializing MIX runtime with prelicense key:
Valid IOT System Runtime License detected.
Verify the console log file:
ls -l /home/mix/mixruntime/logs/runmix-console.log
With the validated systemd configuration, the active console log was created as:
root root
===== 10. Limit the MIX console log =====
Create:
sudo nano /etc/logrotate.d/runmix-console
Paste:
/home/mix/mixruntime/logs/runmix-console.log {
su root root
size 5M
rotate 5
compress
delaycompress
missingok
notifempty
copytruncate
}
Save with **Ctrl+O**, **Enter**, **Ctrl+X**.
Check the rule:
sudo logrotate -d /etc/logrotate.d/runmix-console
A normal result mentions:
* ''%%/home/mix/mixruntime/logs/runmix-console.log%%''
* ''%%5242880 bytes%%''
* ''%%5 rotations%%''
If the current file is smaller than 5 MB, ''%%logrotate%%'' will report that it does not need rotating. This is normal.
To verify the rule completely, force one rotation:
sudo logrotate -vf /etc/logrotate.d/runmix-console
Check the result:
ls -lh /home/mix/mixruntime/logs/runmix-console.log*
systemctl status mix --no-pager
pgrep -af 'com.ergotech.mix.server.HeadlessController'
The previous console contents should be copied to:
runmix-console.log.1
The active ''%%runmix-console.log%%'' should be truncated while the same MIX process remains running.
Generate a new request:
curl -s -o /dev/null http://127.0.0.1:7226/setup.html
sleep 2
Verify that the active log receives new output:
ls -lh /home/mix/mixruntime/logs/runmix-console.log*
tail -n 10 /home/mix/mixruntime/logs/runmix-console.log
A successful test should show:
Default Servlet : GET Request: /setup.html
===== 11. Reboot and verify MIX =====
Reboot:
sudo reboot
After the Raspberry Pi comes back online, reconnect:
ssh mix@
Verify that MIX started automatically:
systemctl status mix --no-pager
Verify the MIX Java process:
pgrep -af 'com.ergotech.mix.server.HeadlessController'
Verify port 7226:
sudo ss -ltnp | grep 7226
Verify that the current boot started MIX and accepted the runtime license:
grep -E "Running MIX Build|Valid IOT System Runtime License detected|Initializing MIX runtime" \
/home/mix/mixruntime/logs/runmix-console.log | tail -n 10
Verify:
* MIX is ''%%active (running)%%''.
* MIX is running with Java 25.
* Port 7226 is listening.
* The current MIX build started successfully.
* The Raspberry Pi runtime license is accepted.
* ''%%runmix-console.log%%'' contains startup messages from the current boot.
Finally, open:
http://:7226/index.html
and verify that the deployed application is available after the reboot.
At this point MIX is installed, licensed, configured for automatic startup, accepting MIStudio deployments, serving the deployed application, and rotating its console log correctly.