Setup Development Environment

  1. Follow the steps described in Execution with Python to make the Collectu Core locally accessible.

  2. We recommend that you use a version control system such as GitHub, GitLab, or Bitbucket to manage your custom modules. If so, create the repository and add it to collectu by navigating to:

    cd collectu-core/src/modules

    and then add your repository as a submodule by running:

    git submodule add https://github.com/my_repo.git

    If you are not using a version control system, just create a new folder in collectu-core/src/modules.

  3. All modules in your custom module folder have to be located in one of the directories: inputs, outputs, or processors.

    The folder structure will look something like this:

    collectu-core/src/modules/            # The modules folder from collectu-core.
    │
    └── my_modules/                       # The folder for your modules.
        │
        ├── ...                           # Optional files like gitignore or readme.
        │
        ├── inputs/                       # Directory for input modules.
        │   │
        │   ├── __init__.py               # Initialization file.
        │   │
        │   └── topic/                    # A directory for grouping modules e.g. mqtt.
        │       ├── __init__.py
        │       └── my_first_module_1.py  # A module.
        │
        ├── outputs/                      # Directory for output modules.
        │   │
        │   ├── __init__.py
        │   │
        │   └── topic/
        │       ├── __init__.py
        │       └── my_second_module_1.py
        │
        └── processors/                   # Directory for processing modules.
            │
            ├── __init__.py
            │
            └── topic/
                ├── __init__.py
                └── my_third_module_1.py
  4. Add the name of the newly created folder containing your modules to the settings.ini file, e.g. custom_module_folder=my_modules.

  5. Now you can start creating your own modules and versioning them using your own git repository.

    If you want to synchronise them with Collectu Hub, use:

    python src/main.py --send_modules

    to send them (only modules in your custom modules folder will be sent) and

    python src/main.py --update_modules

    to download them (all modules will be updated).

    If you want to download modules, which do not exist locally, execute:

    python src/main.py --download_modules all

    Warning
    The __version__ is automatically set by Collectu Hub!
    Info
    If you want to update the module versions of existing configurations, open the configuration on the Collectu Hub and click on the following button: