File “Adafruit_BME280_Example.py”, line 3, in
sensor = BME280(t_mode=BME280_OSAMPLE_8, p_mode=BME280_OSAMPLE_8, h_mode=BME280_OSAMPLE_8)
File “/var/lib/cloud9/Adafruit_Python_BME280/Adafruit_BME280.py”, line 136, in init
self._load_calibration()
File “/var/lib/cloud9/Adafruit_Python_BME280/Adafruit_BME280.py”, line 147, in _load_calibration
self.dig_T1 = self._device.readU16LE(BME280_REGISTER_DIG_T1)
File “/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg/Adafruit_GPIO/I2C.py”, line 187, in readU16LE
return self.readU16(register, little_endian=True)
File “/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg/Adafruit_GPIO/I2C.py”, line 166, in readU16
result = self._bus.read_word_data(self._address,register) & 0xFFFF
File “/usr/local/lib/python2.7/dist-packages/Adafruit_PureIO-0.2.3-py2.7.egg/Adafruit_PureIO/smbus.py”, line 187, in read_word_data
ioctl(self._device.fileno(), I2C_RDWR, request)
IOError: [Errno 16] Device or resource busy
i getting this error try to find option but not working please help me…
and it worked no issue. Can u confirm which I2C line you are connected to? run i2cdetect -l to get enabled i2c lines and i2cdetect -y -r <i2c_number> to get of list of device addresses. I think mine was on 0x76 i2c-2. check for yours and make sure it is not showing as “U” which would explain why you are getting resources busy (either that or your device is not connected properly)
Clone the following into your BB and change the values in there accordingly (which i2c line, which device address…) and compile it and run it from user space: