Error in interfacing BME280 with Beaglebone black wireless

56 views
Skip to first unread message

rohan dhameliya

unread,
Nov 13, 2018, 1:24:31 PM11/13/18
to BeagleBoard
File "Adafruit_BME280_Example.py", line 3, in <module>
    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..

MG

unread,
Nov 13, 2018, 1:38:50 PM11/13/18
to BeagleBoard
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)

rohan dhameliya

unread,
Nov 13, 2018, 2:08:02 PM11/13/18
to beagl...@googlegroups.com
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?

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/rgI4CRwWA4Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/958042b0-c1ca-4b24-a179-48631198cd93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MG

unread,
Nov 13, 2018, 2:27:45 PM11/13/18
to BeagleBoard
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?

rohan dhameliya

unread,
Nov 13, 2018, 2:38:25 PM11/13/18
to beagl...@googlegroups.com
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.

MG

unread,
Nov 13, 2018, 2:54:25 PM11/13/18
to BeagleBoard
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:

Reply all
Reply to author
Forward
0 new messages