Build a FUXA SCADA Monitoring Demo

Last updated:

This guide uses simulated tank levels to build a small SCADA monitoring screen on reComputer RK3576. Mosquitto receives MQTT messages, FUXA subscribes to the data, and its web editor displays the values in controls and a trend chart. You will also configure a low-level alarm.

This is a software-only demonstration. It does not connect to a PLC, operate a pump, or validate control of physical equipment. Complete the FUXA installation guide in this section before starting.

What you need

  • reComputer RK3576 with FUXA running in the fuxa-rk3576 container from the installation guide.
  • SSH access to the RK3576 and a browser on the same trusted network.
  • Mosquitto Broker and mosquitto_pub/mosquitto_sub on the RK3576. The commands below install them if needed.

The installation guide runs FUXA with Linux host networking. Check that the container is running and uses host networking so it can reach a broker listening on 127.0.0.1:1883:

bash
sudo docker ps --filter name=fuxa-rk3576
sudo docker inspect -f '{{.HostConfig.NetworkMode}}' fuxa-rk3576

If the second command does not print host, the 127.0.0.1 Broker address in this guide will not refer to the RK3576 host from inside FUXA. Adjust the container network and Broker address for your setup before continuing.

Step 1: Prepare a local MQTT Broker

On the RK3576:

bash
sudo apt update
sudo apt install -y mosquitto mosquitto-clients
sudo systemctl enable --now mosquitto
systemctl is-active mosquitto
sudo ss -ltnp | grep ':1883'

systemctl is-active should print active. For this local demonstration, keep the Broker bound to the RK3576 loopback interface; do not expose an unauthenticated MQTT listener to the Internet. If you already use a Broker with authentication, use its approved connection settings instead of assuming anonymous access.

Step 2: Publish and verify sample data

Use one MQTT topic for three numeric tank levels. Publish a retained JSON message so FUXA can discover it even if it subscribes after the first publication:

bash
mosquitto_pub -h 127.0.0.1 -p 1883 \
  -t rk3576/fuxa/demo/tanks -r \
  -m '{"tank1":7500,"tank2":1500,"tank3":3000}'

mosquitto_sub -h 127.0.0.1 -p 1883 \
  -t rk3576/fuxa/demo/tanks -C 1 -v

The subscriber should immediately print the topic followed by the JSON payload. Keep the spelling of tank1, tank2, and tank3 consistent in every later step.

Step 3: Connect FUXA to MQTT

Open http://<RK3576_IP>:1881/editor. Click the gear icon in the upper-left corner, open Connections, and add one connection for the MQTT Broker:

FieldValue for this local demonstration
NameRK3576 MQTT
TypeMQTTclient
Address (mqtt://[server]:[port])mqtt://127.0.0.1:1883
EnableOn

Leave Polling unset. Click OK and check that the connection shows a green status indicator. You need only this one MQTT connection; the three tanks are fields in one topic, not three separate connections.

Click the connection's link icon to open its tag/subscription page. In Browser Topics on broker, enter rk3576/fuxa/demo/tanks and click the search icon. Select the topic, enter the same path in Topic path if it is not filled automatically, choose json rather than raw, and click Subscribe. Confirm that the subscribed topic exposes the numeric fields tank1, tank2, and tank3.

Step 4: Create the monitoring view

Return to the editor and open MainView under Views. Add a text heading such as RK3576 Tank Monitor.

  1. Drag a numeric display control (the ## icon under Controls) onto the canvas. Bind it to the tank1 numeric tag, not to the whole JSON topic. Add two more and bind them to tank2 and tank3. They should show 7500, 1500, and 3000 after the initial publication.
  2. Drag the Chart control (the line-graph icon under Controls) onto the canvas. Open its Chart settings and use Chart to show → New Chart. In the chart configuration, click + to create a chart named Tank Levels.
  3. On the new chart's ⋮ menu, choose Add Line and bind the line to tank1. Add lines for tank2 and tank3 the same way if you want all three levels on one chart. Select Tank Levels in Chart to show.
  4. Save with the disk icon, then use the play/preview button to confirm that the three numbers and chart appear on the runtime page.

Use the exact tag names shown in your FUXA connection. The editor's tag picker may include the MQTT connection and topic as part of the displayed path.

Step 5: Watch values change

In a second RK3576 terminal, run this foreground simulator. Press Ctrl+C when you want to stop it:

bash
tank1=7500
tank2=1500
tank3=3000

while true; do
  mosquitto_pub -h 127.0.0.1 -p 1883 \
    -t rk3576/fuxa/demo/tanks -r \
    -m "{\"tank1\":$tank1,\"tank2\":$tank2,\"tank3\":$tank3}"

  tank1=$((tank1 - 100))
  tank2=$((tank2 + 60))
  tank3=$((tank3 + 40))

  if [ "$tank1" -le 0 ]; then
    tank1=7500
    tank2=1500
    tank3=3000
  fi
  sleep 2
done

In FUXA's runtime view, check that the numbers follow the published values and the chart gains points. Stop the simulator before the alarm test below, or its next message will immediately overwrite the test value.

Step 6: Add and test a low-level alarm

In the FUXA editor, click the upper-left gear icon, open Alarms, and add an alarm. Configure it as follows:

FieldValue
NameTank 1 low level
TagThe numeric tank1 tag under RK3576 MQTT
Low → EnabledOn
Low → Check interval (seconds)1
Low → Min / Max0 / 1000
Low → Time in Min-Max range (seconds)1
Low → TextTank 1 low level

Click OK and save the editor project. The interval and range-time fields are in seconds; enter 1, not 1000. This example does not require a separate High or High High condition.

With the simulator stopped, publish a low value:

bash
mosquitto_pub -h 127.0.0.1 -p 1883 \
  -t rk3576/fuxa/demo/tanks -r \
  -m '{"tank1":800,"tank2":1500,"tank3":3000}'

Open the FUXA runtime page at http://<RK3576_IP>:1881/. Check that the first display shows 800, the bell in the upper-right corner has a red badge, and the Alarms panel contains Tank 1 low level with priority Low and status Active. Click the bell to show the alarm panel if it is collapsed.

After the test, restore a normal value:

bash
mosquitto_pub -h 127.0.0.1 -p 1883 \
  -t rk3576/fuxa/demo/tanks -r \
  -m '{"tank1":7500,"tank2":1500,"tank3":3000}'

Result and limitations

The demonstration is complete when the MQTT subscription is connected, the numeric displays and chart respond to changing values, and the low-level alarm appears when tank1 is 800. The publisher is a foreground test loop, not a production data source. A retained MQTT value remains available after the loop stops, so a static display does not by itself prove that updates are still arriving.

For a real deployment, replace the simulator with an authenticated data source, restrict access to the FUXA web interface and Broker, and verify alarms and any control actions against the actual equipment. Do not connect this example directly to safety-critical machinery.

References