Hi Scott,
Let’s get this thing done.
Step 1
Can you confirm you’re using this python script?
import grovepi
import math
# Connect the Grove Temperature & Humidity Sensor Pro to digital port D4
# This example uses the blue colored sensor.
# SIG,NC,VCC,GND
sensor = 4 # The Sensor goes on digital port 4.
# 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 blue colored sensor.
# The first parameter is the port, the second parameter is the type of sensor.
[temp,humidity] = grovepi.dht(sensor,blue)
if math.isnan(temp) == False and math.isnan(humidity) == False:
print("temp = %.02f C humidity =%.02f%%"%(temp, humidity))
except IOError:
print ("Error")
If you got the GrovePi base kit, than you’d be using the blue sensor
, so the script above is what you need.
Step 2
As you can see, in this example, we are using digital port 4
, so you also have to match the port onto the GrovePi.
Step 3
It would be great if you could provide us with some logs. There are 2 options depending on which OS image you’re using:
- Raspbian for Robots
- Raspbian Jessie (what the Raspberry releases)
If you got the first the 1.
option then things are simple.
You have to go onto the desktop, click the Test and Troubleshoot
and choose Troubleshoot GrovePi
. Next upload the log.txt
on the forums and we’ll give it a look.
You can also follow our youtube tutorial here.
If you got the second 2.
option then you have to go into Troubleshooting
directory and run the all_test.sh
shell script.
Use your terminal and cd
into your cloned directory (of the repository of GrovePi) and run the following commands:
cd Troubleshooting
sudo chmod +x all_tests.sh
sudo ./all_tests.sh
In the end, your log.txt
file we’ll be generated on the Pi’s Desktop. Upload it here.
Additional stuff
Would be awesome if you can share with us a picture with the sensor connected to the GrovePi. This way, we can see if there’s something not ok.