arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.96k stars 4.77k forks source link

SCD41 sensor no longer works in 12.2.xx #17272

Closed s-weise closed 1 year ago

s-weise commented 1 year ago

PROBLEM DESCRIPTION

A clear and concise description of what the problem is. Hi,

the CO² sensor SCD41 no longer works under the Tasmota 12.2.0.0 (and 12.2.0.6). In the version 12.1.0.0 the sensor works normal. I use the Adafruit QT Py ESP32-C3 board with the SCD40, SGP30 and VINDRIKTNING sensor. A WS2812 LED is also used. I looked into the Tasmota libs for sensor control and i2c control but i can't find a change the explains this behavior.

Hope my informations can help you.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
- [x] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:

00:00:00.265 Script: nv=12, tv=0, vns=62, vmem=330, smem=8192
00:00:00.400 SHT: Sensor did not ACK command
00:00:00.446 I2C: SGP30 found at 0x58
00:00:01.406 I2C: Error 5 at 0x49
00:00:01.420 SCD40 force-stop error: 0
00:00:01.970 SCD40 reinit error: 0
00:00:01.992 SCD40 serial nr 0xXXXX 0xXXXX 0xXXXX
00:00:01.993 I2C: SCD40 found at 0x62
00:00:01.993 SCD40 found, measurements started.
00:00:05.018 SCD40: no data available.
00:00:05.762 SCD40: no data available.
00:00:07.203 SCD40: Update: ReadMeasurement error: 0x500, counter: 4
00:00:08.095 SCD40: (rd) in error state: 2, good: 0, no data: 3, sc30 reset: 0, i2c reset: 0
00:00:08.218 SCD40: not answering, sending soft reset, counter: 5
00:00:08.342 SCD40: resetting got error: 0x200
21:38:12.883 SCD40: (rst) in error state: 3, good: 0, no data: 3, sc30 reset: 1, i2c reset: 0
21:38:12.883 SCD40: clearing i2c bus
21:38:13.295 SCD40: no data available.

TO REPRODUCE

Steps to reproduce the behavior:

Connect SCD41 with QT Py ESP32-C3.

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.

Normal read out from the SCD41 sensor

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

sfromis commented 1 year ago

FWIW, I'm using SCD40 (not SCD41, but same driver) on Tasmota 12.2, no problems.

Jason2866 commented 1 year ago

Could be a i2c bus problem. Does the sensor work if you remove the other i2c sensors?

s-weise commented 1 year ago

Maybe. For testing I desoldered the pull-up resistors from the sensor board and now the sensor works when nothing else is connected. Does Tasmota activates the internal pull-up resistors on the I2C pins? It's strange that it worked on version 12.1.0.0.

Jason2866 commented 1 year ago

i2c is a bus. For a correct bus setup the last device (seen from wiring) should only be terminated with pull up resistors. Lower resistors are more resilent against "noise". The weak pull ups in esp does not count nor do any harm. Having pull ups on e every connected i2c device do most of the time work. But if power supply is weak you may run in trouble here. Imho thats your issue. How do you power the whole stuff? Are decoupling caps installed? On a border line hardware setup even the smallest change can brake a before working setup. How long are the i2c wires? Keep them as short as possible.