This repository installs a tooling environment for qbus and mqtt. Following softwares are installed in docker containers.
The environment is tested on following systems:
dpkg --print-architecture
Preferred installation location is your user home directory. If not you'll need to change some commands below!
ssh 'your user'@'your ipaddress'
Install git if not already done
sudo apt-get install git
cd ~/
git clone https://github.com/wk275/qbTools-v2/
tar -xzf ./qbTools-v2/qbTools_2023-10-26_14-01-39-git.tar.gz
cd ~/qbTools-v2
FROM ubuntu:latest
ARG GW2USE=x64
ARG TZ="Europe/Brussels"
ENV IP=""
ENV PORT=""
ENV MQTT_USER=""
ENV MQTT_PASSWORD=""
ENV UID=1000
ENV GID=1000
RUN apt-get update -y \
&& apt-get install -y tftp \
&& apt-get install -y git \
&& apt-get install -y unzip \
&& git clone https://github.com/QbusKoen/qbusMqtt \
&& cd /qbusMqtt/qbusMqtt/qbusMqttGw \
&& tar -xf "qbusMqttGw-${GW2USE}.tar" \
&& cd / \
&& mkdir /usr/bin/qbus \
&& mkdir /opt/qbus \
&& mkdir /log \
&& chmod 777 /usr/bin/qbus \
&& chmod 777 /opt/qbus \
&& chmod 777 /log \
&& cp -R qbusMqtt/qbusMqtt/fw/ /opt/qbus/ \
&& cp qbusMqtt/qbusMqtt/puttftp /opt/qbus/ \
&& cp qbusMqtt/qbusMqtt/qbusMqttGw/qbusMqttGw /usr/bin/qbus/ \
&& chmod +x /usr/bin/qbus/qbusMqttGw \
&& chmod +x /opt/qbus/puttftp
RUN apt-get update && \
apt-get install -yq tzdata && \
ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
USER ${UID}:${GID}
CMD /usr/bin/qbus/./qbusMqttGw -serial="QBUSMQTTGW" -logbuflevel -1 -logtostderr true -storagedir /opt/qbus -mqttbroker "tcp://${IP}:${PORT}" -mqttuser ${MQTT_USER} -mqttpassword ${MQTT_PASSWORD} > /log/qbusmqtt.log 2>&1
cd ~/qbTools-v2
FROM ubuntu:latest
ARG GW2USE=arm
ARG TZ="Europe/Brussels"
ENV IP=""
ENV PORT=""
ENV MQTT_USER=""
ENV MQTT_PASSWORD=""
ENV UID=1000
ENV GID=1000
RUN dpkg --add-architecture armhf \
&& apt-get update -y \
&& apt-get install libc6:armhf -y \
&& apt-get install libdbus-1-3:armhf -y \
&& apt-get install libstdc++6:armhf -y \
&& apt-get install libcrypt1:armhf -y
RUN apt-get update -y \
&& apt-get install -y tftp-hpa \
&& apt-get install -y git \
&& apt-get install -y unzip \
&& git clone https://github.com/QbusKoen/qbusMqtt \
&& cd /qbusMqtt/qbusMqtt/qbusMqttGw \
&& tar -xf "qbusMqttGw-${GW2USE}.tar" \
&& cd / \
&& mkdir /usr/bin/qbus \
&& mkdir /opt/qbus \
&& mkdir /log \
&& chmod 777 /usr/bin/qbus \
&& chmod 777 /opt/qbus \
&& chmod 777 /log \
&& cp -R qbusMqtt/qbusMqtt/fw/ /opt/qbus/ \
&& cp qbusMqtt/qbusMqtt/puttftp /opt/qbus/ \
&& cp qbusMqtt/qbusMqtt/qbusMqttGw/qbusMqttGw /usr/bin/qbus/ \
&& chmod +x /usr/bin/qbus/qbusMqttGw \
&& chmod +x /opt/qbus/puttftp
RUN apt-get update && \
apt-get install -yq tzdata && \
ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
USER ${UID}:${GID}
CMD /usr/bin/qbus/./qbusMqttGw -serial="QBUSMQTTGW" -logbuflevel -1 -logtostderr true -storagedir /opt/qbus -mqttbroker "tcp://${IP}:${PORT}" -mqttuser ${MQTT_USER} -mqttpassword ${MQTT_PASSWORD} > /log/qbusmqtt.log 2>&1
cd ~/qbTools-v2
./setenv.sh
cd ~/qbTools-v2
docker compose up -d
docker ps -a
I noticed that on some systems there is a dash instead of a space between docker and compose. Seams that "docker-compose is V1 and "docker compose" is V2. For more information on how to resolve this see
https://stackoverflow.com/questions/66514436/difference-between-docker-compose-and-docker-compose
If you start qbTools docker containers for the first time all software images will be downloaded and qbusmqtt will be build. This can take some time. Subsequent starts will be a lot quicker.
All container names are suffixed by your container suffix
Please check if they are stable.
docker ps -a
cd ~/qbTools-v2
docker compose rm --stop --force
docker ps -a
All links between the software containers are already configured.
install mqtt explorer software http://mqtt-explorer.com/
start a 'mqtt explorer' session with following parameters
url: http://"your ip address":x1880
cd ~/qbTools-v2
docker compose rm --stop --force
docker system prune -a
## this will delete all docker images, networks and volumes. Not only the qbtool-v2 ones!
## Images, networks, etc will be restored after restarting your containers
cd ..
sudo rm -rf ./qbTools-v2
Simply copy the qbTools-v2 directory to a different name.
cd ~/
for container in `docker ps -a | awk -F' ' '{ print $NF }'|grep -v NAMES`; do
docker pause $container
done
cp -pr ~/qbTools-v2 ~/qbTools-v2_backup
for container in `docker ps -a | awk -F' ' '{ print $NF }'|grep -v NAMES`; do
docker unpause $container
done
cd ~/
for container in `docker ps -a | awk -F' ' '{ print $NF }'|grep -v NAMES`; do
docker pause $container
done
cp -pr ./qbTools-v2 ./qbTools-V2_copy
for container in `docker ps -a | awk -F' ' '{ print $NF }'|grep -v NAMES`; do
docker unpause $container
done
cd ./qbTools-V2_copy ./setenv.sh docker compose up -d docker ps -a