Interfacing balena edge devices with AdafruitIO

Please use the thread below to discuss the related blog post:

Hi Andrew, thanks for posting your project. I am developing a project using the Adafruit SCD-30, SGP30 using the SparkFun Qwiic SHIM, for temp, humidity and Co2 sensing.

Do you think your dockerfile with…

FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-python:3.9-bookworm as builder

RUN install_packages build-essential \
    python3-dev \
    python3-rpi.gpio

RUN python3 -m pip install --upgrade setuptools \
                                     adafruit-io \
                                     adafruit-circuitpython-neopixel \
                                     rpi_ws281x 

…would be enough to get them running? I am wanting to deploy them along with the Browser block and a touch screen to give a full environmental monitor.

1 Like

Hello @YouGenerateCIC ,

Thanks for checking the project out. I’m going to give a shout to @iayanpahwa , the project creator, to weigh in on your question. Hang tight as he’s out for today but will be back tomorrow.

Hi @YouGenerateCIC , I think you’ll also need to install python drivers for the modules scd30 using pip3 install adafruit-circuitpython-scd30 and for sgp30 using pip3 install adafruit-circuitpython-sgp30 .

You docker file should look like:

ROM balenalib/%%BALENA_MACHINE_NAME%%-debian-python:3.9-bookworm as builder

RUN install_packages build-essential \
    python3-dev \
    python3-rpi.gpio

RUN python3 -m pip install --upgrade setuptools \
                                     adafruit-io \
                                     adafruit-circuitpython-neopixel \
                                     rpi_ws281x \
                                    adafruit-circuitpython-scd30 \
                                    adafruit-circuitpython-sgp30

Let me know if this works :slight_smile:

1 Like

Thanks @iayanpahwa for your help. Unfortunately I am still getting back:

28.02.22 01:33:25 (+0000) sensor Device at 0x61 not in known supported drivers.

I did test with your suggested changes to the docker file but with no luck.

To make sure I could get something working I tried to follow the sensor block setup and got the bme680 working as below.

28.02.22 01:33:25 (+0000) sensor Loading device bme680-i2c (chip ID 97) on address 0x77.

My current sensor Dockerfile is

FROM balenablocks/sensor

WORKDIR /usr/src/app

COPY start.sh start.sh

CMD ["bash", "start.sh"]

Should I be able to copy in the RUN commands into the sensor block docker file as above to get the correct drivers?

e.g.

FROM balenablocks/sensor

ROM balenalib/%%BALENA_MACHINE_NAME%%-debian-python:3.9-bookworm as builder

RUN install_packages build-essential \
    python3-dev \
    python3-rpi.gpio

RUN python3 -m pip install --upgrade setuptools \
                                     adafruit-io \
                                     adafruit-circuitpython-neopixel \
                                     rpi_ws281x \
                                    adafruit-circuitpython-scd30 \
                                    adafruit-circuitpython-sgp30


WORKDIR /usr/src/app

COPY start.sh start.sh

CMD ["bash", "start.sh"]

Thanks

Hi @YouGenerateCIC , happy to know you were able to test with sensor-block and rule out the possibility of non-functional sensor module. As far as the dockerfile is concerned, you can only use one base image, feel free to take ideas from dockerfile of sensor block and try to create one with your packages but I won’t recommend modifying it right away as it uses custom start scripts which is not recommended to change for proper functionality.

Thanks how can I find someone to do this for me?

@YouGenerateCIC I’m not sure where you could find someone to do this for you but if you give it a shot I’m happy to help you through, working with docker is mostly a back and forth process, though I can recommend you try local mode and live push details here to speed up your development workflow :smiley:

1 Like

Thanks @iayanpahwa learning fast!