part1: error "raise valueerror(f"unkown property {name}")" on RaspberryPi 3 model B v1.2 to connect a sensor DHT11 not solved

 Currently my RPi has python 2.7.13, and I want to upgrade it to python 3.5 version.

The way how I'm connecting the DHT11


I've trying to receive data from a sensor DHT11 but for some reason
I can't to find the way to make it works. 
Even thought I'll share what I've trying and maybe it will help me
in the future to find the way. 

I've following two sources to connect it and download the code.

1-https://www.ioteca.com.ar/raspberry-pi/35/sensor-de-temperatura-y-humedad-dht11-con-rasperry-pi/
2-https://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/

Following those sources everything worked well except for this error: 

The main error at the moment to execute the code was: 

raise valueerror(f"unkown property {name}").
Since that error I thought it was the version of python was old.
Because I was using python2.7.13. 
Then to know which version just use the command in a cmd console
python --version.

I'm following these steps to upgrade python:
use the command apt list –installed but here there is a mistake, it should be apt list --installed. 
And then use the next commands
sudo apt-get clean
sudo apt-get autoremove --purge
sudo apt-get remove python2.7
sudo apt-get autoremove
And then if i use the command python --version I should not see
any files belong to python.
Ensure system is up to date and then use sudo apt update

And then install the dependencies needed for building the distribution:

  • build-essential: To install use sudo apt install build-essential and to check if it was installed use the command gcc --version and you will something like this gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170616
  • tk-dev
  • libncurses5-dev
  • libncursesw5-dev
  • libreadline6-dev
  • libdb5.3-dev
  • libgdbm-dev
  • libsqlite3-dev
  • libssl-dev
  • libbz2-dev
  • libexpat1-dev
  • liblzma-dev
  • zlib1g-dev
  • libffi-dev
I'vAfter the dependencies the next steps are:
cd /tmp
wget https://www.python.org/ftp/python/3.7.16/Python-3.7.16.tgz
tar -xf Python-3.7.16.tgz
cd Python-3.7.16
./configure --enable-optimizations
make -j4  
sudo make altinstall
python3.5 --version to know which version the RPi has installed.
Once it was installed again I tried to run the code in the RPi
to connect the DHT11. 
Following these steps:

And tried these too:

Even trying those ways a got two errors:

-raspberry pi 2 driver
-raise valueerror(f"unkown property {name}").

In this first part just want to express my desire to make it works, hoping the next part will be better.

I don't find the way yet.


Today I've changing the resistor, trying different values: between 10k
and 4,8k. 
Additionally I've trying other way and I thought it gone works. I've 
following this video: https://www.youtube.com/watch?v=HfBRSASHqhA
To execute the python file to read the data from the sensor DHT11, it's
neccesary to use a command sudo python3 ./AdafruitDHT.py 11 17, the
last time I did not use the numbers 11 and 17 to indicate 11 as the DHT11
and 17 as the GPIO11 and pin17.
And it is not working, I've the feeling it is damage.  


Comentarios

Entradas populares de este blog

EasyEDA Primer diseño zumbador

Sistema de Riego con Raspberry Pi IoT