Community
cancel
Showing results for 
Search instead for 
Did you mean: 
DKara2
Novice
1,895 Views

BME280 i2cdetect

Hi,

Trying to detect bme280 sensor with i2cdetect and getting empty scan buffer. So i tried to detect other devices, to check if I have problem with i2c on Edison, and i get address of MPU-6050 and Arduino Uno without any problem, if i scan with i2cdetect. All devices were connected to i2c6, A4/A5 inputs.

Next step - check if bme280 sensor work. So I tried to connect it to Raspberry Pi and Arduino Uno and I get no error there. Bme280 works fine with these two devices.

Any idea why only Edison can not detect bme280?

0 Kudos
7 Replies
Pablo_M_Intel
Employee
138 Views

Hi dimo89,

Have you tried updating the mraa library? According to this thread /thread/80424 https://communities.intel.com/thread/80424, this has been solved by updating the library. There you can find the commands to update it.

echo "src mraa-upm http://iotdk.intel.com/repos/1.5/intelgalactic http://iotdk.intel.com/repos/1.5/intelgalactic"> /etc/opkg/mraa-upm.conf

opkg update

opkg install libmraa0

Regards,

Pablo

DKara2
Novice
138 Views

Yes, I tried different versions of mraa and libmraa0 and it did not solve problem

Pablo_M_Intel
Employee
138 Views

Hi dimo89,

Even if it's very unlikely, there might be a compatibility issue with the sensor, given that some other sensors are recognized on the Edison and that the sensor is recognized in other platforms. However, we can still try some things.

Could you tell me which Edison image you're using?

Also, how are configuring your Edison before attempting to use I2C? Could you please share your configuration?

You can also check this thread to see if the suggestion works for you, /thread/97970 https://communities.intel.com/thread/97970.

Regards,

Pablo

DKara2
Novice
138 Views

Right now I use 159.devkit.

 

I tried
  1. echo 28 > /sys/class/gpio/export
  2. echo 27 > /sys/class/gpio/export
  3. echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux
  4. echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

and I get same empty buffer.

Also I tried

  1. echo 28 > /sys/class/gpio/export
  2. echo 27 > /sys/class/gpio/export
  3. echo 204 > /sys/class/gpio/export
  4. echo 205 > /sys/class/gpio/export
  5. echo 236 > /sys/class/gpio/export
  6. echo 237 > /sys/class/gpio/export
  7. echo 14 > /sys/class/gpio/export
  8. echo 165 > /sys/class/gpio/export
  9. echo 212 > /sys/class/gpio/export
  10. echo 213 > /sys/class/gpio/export
  11. if [ ! -d /sys/class/gpio/gpio214 ]; then
  12. echo 214 > /sys/class/gpio/export
  13. fi
  14. echo high > /sys/class/gpio/gpio214/direction
  15. echo low > /sys/class/gpio/gpio204/direction
  16. echo low > /sys/class/gpio/gpio205/direction
  17. echo in > /sys/class/gpio/gpio14/direction
  18. echo in > /sys/class/gpio/gpio165/direction
  19. echo low > /sys/class/gpio/gpio236/direction
  20. echo low > /sys/class/gpio/gpio237/direction
  21. echo in > /sys/class/gpio/gpio212/direction
  22. echo in > /sys/class/gpio/gpio213/direction
  23. echo mode2 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux
  24. echo mode2 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

Any other ways to configure i2c?

Pablo_M_Intel
Employee
138 Views

Hi dimo89,

Could you try with the following image http://downloadmirror.intel.com/25028/eng/edison-image-ww25.5-15.zip http://downloadmirror.intel.com/25028/eng/edison-image-ww25.5-15.zip? This is the previous image to the one you're using. Some I2C issues tend to work better in this previous version, I would suggest you to start with that. Also, have you checked the Hardware Guide configuration? If not, you can see it below (there's a little change in relation to the one in the HG that was suggested by a user, you can see it on lines 15 and 16, I would suggest you to try both).

echo 28 > /sys/class/poi/export

echo 27 > /sys/class/poi/export

echo 204 > /sys/class/poi/export

echo 205 > /sys/class/poi/export

echo 236 > /sys/class/poi/export

echo 237 > /sys/class/poi/export

echo 14 > /sys/class/poi/export

echo 165 > /sys/class/poi/export

echo 212 > /sys/class/poi/export

echo 213 > /sys/class/poi/export

echo 214 > /sys/class/poi/export

echo low > /sys/class/poi/gpio214/direction

echo high > /sys/class/poi/gpio204/direction

echo high > /sys/class/poi/gpio205/direction

echo 0 > /sys/class/poi/gpio204/value

echo 0 > /sys/class/poi/gpio205/value

echo in > /sys/class/poi/gpio14/direction

echo in > /sys/class/poi/gpio165/direction

echo low > /sys/class/poi/gpio236/direction

echo low > /sys/class/poi/gpio237/direction

echo in > /sys/class/poi/gpio212/direction

echo in > /sys/class/poi/gpio213/direction

echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux

echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

echo high > /sys/class/gpio/gpio214/direction

Regards,

Pablo

Pablo_M_Intel
Employee
138 Views

Hi dimo89,

Were you able to test our suggestions? Did you have different results?

Regards,

Pablo

DKara2
Novice
138 Views

Hi Pablo,

I have finally managed to try 159 image (http://downloadmirror.intel.com/25028/eng/edison-image-ww25.5-15.zip http://downloadmirror.intel.com/25028/eng/edison-image-ww25.5-15.zip)

also configured hardware this way:

 

echo 28 > /sys/class/gpio/export

echo 27 > /sys/class/gpio/export

echo 204 > /sys/class/gpio/export

echo 205 > /sys/class/gpio/export

echo 236 > /sys/class/gpio/export

echo 237 > /sys/class/gpio/export

echo 14 > /sys/class/gpio/export

echo 165 > /sys/class/gpio/export

echo 212 > /sys/class/gpio/export

echo 213 > /sys/class/gpio/export

echo 214 > /sys/class/gpio/export

echo low > /sys/class/gpio/gpio214/direction

echo high > /sys/class/gpio/gpio204/direction

echo high > /sys/class/gpio/gpio205/direction

echo 0 > /sys/class/gpio/gpio204/direction

echo 0 > /sys/class/gpio/gpio205/direction

echo in > /sys/class/gpio/gpio14/direction

echo in > /sys/class/gpio/gpio165/direction

echo low > /sys/class/gpio/gpio236/direction

echo low > /sys/class/gpio/gpio237/direction

echo in > /sys/class/gpio/gpio212/direction

echo in > /sys/class/gpio/gpio213/direction

echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux

echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

echo high > /sys/class/gpio/gpio214/direction

and now i2cdetect can find my bme280 sensor.

So problem solved!

Thank you very much for your help!

Reply