OpenMarine

Full Version: I2C bme280 set up problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been having a problem getting a BME280 to output data to signal K. I have recently updated my RPI 3B+ to a RPI 4. I am using the same I2C units as I had been previously, the only thing that changed was the RPI and the SD card image, I am now using the new image.

My previous setup was running the earlier OP2 image that I had updated the apps regularly. The bme280 mpu9250 and ads1115 were all working fine. The first set up of the RPI 4 with the new image saw that the mpu9250 calibrated in the Pypilot app nice and easy but the ads1115 and the bme280 did not pass data to signal K, the voltage columns from the ads1115 were displayed as null and the bme280 didn’t show up in the data browser at all. Installing both with the I2C app was easy and the unit addresses used were the same as in the previous setup. So was the SK 51000 port and I2C ID used.

Ok, so I took the I2C units and fitted them back to the RPI 3 board with the old image and they work. I replaced the wires connecting to the RPI4 and still ads1115 and the bme280 didn't show up after configuration, I could see their addresses (my BME280 modules are 0x76HEX) but no data and in the case of the bme280 no data or listing in the SK data browser.

I removed the I2C app and reinstalled it a couple of times but this didn't help. I have since installed the new image on another SD card and after setting up I was able to get the mpu9250 and ads1115 to work however I still cannot see the bme280 listing or data, the address is there in the I2C setup and every thing looks as it should. I have even removed the other I2C units and just tried a bme280 on its own and tried a spare that I know works on the other board. I swapped the wiring from the mpu and bme280 and the mpu still works fine.

So far the set up of the 1W, GPS serial and SDR-VHF for AIS have worked first time.

What am I missing with this I2C ?? (yes it is a bme280 not a bmp280 it will/does output temp pressure and humidity).

Thanks

Cheers Bruce.
Bruce, I'm not sure about the ADS1115 but I solved the BME280 problem.  See my post:

https://forum.openmarine.net/showthread....1#pid20441

The openplotterI2cRead.py app errors with the updated Adafruit BME280 library,  It may be causing the ADS1115 to error also.  Try opening a terminal and entering the openplotter-i2c-read command as shown in this post.  It may give you more information on the error.

https://forum.openmarine.net/showthread....7#pid20417

Hope this helps.
Jay
Smile
Thank you Jay your work around worked well and now I have the bme280 working, and the other units on the I2C are all good.

So Jay I will include some of your post here so others can see what i did,

"
So I figured out the problem with not getting BME280 sensor data into SignalK described in my previous posts.

It turns out Adafruit has updated their BME280 python library used in the openplotter i2c app to read sensor data. So new installs download the updated library which breaks the openplotte i2c read app.  The openplotterI2cRead app runs as a service, reads the sensor data and sends it to signalk.  The problem is that the library import in openplotterI2cRead.py is not compatible with the new library.   So the openplotter i2c app sets up the bme280 sensor correctly and configures signalk with a good connection but no data is sent to that connection by the openplotterI2cRead app.

So Sailoog needs to correct the BME280 library import call in a future release.   For those that are willing to hack the changes necessary to make it work here is what I did...

In the directory;
/usr/lib/python3/dist-packages/openplotterI2c
The file openplotterI2cRead.py needs to be edited. (sudo needed to edit file),

Change line 44 (in the BME280 section)
from:        
        import adafruit_bme280

to:
        from adafruit_bme280 import basic as adafruit_bme280

(be aware the from is preceeded by 2 tabs not spaces).

After saving these changes, either restart the openplotter-i2c-read.service or reboot.

That fixed the problem for me.   I hope this helps others.  
I'm not a coder so Sailoog will probably have a proper fix in a future release.  "

the screen shot is my file after the edit, and as normal good practice make a copy of the file before editing in case you make unintentional changes
(2021-09-17, 02:16 AM)Matilda Wrote: [ -> ]Smile
Thank you Jay your work around worked well and now I have the bme280 working, and the other units on the I2C are all good.

So Jay I will include some of your post here so others can see what i did,

"
So I figured out the problem with not getting BME280 sensor data into SignalK described in my previous posts.

It turns out Adafruit has updated their BME280 python library used in the openplotter i2c app to read sensor data. So new installs download the updated library which breaks the openplotte i2c read app.  The openplotterI2cRead app runs as a service, reads the sensor data and sends it to signalk.  The problem is that the library import in openplotterI2cRead.py is not compatible with the new library.   So the openplotter i2c app sets up the bme280 sensor correctly and configures signalk with a good connection but no data is sent to that connection by the openplotterI2cRead app.

So Sailoog needs to correct the BME280 library import call in a future release.   For those that are willing to hack the changes necessary to make it work here is what I did...

In the directory;
/usr/lib/python3/dist-packages/openplotterI2c
The file openplotterI2cRead.py needs to be edited. (sudo needed to edit file),

Change line 44 (in the BME280 section)
from:        
        import adafruit_bme280

to:
        from adafruit_bme280 import basic as adafruit_bme280

(be aware the from is preceeded by 2 tabs not spaces).

After saving these changes, either restart the openplotter-i2c-read.service or reboot.

That fixed the problem for me.   I hope this helps others.  
I'm not a coder so Sailoog will probably have a proper fix in a future release.  "

the screen shot is my file after the edit, and as normal good practice make a copy of the file before editing in case you make unintentional changes

Hello Matilda,
  I have this problem and am trying to get to the file to edit it. I am new to this and have no idea how to get there. Would you please enter the exact command I need to use so that I may copy and paste? Anyone's assistance would be greatly appreciated.

Jim
(2021-09-17, 02:16 AM)Matilda Wrote: [ -> ]Smile
Thank you Jay your work around worked well and now I have the bme280 working, and the other units on the I2C are all good.

So Jay I will include some of your post here so others can see what i did,

"
So I figured out the problem with not getting BME280 sensor data into SignalK described in my previous posts.

It turns out Adafruit has updated their BME280 python library used in the openplotter i2c app to read sensor data. So new installs download the updated library which breaks the openplotte i2c read app.  The openplotterI2cRead app runs as a service, reads the sensor data and sends it to signalk.  The problem is that the library import in openplotterI2cRead.py is not compatible with the new library.   So the openplotter i2c app sets up the bme280 sensor correctly and configures signalk with a good connection but no data is sent to that connection by the openplotterI2cRead app.

So Sailoog needs to correct the BME280 library import call in a future release.   For those that are willing to hack the changes necessary to make it work here is what I did...

In the directory;
/usr/lib/python3/dist-packages/openplotterI2c
The file openplotterI2cRead.py needs to be edited. (sudo needed to edit file),

Change line 44 (in the BME280 section)
from:        
        import adafruit_bme280

to:
        from adafruit_bme280 import basic as adafruit_bme280

(be aware the from is preceeded by 2 tabs not spaces).

After saving these changes, either restart the openplotter-i2c-read.service or reboot.

That fixed the problem for me.   I hope this helps others.  
I'm not a coder so Sailoog will probably have a proper fix in a future release.  "

the screen shot is my file after the edit, and as normal good practice make a copy of the file before editing in case you make unintentional changes

Matilda and all,
I was premature in my asking of the question. I did in fact figure out how to  edit the document. This did in fact fix the issue. I now have BME280 data on the server.

For anyone that might have a similar issue and are as "terminal-ly" challenged as I am here is the exact text to get to and edit said doc.

sudo nano /usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py

Thanks
Jim