Camera & Gate Control (Raspberry Pi)
April 16, 2026 ยท View on GitHub
This example shows how to turn a Raspberry Pi into a camera + gate control device connected to the Ixian Platform via QuIXI and Spixi Mini Apps.
The device streams camera images, and accepts gate toggle commands in real time.
๐ Requirements
- Raspberry Pi 2+ with Raspberry Pi OS Lite
- Internet connection
- Camera accessible at
/root/cur.jpg - Gate control connected to GPIO pin 11
- .NET 10
- Mosquitto MQTT
โก Installation
sudo apt update
sudo apt install -y curl git jq mosquitto mosquitto-clients
# Install .NET 10
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 10.0 --version latest --verbose
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc
source ~/.bashrc
# Clone and build QuIXI + Ixian Core
git clone https://github.com/ixian-platform/Ixian-Core.git
git clone https://github.com/ixian-platform/QuIXI.git
dotnet build -c Release
๐ Project Structure
/GateControl
โโโ start.sh # Launches QuIXI and helper scripts
โโโ ixiAppProtocolHandler.sh # Handles App Protocol toggle/ping commands
โโโ ixiMessageHandler.sh # Handles chat commands (temp/wifi/contacts/help)
โโโ sendImages.sh # Sends camera images to Spixi Mini Apps
โโโ helpers.sh # Helper functions for messaging & system control
โโโ ixian.cfg # Example QuIXI configuration file
โโโ quixi.service # systemd service file for auto-start
Note:
quixi.serviceassumesstart.shand all helper scripts reside in/root/. Adjust paths if you move them elsewhere.
โถ๏ธ Running the Example
Copy example ixian.cfg file to Release directory and edit if required
cp ixian.cfg QuIXI/QuIXI/bin/Release/net10.0/
Manual start
chmod +x start.sh ixiAppProtocolHandler.sh ixiMessageHandler.sh sendImages.sh helpers.sh
./start.sh
Auto-start on boot (systemd)
Copy the provided service file:
sudo cp quixi.service /etc/systemd/system/
sudo systemctl enable quixi
sudo systemctl start quixi
Check status:
systemctl status quixi
๐ Add Your Device as a Contact
Before you can send commands, add your Ixian address as a contact to QuIXI. Replace DEVICE_ADDRESS with the
address of your Spixi client:
curl --get \
--data-urlencode "address=DEVICE_ADDRESS" \
"http://localhost:8001/addContact"
๐ก Supported Commands
Send commands via Ixian chat (Chat/#) or through App Protocol messages (AppProtocolData/#):
| Command / Action | Description |
|---|---|
toggle (App Protocol) | Opens/closes the gate connected to GPIO 11 |
ping (App Protocol) | Registers sender to receive camera images |
temp | Replies with Raspberry Pi CPU temperature |
wifi | Manage Wi-Fi connections (add/remove/list) |
contacts | Manage Ixian contacts (accept/add/remove/list) |
help | Show available commands |
App Protocol ID: com.ixilabs.gatecontrol
Camera images are sent periodically to registered Spixi Mini App addresses.
๐ How It Works
start.shlaunches QuIXI and all helpers.ixiAppProtocolHandler.shlistens fortoggleandpingcommands via App Protocol.sendImages.shstreams camera images to registered addresses using the TTL mechanism.ixiMessageHandler.shlistens onChat/#, parses commands, and executes helper functions (temp,wifi,contacts).
This demonstrates how IoT devices can integrate into Ixian using App Protocols and MQTT, enabling real-time interaction and streaming with Spixi Mini Apps.
๐ฒ Spixi Mini App
To use the camera + gate control interface, install the Example Gate Control Mini App in Spixi:
https://resources.ixian.io/gate-control.spixi
๐ License
This example is part of QuIXI and licensed under the MIT License.