Controller Setup
This guide walks you through setting up an EGOS Controller on a Raspberry Pi.
Prerequisites
- Raspberry Pi 4 with Raspberry Pi OS installed
- Network connection (Ethernet recommended)
- SSH access to the Pi
- EGOS Cloud instance running and accessible
Installation
1. Prepare the Raspberry Pi
Connect via SSH and update the system:
sudo apt update && sudo apt upgrade -y
2. Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
Verify installation:
node --version npm --version
3. Clone the Controller Repository
git clone https://github.com/egos-games/egos-controller.git
cd egos-controller
npm install
4. Configure the Controller
Create the environment file:
cp .env.example .env
nano .env
Configure these settings:
# Controller Identity CONTROLLER_ID=controller-1 # Cloud Connection CLOUD_MQTT_HOST=your-cloud-host.com CLOUD_MQTT_PORT=9001 CLOUD_AUTH_TOKEN=your-secure-token # Local MQTT LOCAL_MQTT_PORT=1883 # Optional: Home Assistant HA_URL=http://homeassistant.local:8123 HA_TOKEN=your-ha-token
5. Start the Controller
npm start
Pro Tip
Use PM2 to keep the controller running:
sudo npm install -g pm2
pm2 start npm --name "egos-controller" -- start
pm2 save
pm2 startup
Verification
Check Cloud Connection
- Open EGOS Studio
- Navigate to Devices
- Your controller should appear in the list
Test Module Connection
- Connect a module to the Pi's network
- The module should auto-register
- Check the device list in the Studio
Troubleshooting
Controller Not Connecting
Check network connectivity:
ping your-cloud-host.com
Verify token is correct:
cat .env | grep CLOUD_AUTH_TOKEN
Modules Not Appearing
Check local MQTT broker:
netstat -an | grep 1883
Verify module network settings match controller IP.
Warning
Ensure your firewall allows connections on port 1883 (local MQTT) and outbound to cloud MQTT port.
Next Steps
With your controller set up, you can:
- Connect hardware modules
- Configure Home Assistant integration
- Create games in the Studio