Error using Temperature and Humidity sensor v1.2

Applications/questions using Raspberry Pi with Seeed products, please post it here.

Moderators: violet, jessie, yexiaobo

Post Reply
taha965
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Mon Jun 11, 2018 6:50 pm

Error using Temperature and Humidity sensor v1.2

Post by taha965 » Tue Jul 24, 2018 12:20 am

I am using a GrovePi+ on a raspberry pi zero W. I am trying to use the sampletest.py code included in the GrovePi library:
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

# Can enable debug output by uncommenting:
#import logging
#logging.basicConfig(level=logging.DEBUG)

import time
import SI1145

# Default constructor will pick a default I2C bus.
#
# For the Raspberry Pi this means you should hook up to the only exposed I2C bus
# from the main GPIO header and the library will figure out the bus number based
# on the Pi's revision.


sensor = SI1145.SI1145()

print('Press Cntrl + Z to stop')
print('')

while True:
vis = sensor.readVisible()
IR = sensor.readIR()
UV = sensor.readUV()
uvIndex = UV / 100.0
print('Vis: ' + str(vis))
print('IR: ' + str(IR))
print('UV Index: ' + str(uvIndex))
print('')
time.sleep(1)
However when i do i receive the following error:
Traceback (most recent call last):
File "simpletest.py", line 29, in <module>
import SI1145
File "/home/pi/Dexter/GrovePi/Software/Python/grove_i2c_sunlight_sensor/SI1145.py", line 154, in <module>
class SI1145(object):
File "/home/pi/Dexter/GrovePi/Software/Python/grove_i2c_sunlight_sensor/SI1145.py", line 155, in SI1145
def __init__(self, address=SI1145_ADDR, busnum=I2C.get_default_bus()):
File "/home/pi/Dexter/GrovePi/Software/Python/grove_i2c_sunlight_sensor/I2C.py", line 57, in get_default_bus
raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.

hong.jiang
Staff
Staff
Posts: 200
Joined: Tue Apr 17, 2018 11:03 am

Re: Error using Temperature and Humidity sensor v1.2

Post by hong.jiang » Tue Jul 24, 2018 10:03 am

Hi there, if you use the temperature & humidity sensor, please refer to http://wiki.seeedstudio.com/Grove-Tempe ... spberry-pi I see you use grove_i2c_sunlight_sensor code for the temperature and humidity sensor. thanks.

Seeed techsupport team
Bill

taha965
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Mon Jun 11, 2018 6:50 pm

Re: Error using Temperature and Humidity sensor v1.2

Post by taha965 » Tue Jul 24, 2018 4:05 pm

My apologies, I'm having an error with the sunlight sensor v1.0, the above code was used with this sensor and the error message above was received.

hong.jiang
Staff
Staff
Posts: 200
Joined: Tue Apr 17, 2018 11:03 am

Re: Error using Temperature and Humidity sensor v1.2

Post by hong.jiang » Wed Jul 25, 2018 10:30 am

Hi there, i do not have the sunlight on hand. I applied one and it will arrive around this Friday. I will test it when it is arrived and keep you posted. thanks.

Seeed techsupport team
Bill

taha965
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Mon Jun 11, 2018 6:50 pm

Re: Error using Temperature and Humidity sensor v1.2

Post by taha965 » Wed Jul 25, 2018 4:31 pm

Thanks

taha965
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Mon Jun 11, 2018 6:50 pm

Re: Error using Temperature and Humidity sensor v1.2

Post by taha965 » Mon Jul 30, 2018 4:25 pm

Any updates on the sensor?

bill.yu
Elementary-2
Elementary-2
Posts: 296
Joined: Mon Apr 02, 2018 11:05 am

Re: Error using Temperature and Humidity sensor v1.2

Post by bill.yu » Tue Jul 31, 2018 11:52 am

Hi there,

I got the sensor yesterday and final get it work. I used the latest raspberry image(2018.6.27). then i run below command to install grovepi.

sudo curl -kL dexterindustries.com/update_grovepi | bash
sudo reboot

at last, i run below commands and it is the output. thanks.

pi@raspberrypi:~/GrovePi/Software/Python/grove_i2c_sunlight_sensor $ python simpletest.py
Press Cntrl + Z to stop

Vis: 263
IR: 297
UV Index: 0.03

Vis: 263
IR: 297
UV Index: 0.03

Vis: 263
IR: 297
UV Index: 0.03

Bill

taha965
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Mon Jun 11, 2018 6:50 pm

Re: Error using Temperature and Humidity sensor v1.2

Post by taha965 » Tue Jul 31, 2018 6:51 pm

Thanks that worked!

Post Reply