The SWAP-IT Client Interface provides an MQTT interface for swap-it-server, which are build based on the swap-it-server-template. In this context, the client interface subscribes to the queue-variable, all capabilities, the server's state and in addition, to service events and publishes MQTT messages, which can be accessed by MQTT-Brocker. In general, this interfaces was developed to connect swap-server to the swap-it-visualization-tool
To map the resource information into the swap-it-visualization-tool, a JSON configuration for each resource must be provided to the client interface (see e.g., configs/demo_scenario.json5). Within this config, each resource is characterized by an application_name, the ip address and the corresponding port, as well as the service that is offered by the resource
{
shopfloor: [
{
application_name: "warehouse_dr",
resource_ip: "localhost",
port: "4081",
service_name:"GetPartsFromWarehouse"
}
]
}
The SWAP-IT Registry Module requires a locally installed version of the C-based OPC UA SDK open62541 (https://github.com/open62541/open62541) version 1.4.6, a locally installed version of the swap-it-open62541-server-template (https://github.com/FraunhoferIOSB/swap-it-open62541-server-template), as well as the MQTT-C library (https://github.com/LiamBindle/MQTT-C).
#open62541 version 1.4.6:
git clone https://github.com/open62541/open62541
cd open62541
git fetch --all --tags
git checkout tags/v1.4.6 -b v1.4.6-branch
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_NAMESPACE_ZERO=FULL -DUA_ENABLE_JSON_ENCODING=ON ..
make install
#swap-it-open62541-server template
RUN git clone https://github.com/FlorianDue/swap-it-open62541-server-template
cd swap-it-open62541-server-template
git checkout order_queue
mkdir buld && cd build
cmake ..
make install
#mqtt-c
git clone https://github.com/LiamBindle/MQTT-C.git
cd MQTT-C
mkdir build && cd build
cmake ..
make install
git clone https://github.com/FraunhoferIOSB/swap-it-client-interface.git
cd swap-it-client-interface
mkdir build && cd build
cmake ..
make
./client_interface
An extensive documentation for the SWAP-IT Client interface can be found here: https://fraunhoferiosb.github.io/swap-it-client-interface or build from the repository. Here, sphinx and the sphinx rtd theme are required. Both can be installed with:
pip install sphinx
pip install sphinx-rtd-theme
Build the documentation:
cd swap-it-client-interface
#html
sphinx-build -M html documentation/source/ documentation/build/html
#pdf
sphinx-build -b pdf documentation/source/ documentation/build/pdf/
Since the SWAP-IT Registry Module is part of the SWAP-IT Architecture, its application is linked to other SWAP-IT projects. Here are some other relevant repositories: