Problem with scd41 sensor (I2C) and onewire sensor (MPSSE) using pyftdi at the same time

64 Views Asked by At

I am struggling with the problem, that I'd like to address several sensors at once via I2C. I am currently using a FT232 breaker board and the pyftdi library. As an orientation I found a SCD41 library online and changed it so the communication would use only pyftdi on all sensors. It works quite fine so far if I only drive the I2C sensors.

Additionally I added an onewire sensor (DS18B20) that I drive with opening another pyftdi object to read GPIO - MPSSE Commands.

The only problem is that I run into an error every time I try to run both the scd and the onewire sensor. Its quite a tricky problem because every other sensor configuration works fine with the onewire communication but the scd41.

I always get the following error once I perform a single (read/write) command using the scd41 class:

"RuntimeError: Could not communicate via I2C, some commands/settings unavailable while in working mode"

Normally these two communications should be completly seperated from each other, but it seems to be linked somehow by the pyftdi library. Does anyone have an idea, what could be the problem here?

Things I tried already:

  • flushing the i2c controller after each use

  • Every other sensor class that uses the same way of communicating as the scd41 seems to work perfectly fine and in harmony with the onewire sensor. The problem occurs once i perform any read / write command of the scd sensor class.

0

There are 0 best solutions below