DHT temp sensor login issues

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
tdicola
 
Posts: 1074
Joined: Thu Oct 17, 2013 9:11 pm

Re: DHT temp sensor login issues

Post by tdicola »

Oh ibuki apologies, I mixed up the name of the package. It's the 'python3-pip' package and not 'python-pip3'. Confusingly once it's installed you'll use the 'pip3' command to run it... but the package is called 'python3-pip'. Sorry try again but with 'sudo apt-get install python3-pip'.

Thanks for grabbing the error message micolli9--hrm 'invalid_grant' isn't something I've seen, but the one thread I could find on it (here: https://github.com/google/oauth2client/issues/193) seems to indicate it could be a problem with an invalid or older credential file. Just to rule out the credentials being out of date, if you grab a new json file for credentials (from google's dev console) does it work? Oh and you're right you can ignore step 6--the spreadsheet example code will load the JSON file and get the credentials inside it. If you do the steps before that and download a new JSON file let's see if that helps get the spreadsheet authentication working. Thanks!

User avatar
isuga
 
Posts: 51
Joined: Thu Dec 11, 2014 8:09 pm

Re: DHT temp sensor login issues

Post by isuga »

It looks like "sudo apt-get install python3-pip" worked. Seemed to download and install package. No errors.

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  python3-dev python3-pkg-resources python3-setuptools
The following NEW packages will be installed:
  python3-dev python3-pip python3-pkg-resources python3-setuptools
0 upgraded, 4 newly installed, 0 to remove and 37 not upgraded.
Need to get 478 kB of archives.
After this operation, 1,510 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-dev all 3.2.3-6 [1,062 B]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-pkg-resources all 0.6.24-1 [33.9 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-setuptools all 0.6.24-1 [363 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python3-pip all 1.1-3 [79.7 kB]
Fetched 478 kB in 3s (157 kB/s)   
Selecting previously unselected package python3-dev.
(Reading database ... 79779 files and directories currently installed.)
Unpacking python3-dev (from .../python3-dev_3.2.3-6_all.deb) ...
Selecting previously unselected package python3-pkg-resources.
Unpacking python3-pkg-resources (from .../python3-pkg-resources_0.6.24-1_all.deb) ...
Selecting previously unselected package python3-setuptools.
Unpacking python3-setuptools (from .../python3-setuptools_0.6.24-1_all.deb) ...
Selecting previously unselected package python3-pip.
Unpacking python3-pip (from .../python3-pip_1.1-3_all.deb) ...
Processing triggers for man-db ...
Setting up python3-dev (3.2.3-6) ...
Setting up python3-pkg-resources (0.6.24-1) ...
Setting up python3-setuptools (0.6.24-1) ...
Setting up python3-pip (1.1-3) ...
However, when I tried "sudo pip3 install gspread", it says "sudo: pip3: command not found". Tried it after reboot and still got same message.

User avatar
isuga
 
Posts: 51
Joined: Thu Dec 11, 2014 8:09 pm

Re: DHT temp sensor login issues

Post by isuga »

I FINALLY got it to work.

I ended up installing Python 3.4.3 which wasn't as bad as I thought it would be. Oauth2client does not support Python 3.2 so you have to upgrade to 3.3 or higher if you want to use Python 3.

I used instruction on http://sowingseasons.com/blog/building- ... -pi-2.html to install Python 3.4.3.

Then I used "sudo pip3 install gspread oauth2client PyOpenSSL" to install everything into the Python 3 environment.

Then I found out that the strings are defined a little differently in Python 3 so I had to use the instructions on
http://stackoverflow.com/questions/2995 ... -for-oauth
to solve that little problem.

It now seems to work OK in my little test program.

I hope this works for people who are interested in doing this with Python 3. I will note that I had my test program working with Python 2 FIRST. And that took me some trial and error. So the steps above may depend on some things that I had already done to get it working for Python 2.

Addendum:
One last thing you have to do is :

sudo pip3 install RPi.GPIO

I have a project the monitors the temp for a freezer w/ temp sensitive supplies. It monitors the temp and a door sensor. It has an LCD display which shows me the temp status. And it e-mails/texts me w/ alerts for out of range temps or if the door is open for too long. It also logs the temps into Google Sheets.

And now.... it's all working again!

User avatar
tdicola
 
Posts: 1074
Joined: Thu Oct 17, 2013 9:11 pm

Re: DHT temp sensor login issues

Post by tdicola »

Oh nice, thanks for posting all the steps to work with python 3--that will definitely help folks in the future. Good luck with the project!

User avatar
foxfaisal
 
Posts: 8
Joined: Mon Dec 19, 2016 12:53 am

Re: DHT temp sensor login issues

Post by foxfaisal »

Good day ladies and gentlemen,

I am super duper newbie in here. I would like to start getting the OAuth2 credentials as instructed in the following page:
https://learn.adafruit.com/dht-humidity ... cs-updated

The page above redirect me to the following page:
http://gspread.readthedocs.io/en/latest/oauth2.html

I did step 1 until step 3 in the link above. I'm not sure whether what I did is correct or not, but but I already got the .json file. Please let me know if anyone here would like to check the content of the json file.

Step 4 in the link above is missing.

Step 5 told me to install oauth2client and PyOpenSSL using the following command:
pip install --upgrade oauth2client #install oauth2client
pip install PyOpenSSL # install PyOpenSSL

Step 6 says that "Now you can read this file, and use the data when constructing your credentials:". Now I have no idea what while does it refers to. Does anyone in here knows what file is it? Please advice.

Merry Christmas and happy holiday. Thank you.

then

User avatar
foxfaisal
 
Posts: 8
Joined: Mon Dec 19, 2016 12:53 am

Re: DHT temp sensor login issues

Post by foxfaisal »

Dear ladies and gentlemen,

Regarding my posing above, I would like to inform you that mine is works. My Pi 3 writes data to my google drive every 60 second. I am a beginner and don't know in detail some of the things that I did, but it works :-p

I have requirement to read and store data from more than 1 sensors, but so far I have no idea right now. Will go through the instructions in detail again, then inform all of you about my progress.

Thank you very much.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”