-
-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCD41 - No reading obtained 'Cannot set a value of None. Must be a float or string representing a float' #1132
Comments
Another issue I noticed about the SCD41 is that it doesn't show up when connected over a cable with 2-3m length. I have a the SCD30 connected over the same cable and works just fine. I encountered the same with the SHT31 which make me think it is a sensor limitation. I've searched far and wide for info on cable length limitation and cannot find anyhting and was wondering by the off chance if you might be able to shed some light on this? |
Hi. I had/ have the same issue as described above (with same error logs). I verified that my SCD41 sensor was working properly on another RPi. I "fixed" the issue by copying and pasting the input from the git repository and uploading it as a custom input (renamed it to "test_scd41). The only change I made was to add "measurements_select" to the options enabled list. It now works, but I don't know why. |
This is a huge relief that you got it working - I bought a whole bunch of these sensors that's just sitting around atm! Do you mind sharing the test_scd41 file? Not sure what you mean with 'input' and where to copy it from, else i'd try and do it myself. |
Doing this doesn't have any affect on how measurements are acquired. You're likely just associating something you changed at the same time it started working. |
This indicates there's an issue communicating with the sensor. |
That's what I thought but it is showing up in i2cdetect and like aaronarnold2 said, I also confirmed the sensor is working on another pi (not running Mycodo). I'm a bit stumped tbh... |
I just pushed a change that updates adafruit-circuitpython-scd4x from 1.2.1 to 1.2.2, which may fix issues with the library that communicates with the sensor. You will need to upgrade to master to test if the new code works. |
Thanks Kyle - I'll gave it a try but no joy. Daemon log as follows: `During handling of the above exception, another exception occurred: Traceback (most recent call last): |
See above. Additionally, I added measurements_select (as it should be included to allow disabling measurements), but like I said, has no affect on actually acquiring measurements. Your issue likely has nothing to do with Mycodo and is a result of your setup of the sensor, wiring, power supply, or operating system. |
You're also not providing the entire log since the daemon started and are excluding potentially informative error messages. |
That's because it just repeats: OSError: [Errno 121] Remote I/O error During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
"OSError: [Errno 121] Remote I/O error" is a different error than "ValueError: No I2C device at address: 0x62". Have you begin testing parts of your system for faults? wiring, power supply, operating system? |
Additionally, what does "Raspbian OS Version: Latest" mean? Can you provide better detail? |
Also, why did you put "dtparam=i2c_vc=on" in config.txt and not use raspi-config? That is not the line raspi-config adds to enable I2C. |
I currently have the sensor connected to a vanilla install of the latest raspbian (Raspbian Linux version 11 'bullseye) and mycodo (8.12.9). The SHT31D and SCD30 sensors both work when connected but not the SCD41. On this basis I assume that the the issue either sits with sensor connections or sensor libraries. I've checked and confirmed that it is correct and even used the breakout pins on the side of the sensor board to see if it might be the grove connection, but also no luck.
I did this to open the other i2c bus 0 (breakout pins 27 & 28) to be able to connect two i2c devices since the i2c multiplexer I bought is not working (or Im doing something wrong). I have successfully acquired measurements from both bus 0 & 1 with two sensors connected at the same time. I've also had a generic 12x8 LCD connected to bus 0 which worked fine for a while but would then stop working after a while. I can disable "dtparam=i2c_vc=on" and see if that works, however, the sensor is currently connected to i2c bus 1 and not 0? |
I would try to simplify your setup in order to get just this sensor working. This means disconnecting all other devices except for the single sensor. Reducing wire lengths as much as you can. Ensuring the power supply is sufficient to power the Pi and sensor. Using default settings such as enabling I2C from raspi-config. Once the sensor is working you can start making changes, one or few at a time, until you're back at your current configuration and you determine at what step along the way causes the issue with your sensor. |
I have two test setups running with the sensor connected on i2c bus 1 and detected by Mycodo (8.12.9) on 0x62. Both are vanilla installs, i.e new micro SD card, Raspbian Linux V.11 followed by sudo apt get upgrade and update commands. Both i2c and ssh is enabled. Then Mycodo is installed followed by the SCD41x dependency installation. The sensor is connected, detected but no reading obtained. I've repeated this on a Pi Zero 2 W and 3B+ models with the same error messages and outcomes. With both I am using the official raspberry pi power supply. With both setups I've use 20cm (7.87") jumper wires and which I have replaced with brand new ones a few times to make sure these are not the issue. I've tried connecting through the grove port and through the breakout on the side of the sensor - same results - sensor is detected but no reading obtained. All the above is leading me to believe that it is software related - but this is an uneducated guess really, I'm taking shots in the dark here - any other suggestions / potential root causes? |
Can you get measurements to be acquired with the adafruit-circuitpython-scd4x library outside Mycodo? Or any Python library, for that matter? |
I did manage to get it working outside of Mycodo in December, but cannot recall what I did/which tutorial I followed. Will try and recreate it over to weekend and confirm with all sensors (previously only tested 1). I only have basic working knowledge of these things and have to re-learn every time I pick it up again and with my two brain cells fighting over third place doesn't help matters either... |
I just noticed your log's error lines (#1132 (comment)) indicate you did not upgrade to master as I instructed (#1132 (comment)). You must upgrade to master to get the latest code. If not, you will assuredly keep getting the same errors. |
Hey Kyle - thank you so much for you patience and help - it is much appreciated! |
So I updated the Period and after activating the input again it couldn't reactivate and gave the following error message "Error: Altitude(m) is require to be set". A restart didn't fix it. Any idea why it is askinf for alititude? |
Altitude must be set to a value in order to activate the Input. Did you change or delete the value? |
No - I deactivated it so I could change the period and tried reactivating it but was met with that message. I didn't see a setting for altitude in the sensor configuration |
I had exactly the same problem Dropped this into shell Then rebooted. Things to note: I did have a SCD4x input before updating, but no alt or co2 calibration options available in UI. Install script doesn't pull the very latest sensor module. I suspect next release will have it baked in. It worked on reboot, with alt of 0, deactivated, and would not reactivate without putting alt in meters. Using both Adafruit SCD40 and SCD41 modules |
Describe the problem/bug
Installed SCD4x dependency and connected Seeed SCD41 Sensor. Sensor is detected but no reading is obtained.
Versions:
Reproducibility
This is done on a fresh install with dtparam=i2c_vc=on added in boot config.txt.
I have three of these sensors and have tried them all - same result.
Expected behavior
To obtain sensor readings
Screenshots
Additional context
The daemon log show the following error message:
2022-01-07 09:24:47,450 - ERROR - mycodo.inputs.scd4x_circuitpython_24681be8 - Cannot set a value of None. Must be a float or string representing a float. Check the sensor and Input module is working correctly. 2022-01-07 09:24:47,453 - ERROR - mycodo.inputs.scd4x_circuitpython_24681be8 - Cannot set a value of None. Must be a float or string representing a float. Check the sensor and Input module is working correctly. 2022-01-07 09:24:47,456 - ERROR - mycodo.inputs.scd4x_circuitpython_24681be8 - Cannot set a value of None. Must be a float or string representing a float. Check the sensor and Input module is working correctly. 2022-01-07 09:24:47,457 - ERROR - mycodo.inputs.scd4x_circuitpython_24681be8 - Cannot set a value of None. Must be a float or string representing a float. Check the sensor and Input module is working correctly. 2022-01-07 09:24:47,457 - ERROR - mycodo.inputs.scd4x_circuitpython_24681be8 - Cannot set a value of None. Must be a float or string representing a float. Check the sensor and Input module is working correctly. 2022-01-07 09:24:47,668 - ERROR - mycodo.inputs.sht31d_circuitpython_e269eaca - Input not set up 2022-01-07 09:24:47,759 - ERROR - mycodo.inputs.scd30_b462b47a - InputModule.get_measurement() method raised IOError: [Errno 121] Remote I/O error
I think it might be something to do with the dependencies/library of the SCD41. For ease of reference, the adruino i2c scd4x library can be found here and the adruino core dependency can be found here. Both these links are given on the sensor product page (link posted above).
The text was updated successfully, but these errors were encountered: