Looking for guidance: Addon for TFA Dostmann CO2 Monitor

I’m looking for someone who can help me write my first add-on for the Mozilla IoT gateway. My preferred programming language is NodeJS. I’m familiar with the Web of Things API. My questions will be mainly around gateway add-ons (e.g. how to test them on my laptop and Raspberry Pi) and reading the USB device (possibly requiring udev rules).

The device I’d like to support is the TFA Dostmann CO2 Monitor. It has a USB interface reporting a room temperature and Carbon dioxide level every 5 seconds.

Ideally, we could jump on a call for you to explain me add-ons or help to get the the USB interface working in NodeJS without the need to run scripts as root.
If someone in Berlin has the time for this, I’d be happy to meet up at c-base or Mozilla’s community space.

EDIT: I’m using the following NPM packages to learn how others communicate with the device.
https://www.npmjs.com/search?q=co2monitor

Here are some good resources:

In general, the easiest thing to do is to start from an existing add-on that somewhat matches your target device and modify it to suit your needs.

In this case, it might make sense to look at something like the serial-adapter or gpio-adapter.

1 Like

Thanks!
I got the basics going (no real error handling though).

How do I deal with USB permissions?
Currently I have to create a udev rule as root to be allowed to communicate with the USB CO2 Monitor.

As the Zigbee Adapter also relies on a USB connection (to the dongle), I’m reading through its code these days. It looks like they did not have the problem of missing permissions to read the device though.

On the Raspberry Pi image, we add the pi user to the dialout group, which gives it sufficient permissions to access Z-Wave/Zigbee dongles. Not sure if that’s the case with your device.