Docker compose script for the IQRF Gateway running on RPi boards.
- coordinator is connected via SPI at
/dev/spidev0.0
- IQRF Gateway Daemon API WebSocket is available at
ws://gw-ip:1338/
- IQRF Gateway Daemon Monitor WebSocket is available at
ws://gw-ip:1438/
- IQRF Gateway Webapp is available at
http://gw-ip/
andhttps://gw-ip/
- MQTT broker is available at
tcp://gw-ip:1883
To get started with all defaults, simply clone the repository and start the containers.
git clone https://gitlab.iqrf.org/open-source/iqrf-gateway-docker.git
docker-compose up -d
- Clone the repository to directories with unique names (e.g. use instance ID as a suffix).
- Change all exposed ports (e.g.
"80:80"
) to be unique for each instance (e.g."8080:80"
,"8081:80"
) indocker-compose.yml
. - Change the mapped interface for coordinator on line 54 in
docker-compose.yml
. - Change the coordinator interface in IQRF Gateway Daemon's configuration.
- Start the containers
for i in {0..1}; do
git clone https://gitlab.iqrf.org/open-source/iqrf-gateway-docker.git "iqrf-gateway-${i}"
cd "iqrf-gateway-${i}"
sed -i "s/\"80:80\"/\"$((8080 + ${i})):80\"/g" docker-compose.yml
sed -i "s/\"443:443\"/\"$((8443 + ${i})):443\"/g" docker-compose.yml
sed -i "s/\"1338:1338\"/\"$((1338 + ${i})):1338\"/g" docker-compose.yml
sed -i "s/\"1438:1438\"/\"$((1438 + ${i})):1438\"/g" docker-compose.yml
sed -i "s/\"55000:55000\/udp\"/\"$((55000 + ${i})):55000\/udp\"/g" docker-compose.yml
sed -i "s/\"55300:55300\/udp\"/\"$((55300 + ${i})):55300\/udp\"/g" docker-compose.yml
sed -i "s/\"1883:1883\"/\"$((1883 + ${i})):1883\"/g" docker-compose.yml
sed -i "s/\"\/dev\/spidev0\.0:\/dev\/spidev0\.0\"/\"\/dev\/ttyACM$((0 + ${i})):\/dev\/ttyACM$((0 + ${i}))\"/g" docker-compose.yml
perl -i -p0e "s/\"libraryName\": \"IqrfCdc\",\n {12}\"enabled\": false/\"libraryName\": \"IqrfCdc\",\n \"enabled\": true/g" daemon/config/config.json
perl -i -p0e "s/\"libraryName\": \"IqrfSpi\",\n {12}\"enabled\": true/\"libraryName\": \"IqrfSpi\",\n \"enabled\": false/g" daemon/config/config.json
sed -i "s/\/dev\/ttyACM0/\/dev\/ttyACM$((0 + ${i}))/g" daemon/config/iqrf__IqrfCdc.json
docker-compose up -d
cd ..
done
- Select true at your interface that connects TR module (keep false at others)
- IqrfCdc (false)
- IqrfSpi (true)
- IqrfUart (false)
nano daemon/config/config.json
- Configure parameters for the selected interface
nano daemon/config/iqrf__IqrfCdc.json
nano daemon/config/iqrf__IqrfSpi.json
nano daemon/config/iqrf__IqrfUart.json
- Change mapping for your communication port of selected IQRF interface (line 57)
nano docker-compose.yml
- Start the gateway
docker-compose up -d
- Stop the gateway
docker-compose down
- Getting the tools for the testing
sudo apt-get install mosquitto-clients
wget https://github.com/vi/websocat/releases/download/v1.1.0/websocat_1.1.0_amd64.deb
sudo dpkg -i websocat_1.1.0_*.deb
sudo apt-get install -y jq
rm -f websocat_1.1.0_*.deb
- Getting the examples
git clone https://gitlab.iqrf.org/open-source/iqrf-gateway-daemon
cd iqrf-gateway-daemon/examples/bash
- Run the examples
./mqtt-generic-blink.sh
./websocket-generic-blink.sh