No temperature conversion?


I am a veteran firmware engineer, but a total newbie in this IoT world and pretty much a newbie to Python coding.


I have a Onion Omega2+ plugged into a CE PR32-3, thence into a MCP23008 / PEIO4R4G5LE.

Using a simply Python script, I was controlling the relays quickly.  So far, so good.


Then I plugged in the SI7020-A20.  The power LED lights up, but I have not been able to get a valid humidity or temperature reading out of it.

Sample code that I have found is for other control units other than the Onion, so the function calls are a bit different, but here is what I tried:



#!/usr/bin/env python
from OmegaExpansion import onionI2C
import time

i2c = onionI2C.OnionI2C()

i2c.write(0x40, [0xF5])

# this device has no addressable registers, so this readBytes() call is suspect, but there is no

data = i2c.readBytes(0x40, 0x00, 2)  
print "%x" %data[0]
print "%x" %data[1]


I get:



Conversion gives RH of -5.88%.  I've never heard of negative humidity!

I'm sure it's something really silly, but I have fiddled around a lot with the write(), writeBytes(), and readBytes() calls and not gotten anywhere.





i use this code with SI7005, they belong to same series. so give it a try and see if it works,

this is a python script for SI7020



Thank you for your suggestions.  However, the command sequences for the SI7005 are quite different than for the SI7020.

I started with the Control Everything python script, but it is for a different environment (not sure which board) and I have had no luck adapting it to the Onion Omega2+.