When I active the input I get the following error code in the log. I doesn’t look like something I misconfigured
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.7 from "/var/mycodo-root/env/bin/python"
* The NumPy version is: "1.20.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/var/mycodo-root/env/lib/python3.7/site-packages/numpy/core/__init__.py", line 22, in <module>
from . import multiarray
File "/var/mycodo-root/env/lib/python3.7/site-packages/numpy/core/multiarray.py", line 12, in <module>
from . import overrides
File "/var/mycodo-root/env/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 74, in run
self.initialize_variables()
File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 316, in initialize_variables
self.measure_input = input_loaded.InputModule(self.input_dev)
File "/home/pi/Mycodo/mycodo/inputs/grove_temp_humidity.py", line 113, in __init__
self.initialize_input()
File "/home/pi/Mycodo/mycodo/inputs/grove_temp_humidity.py", line 118, in initialize_input
import grovepi
File "/var/mycodo-root/env/lib/python3.7/site-packages/grovepi.py", line 50, in <module>
import numpy
File "/var/mycodo-root/env/lib/python3.7/site-packages/numpy/__init__.py", line 145, in <module>
from . import core
File "/var/mycodo-root/env/lib/python3.7/site-packages/numpy/core/__init__.py", line 48, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.7 from "/var/mycodo-root/env/bin/python"
* The NumPy version is: "1.20.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory
Im in a bit of a puzzle here. If I run this code I get readings in putty
import grovepi
import math
# Connect the Grove Temperature & Humidity Sensor Pro to digital port D3
# This example uses the blue colored sensor.
# SIG,NC,VCC,GND
sensor = 3 # The Sensor goes on digital port 3.
# temp_humidity_sensor_type
# Grove Base Kit comes with the blue sensor.
blue = 0 # The Blue colored sensor.
white = 1 # The White colored sensor.
while True:
try:
# This example uses the white colored sensor.
# The first parameter is the port, the second parameter is the type of sensor.
[temp,humidity] = grovepi.dht(sensor,white)
if math.isnan(temp) == False and math.isnan(humidity) == False:
print("temp = %.02f C humidity =%.02f%%"%(temp, humidity))
except IOError:
print ("Error")
But with the exact same code in mycodo I get nothing. I even hardcoded the parameters just to be sure
sensor = 3 # The Sensor goes on digital port 3.
white = 1 # The White colored sensor.
self.logger.info("Trying to read")
[self.temp_temperature,self.temp_humidity] = self.grovepi.dht(sensor,white)
if math.isnan(self.temp_temperature) == False and math.isnan(self.temp_humidity) == False:
self.logger.info("temp = %.02f C humidity =%.02f%%".format(self.temp_temperature, self.temp_humidity))
else:
self.logger.error(
"Error reading from DHT sensor: {} {}".format(self.temp_temperature, self.temp_humidity))
This is the log.
2021-04-27 16:19:14,116 - ERROR - mycodo.inputs.grove_temp_and_humidity_0_2c7d04e2 - Error reading from DHT sensor: nan nan
Someone have an idea why the same code wouldnt produce the same result when executed within mycodo?
I just made some further changes to the GrovePi DHT Input to simplify the code and add more log lines. Give it a try with Log Level: Debug enabled and check the Daemon Log.
2021-04-28 08:26:07,516 - INFO - mycodo.outputs.on_off_python_0c390613 - Initialized in 137.0 ms
2021-04-28 08:26:10,427 - INFO - mycodo.outputs.on_off_python_0c390613 - Temp: nan: Humid: nan: OFF
Running from putty
Btw. Its not a super critical bug, as I’m not using the DHT22 yet, so you can add to the backlog for later fix:)