[SOLVED] BME280 integration on Pi3b+ / ch2i / IMST-iC880a-SPI

Hi there – is there anyone out who can help me to activate the BME280 sensor, installed additionally on my ch2i board ? i have the option in balena configuration to set it to TRUE (as mentioned on several pages) but i have no idea how to see the values from the sensor. to be honest - i have no idea about coding by myself – i can read and understand some python, also i can copy and paste some lines of codes
i would be happy if there is anybody to give me a hand and do some step by step installation / activation with me ! Thanks a lot and a good, warm sunny day – greetings from Germany

Have a look at this Python library. https://github.com/kbrownlees/bme280/blob/master/bme280/bme280.py

My Docker/Balena.io setup handles that if you like logging to InfluxDB…

You can look at the code for other environments.

The python bit is here, I couldn’t find a library that was either correct or having appropriate license…

oky thanks – yes this integration is also used in our files for the gateway – i think its based on yours, on the newest one with the BME280 integration. i also activated the BME in the Device Servicevariables with BME280 True, SMBUS und Address, all based on our readme … also we are writing down into influxDB with via collectd – then there is a grafana visualisation. is there a possibillity for me to read “online” the values from the sensor ? i can connect through ssh onto my gateway using balenaCloud …

Yes you can…

With my library / environement:

mmmhhh i tried this regarding your advice / comands in the shell


this is the result where it stops

You probably have a problem the way you copied / imported the file if python complains about idents…


seems that this c&p was the reason ? or something else was wrong in the file i used before ? … well this is the result today:


what i did before:
1.) i copied your original bme280.py from your link above to my notepad++
2.) then i renamed my original bme280.py to _x_old_bme280.py
3.) afterwards i saved the new file from your git to my local gateway folder
4.) i did then all the commands to update my balena folder online
5.) restarted the gateway from balena cloud
6.) again i typed your commands to read the values online from the sensor !

THANKS MEN !!! its working !! :partying_face:

----- added 28th June 2019 — health of our local ttn gateway monitored in grafana
----- new values to read are Temperature, Humidity and Pressure


1 Like