End-of-year event 2021

CoMatrix - Constrained Matrix
2021-12-27, 20:15–20:55 (Europe/Berlin), franconian.net
Language: English

We like to present our prototype implementation of the CoMatrix project, which enables the usage of the Matrix protocol for constrained IoT devices via CoAP and CBOR in a constrained network (e.g. an IEEE 802.15.4/6LoWPAN network). A CoMatrix gateway, which acts as a CoAP-HTTP forward proxy, was implemented based on the Python library aiocoap, and is running on a Raspberry Pi, which is extended with an 802.15.4 radio module. On the client side we use RIOT-OS on a SAMR21-xpro board and implemented an external CoMatrix library module based on gcoap and nanocoap. We like to share some experiences we made during the implementation and discuss some problems we faced (e.g. randomization and transport encryption). Further, we will demonstrate two IoT use case applications utilizing CoMatrix for communication. We will also provide an outlook in future work.


Matrix is an open source project that publishes the Matrix open standard for secure, decentralized, real-time communication. The architecture of the Matrix protocol is based on HTTP/REST/JSON/TLS and is therefore not suitable for constrained devices. CoMatrix provides a gateway, which ports Matrix to CoAP/CBOR/(DTLS). This gateway communicates with constrained IoT devices on one side via CoAP+CBOR and translates to the Matrix protocol, more specifically the Matrix Client-Server API, on the other side (i.e. HTTP+JSON). We also provide a CoMatrix client library (for RIOT-OS) which provides a starting point to implement CoAP clients (for constrained devices) which are able to interact with Matrix homeservers via the gateway.

As far as we know there were no practical implementations or use of Matrix on constrained IoT devices before CoMatrix. CoMatrix now provides the basis to integrate Matrix-based communications in your IoT project(s). It enables resource-sparing communications for devices where this is necessary (e.g. microcontrollers, SoCs), but it also enables reliable communications for non-constrained devices (i.e. PCs, servers, laptops, smartphones) via standard Matrix implementations.

Currently CoMatrix supports the following features:

  • Sending of messages to a Matrix room
  • Receiving of the last message of a Matrix room
  • User registration at a Matrix Synapse homeserver
  • Joining of a Matrix room upon invitation
  • Login of a user at a Matrix Synapse homeserver
  • Logout of a user at a Matrix Synapse homeserver

We will give a demo of two IoT use case applications: First the "CoMatrix chat" to show the current state of the client library functions. Then a temperature sensor application, which continuously sends temperature values into a Matrix room.


Further information:

See also: Slides

Tobias (Tobi) Buchberger is a researcher at the Competence Center for IT-Security and lecturer in the master's degree program "IT-Security" at FH Campus Wien (UAS Campus Vienna), where he also pursued his IT security studies. Before joining FH Campus Wien, he was working as an IT security analyst at a Viennese-based company for several years.

Ines Kramer is a researcher at the Competence Center for IT-Security at FH Campus Wien (UAS Campus Vienna).