-
A Linux distribution capable of installing K3s
- View K3s' hardware and software requirements here
-
GStreamer installed on your client
On your Linux machine, install K3s using the following command:
curl -sfL https://get.k3s.io | sh -
If the cluster is running, you should see the following output after running:
sudo k3s kubectl get po -A
If you encounter issues with K3s not booting up on Ubuntu 21.10 to Ubuntu 23.10 running on ARM:
-
Check the logs:
journalctl -xe -u k3s
-
If the error is related to
VXLAN
, try installing the following package:sudo apt install linux-modules-extra-raspi
For more details on installation requirements, particularly for Raspberry Pi, refer to the K3s official documentation.
sudo k3s kubectl apply -f https://raw.githubusercontent.com/Edgenesis/shifu/v0.53.0/pkg/k8s/crd/install/shifu_install.yml
sudo k3s kubectl apply -f https://raw.githubusercontent.com/Edgenesis/shifu/v0.53.0/pkg/telemetryservice/install/telemetryservice_install.yaml
The following services should be running as shown below:
Update the camera/camera_edgedevice.yaml
file's spec.address
with the correct RTSP URL (e.g., "192.168.10.20").
sudo k3s kubectl apply -f camera/
deviceShifu should be running as shown below:
To access the camera stream from outside the cluster:
sudo k3s kubectl port-forward -n deviceshifu svc/deviceshifu-camera 30080: --address=0.0.0.0
From your client, issue the following command (replace placeholders with your RTSP username, password, and server IP address):
gst-launch-1.0 rtspsrc location="rtsp://{RTSP_USERNAME}:{RTSP_PASSWORD}@{SERVER_IP_ADDRESS}:30080" \
protocols=tcp \
retry=5 \
latency=2000 \
timeout=60000000 \
! rtph265depay ! h265parse ! avdec_h265 \
! videoconvert ! autovideosink
Sample output from an IP camera stream:
In the plc/deployment.yaml
file, update:
spec.template.spec.containers[1].env
'sPLC_ADDRESS
with the correct PLC IP addressPLC_PORT
with the correct PLC port
sudo k3s kubectl apply -f plc/
deviceShifu should be running as shown below:
sudo k3s kubectl apply -f ingress/ingress-plc.yaml
Use curl
to control the Siemens PLC deviceShifu. For example, to change the output of Q0.1 and Q0.2 to 1 and 0:
curl "localhost/api/sendsinglebit?rootaddress=Q&address=0&start=0&digit=1&value=1"; echo
curl "localhost/api/sendsinglebit?rootaddress=Q&address=0&start=0&digit=1&value=0"; echo
curl "localhost/api/sendsinglebit?rootaddress=Q&address=0&start=0&digit=2&value=1"; echo
curl "localhost/api/sendsinglebit?rootaddress=Q&address=0&start=0&digit=2&value=0"; echo
sudo k3s kubectl apply -f https://raw.githubusercontent.com/Edgenesis/shifu/main/examples/mqttDeviceShifu/mqtt_broker/mosquitto.yaml
sudo k3s kubectl apply -f telemetryservice/telemetryserivce-plc.yaml
To view the data:
sudo k3s kubectl exec -it -n devices deploy/mosquitto -- mosquitto_sub -t '/siemens/s7'
Sample output from the MQTT Broker:
Follow the instructions in the Shifu Cloud documentation to deploy the camera deviceShifu.
For any questions or issues, please contact the Shifu team at [email protected].