i2c si702x raspberry pi b version 1

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Post Reply
wormiedk
Posts: 15
Joined: Wednesday 18 May 2016 5:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

i2c si702x raspberry pi b version 1

Post by wormiedk »

Hi

I have a si7021 connected to my raspberry pi b version 1. On version 1 i2c devices are at /dev/i2c-0 instead of dev/i2c-1.

When i add my i2c sensor to domoticz i get:
2016-05-21 09:12:59.153 Error: HTU21D: Error writing I2C!...
2016-05-21 09:12:59.153 Error: HTU21D: Error reading temperature!...

However if I access the sensor using python AND bus=0 I can get a temperature/humidity reading:
pi@raspberrypi:~$ sudo python i2c.py
Temp: 22.7344335938 C
Humid: 51.0087149658 % rH
pi@raspberrypi:~$

I am pretty sure the problem is with the bus parameter. Is there anywhere i can change it? I have attached the python files I use in which I had to change
self.dev = i2c_base.i2c(HTU21D_ADDR, 1) # HTU21D 0x40, bus 1
to
self.dev = i2c_base.i2c(HTU21D_ADDR, 0) # HTU21D 0x40, bus 0

cheers

David
Attachments
i2c.zip
(1.49 KiB) Downloaded 111 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest