ComDeX Wiki

Version 0.2.6

ComDeX Demystified: A Complete Guide to Harnessing its Potential

Installation

ComDeX Installation Guide

This guide will walk you through the steps to set up and run the ComDeX prototype on your local system. ComDeX is implemented in Python, but can easily be adapted to other languages.

Requirements

  1. Python environment
  2. MQTT broker that supports message persistence and MQTT bridges creation

For the Action Handler, you’ll need the following Python libraries:

  • paho-mqtt==1.6.1
  • Shapely==1.8.1

These dependencies are listed in the requirements.txt file for convenience.

Installation Steps

  1. Install the required Python libraries using pip:
pip install -r requirements.txt
  1. Once the installation is complete, you can view the available command-line arguments and their usage by executing:
python3 action_handler.py -h

Note

For complex setups with federations of ComDeX nodes, please refer to the demo and configuration sections of this wiki.

Sanity Check

After setting up your environment, it’s a good idea to run a quick sanity check.

Here’s an example of how to do it:

In the same folder as “actionhandler.py”, create an entity example file, “entity_example.ngsild”, and a subscription file, “subscription_example.ngsild”. The contents for these files are provided in the repo.

Then, create an entity and a subscription. You can do this in any order (either publish the entity before or after the subscription). Replace localhost and 1026 with the appropriate address and port of your MQTT broker:

sudo python3 actionhandler.py -c POST/Subscriptions -f subscription_example.ngsild -b localhost -p 1026
sudo python3 actionhandler.py -c POST/entities -f entity_example.ngsild -b localhost -p 1026

You should be able to see the subscribed attributes printed/returned at your terminal.

Finally, you can also try “getting” the published entity, using the following command:

sudo python3 actionhandler.py -c GET/entities/?id=urn:ngsi-ld:GtfsAgency:Malaga_EMT -b localhost -p 1026

Happy experimentation!

Last updated on 8 Jun 2023
Published on 8 Jun 2023