Problems with intermittent I2C operation using Unihiker and BME280

userHead Ralph.Yamamoto 2024-07-13 20:58:29 457 Views3 Replies

 

I am having a problem with intermittent operation using I2C on the Unihiker.  To try out I2C I used the 5-06-bme280.py example code from the /usr/local/lib/python3.7/dist-packages/pinpong/examples directory.  Sometimes it works for a while but it fails with an index out of range error from a function within the dfrobot_bme280.py library.  Most of the time it fails at start of execution with an “Analog map retrieval timed out” error.

  

These errors occur if I run from Mind+ or Jupyter Notebook and even directly from the Program menu on the Unihiker.

 

Am I running the correct firmware and software?

 

Here is a successful start of a run

Until it has the list index out of range error

(I had copied the code into “main.py” so the file name is incorrect).

2024-07-25 22:25:13

You can try adding exception handling statements.
 

userHeadPic LL
2024-07-14 09:22:04

Make sure you are using the correct I2C address for the BME280 sensor. Verify the address with an I2C scanner script.

userHeadPic lia.ifat
Ralph.Yamamoto wrote:

It is using the correct address (0x76) as it does work some of the time as you can see from my first post.  And I did verify it with a scanner.  One thing that I did notice is that the Linux i2c-tools utility doesn't seem to work as it shows lots of devices that I know are not present.

2024-07-14 13:23:14
1 Replies