Error in interfacing BME280 with Beaglebone black wireless

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…

I just used BME280 with BB black with a c written example based on their drivers: https://github.com/BoschSensortec/BME280_driver

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)

debian@beaglebone:/var/lib/cloud9$ i2cdetect -y -r 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- UU UU UU UU – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – 77

i got this result what does it mean?

It means that if ur sensor is connected to i2c-2 then your address is prob 0x77. Are you sure you are using correct address?

so now how to use that C code which you provided in link.
sorry for trouble but i am very new to this things that’s why don’t know how to run.

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:

https://github.com/BoschSensortec/BME280_driver/blob/master/examples/linux_userspace.c