Can I use a BME280 sensor with OpenBK on a WB2S module over software I2C, and how do I configure the pins, address, and Home Assistant publishing?
Yes — OpenBK can drive a BME280 on a WB2S using the BMP280/BMPI2C software-I2C driver, and the later BMPI2C version adds temperature, pressure, and humidity support [#20862222][#21123022] Use the `startDriver` command with your GPIOs and channel numbers; examples from the thread were `startDriver BMP280 [CLK] [DATA] [TempChan] [PressureChan]` and later `startDriver BMPI2C [CLK] [DATA] [Temp] [Pressure] [Humidity] [Addr]` [#20862067][#21123022] A working BME280 setup on a WB2S used `P7` as SDA and `P8` as SCL, with the sensor address set to `0x76` [#21112840] For Home Assistant, you can use channel types like `Temp_div100` and `Pressure_div100`, or publish manually with `publishFloat`; MQTT still carries the raw integer value unless you apply the divider/publish logic yourself [#20862313][#21013338] One important caveat is that the BME280 temperature reading is the chip’s internal temperature, so it can read a few degrees high and may need an offset calibration if you want it to represent room temperature [#20862559][#20862569]
Hello and greetings to all. I am in the same case as my colleague bilbs84. The problem is that I am even newer to this and I have several WB2S modules, with OpenOBK installed and I want to integrate BME680 sensors and have these readings in Home Assistant. But no matter how much I have read on the internet, I don't see an easy way, for a beginner. Thanks again for your answers and greetings. P.S. Sorry for my English language, but I use a translator.
Thanks for answering. It is BME680, which has some more features than 280. I bought them on Aliexpress at a good price, with the intention of integrating it with an ESP32 in home assistant, but since I have several CB2S with OpenBK, I wanted to see if it is possible. Here is a photo with the tests and Aliexpress link. Greetings!
Why did you take off the BMP280 driver code from current releases of OBK? I think it worked rather well for me. And I started trying to use it on my OpenBK7231N. =(
to obk_config.h .
Alternatively, I can do the same for you, here:
https://github.com/openshwprojects/OpenBK7231T_App/pull/1064 Once it builds, you can click into build results, scroll down to "Summary" and click "Download artifacts" to get a binary file with BMP280 support
Hello, Can this BME280 controller also be enabled in BL602? I would like to use the rx and tx pins for this (i2c to the sensor), I do not use them in "normal" mode. Is this even possible? And do you have to compile it yourself or is this driver included in normal builds?
I forked the project, changed "#define ENABLE_DRIVER_BMP280 1" to "#define ENABLE_DRIVER_BMP280 1" in the obk_config.h file. It compiles without errors (this compiling function on GitHub is amazing, I wonder who pays for it...), I uploaded it to magichome with BL602.: In the webapp I enter: "startDriver BMP280 0 1 1 2" (I`m not sure about the pins, but this is a later issue)
Quote:
Info:MAIN river BMP280 is not known in this build. Info:MAIN:Available drivers: Info:MAIN:NTP Info:MAIN:, RN8209 Info:MAIN:, BL0942 Info:MAIN:, BL0937 Info:MAIN:, CSE7766 Info:MAIN:, DDP Info:MAIN:, SSDP Info:MAIN:, DGR Info:MAIN:, Wemo Info:MAIN:, SM2135 Info:MAIN:, BP5758D Info:MAIN:, BP1658CJ Info:MAIN:, SM2235 Info:CMD:[WebApp Cmd `startDriver BMP280 0 1 1 2` Result] OK
... looks like there is no driver.
Second attempt: I looked at the obk_config.h file: there is its own part for BL602, so I added the driver there:
It seems that the "#define ENABLE_DRIVER_BMP280 1" option is ignored when building the binary for BL602.... Should the driver start like this? "startDriver BMP280 xx 1 2"?
This is strange, maybe something is missing. BL602 is rare and I`m only one person and it`s hard to understand such a large open source project. Then I`ll try it myself, here`s my PR: https://github.com/openshwprojects/OpenBK7231T_App/pull/1133 It`s compiling now, in fifteen minutes I`ll check whether the compilation was successful or not. You may need to add something to the Makefile.
Additionally, I would also be a bit afraid that the BMP280 would exceed the size of the OTA on the BL602 and there would be a problem with the update, but we`ll see.
it 100% does not work on BL602, because the above PR is me who turned on BMP280 on the BK7231 platform. BK7231 is a separate platform. You have to look in obk_config.h for which platform you are enabling, because we support 5 platforms already (BK7231 two versions, W600, W800, BL602, XR809, LN882H and Windows... oh, that`s more than 5)
There is apparently no problem with the build, it also works, after the update I have a new build number (Build: Build on Mar 20 2024 08:40:07 version bl602-bmp_0204362d2fcd)
But when I type "startDriver BMP280 0 1 1 2" in the Logs section in the new webapp, I get:
Quote:
Info:MAIN :Driver BMP280 is not known in this build. Info:MAIN:Available drivers: Info:MAIN:NTP Info:MAIN:, RN8209 Info:MAIN:, BL0942 Info:MAIN:, BL0937 Info:MAIN:, CSE7766 Info:MAIN:, DDP Info:MAIN:, SSDP Info:MAIN:, DGR Info:MAIN:, Wemo Info:MAIN:, SM2135 Info:MAIN:, BP5758D Info:MAIN:, BP1658CJ Info:MAIN:, SM2235 Info:CMD:[WebApp Cmd `startDriver BMP280 0 1 1 2` Result] OK
But really, it's not that important, it's more of a gimmickry, so there's no point in wasting your precious time on it.
After update: Oh, I see. then this driver simply does not exist for bl602. At least everything is clear now
do you know what pins are rx and tx on bl602? I started looking for it, but I think I`ll miss it... oh, and one more thing: when using bme280 I have "info:SENSOR:BMx280 wrong ID!" but I read that the controller itself looks for the appropriate ID, so it`s just a matter of finding the right pins?
OK: Update, I found the pins, (on bl602: p16 - scl; p7 -sda) everything works, great! what bmE280 still lacks is humidity. When I have some time, I`ll try to look at the code myself.
Added after 2 [hours] 1 [minutes]:
One more thing:
How to change the measurement frequency? for now it measures (and sends via mqtt) every second...
Sorry. I didn`t get a notification after editing. You wrote earlier that it doesn`t publish on MQTT, but does it work? From what I can see, the measurement is actually made every second, to limit this I can add a few lines on the spot and give you a PR with it to download the ready binaries.
No problem. MQTT works. I just had to learn how openbk works. What is not optimal is: I set Temperature to channel 6 and pressure to channel 7. In channel types I set Temp_div100 to 6 and Pressure_div100 to 7 and the data format also matches on the web page. MQTT ignores this /100 - i.e. data enters "raw" via mqtt - e.g. 2660 instead of 26.60. But this is a detail - I can also do division by 100 on openhab.
As for the bmp280 driver. If it was possible to change/add "startDriver BMP280 [CLK] [DATA] [ChannelForTemp] [ChannelForPressure]" with an additional field for the measurement frequency - e.g. "[measurementInterval] " in seconds, it would be perfect. hard-coded is also possible, I think it will be enough if it measures every 5 minutes, it makes a lot of noise every second....
There is a flag on the divider. It`s all because of the TuyaMCU standard that we based on at the beginning. Turn on:
I`m wondering whether I should try to add some universal solution, maybe, for example, it would be possible to change the driver tick period, which is now one second
Ah, great. Thank you for the tip from there flag33.
As for the driver tick. I just think it can`t be a global mindset. In my project it would be indifferent, but if you want to measure current and temperature, for example, different distances are needed...
Does anyone know if this should work with the BMP280 PR? I couldn't get an i2c result in soft scan previously and wondered if that was because of the two sensors. Also, does OBK have an AHT20 driver? I tried all the others but no results.
Both sensors work in Tasmota so the module itself is operational.
So I'm not sure where the 0x58 ID for BME/BMP280 came from but the consensus Googling around is that the BME/BMP280 and BME680 are mostly 0x77.
My BMP280/AHT20 module is 0x77 and so is the BME680 I have.
The AHT20 on my combined module is actually not operational - no detection of second address in Tasmota or OBK scan, but Tasmota BMP280 driver does work. I also bought a standalone BMP280 but it's DOA.
I've tried this PR but I'm still getting wrong ID reported. ;/
I've been playing with the BMP280 driver. I've added something to output the detected ID to help with troubleshooting. I also added BME680 chip ID for detection only. The driver itself needs more work to function on BME680 properly.
✨ The discussion focuses on integrating BME280 sensors with OpenBK firmware on WB2S modules for home automation, specifically for temperature, pressure, and humidity measurements. Initial efforts involved porting a BMP280 driver to OpenBK, with adaptations for BME280 compatibility, including chip ID detection (0x60 for BME280 vs. 0x58 for BMP280) and configurable I2C pins and addresses (0x76 or 0x77). The driver supports software-defined I2C and channels for temperature, pressure, and humidity, with MQTT integration for Home Assistant. Users addressed issues such as measurement scaling, channel type configuration, and publishing intervals, with suggestions to adjust measurement frequency via driver tick commands or BMPI2C_Cycle. The BME280 temperature reading is noted to be chip temperature, slightly higher than ambient, requiring calibration offsets for accuracy. Development progressed to support multiple sensors and improved driver flexibility. Challenges include limited flash memory on some platforms (e.g., BL602), requiring manual driver enabling and custom builds. A newer BMPI2C driver supports both BME280 and BME680 sensors with humidity measurement, though humidity accuracy on BME680 requires further work. Users shared build configurations, troubleshooting tips, and integration methods, including Home Assistant MQTT discovery and manual scripting. The community also discussed driver availability on different hardware platforms, compilation issues, and OTA update file handling. Overall, the integration is functional with ongoing development to enhance features, stability, and ease of use for home automation applications. Generated by the language model.
TL;DR: OpenBK keeps BMP/BME280-enabled firmware below 400 kB [Elektroda, olekwal, post #21371661]; “Very impressed with OpenBK” [Elektroda, bilbs84, post #20862072] Flash the driver, wire SDA/SCL, run startDriver BMPI2C …, and your sensor publishes temperature, pressure and humidity to Home Assistant in under five minutes.
Why it matters: Re-using cheap WB2S/BL602 modules avoids landfill and adds room-wide climate data to any smart home.
How do I enable a BME280/BMP280 on a WB2S or BK7231 module?
Wire SCL to your chosen CLK GPIO and SDA to DATA; power at 3.3 V.
In the WebApp console enter startDriver BMPI2C <CLK> <DATA> <TempCh> <PressCh> <HumCh> <Addr> where Addr is 1 for 0x76 or 0 for 0x77 [Elektroda, p.kaczmarek2, post #21123022]
Save to autoexec so the driver loads on boot.
A reading appears immediately on the index page and via MQTT.
My firmware says “Driver BMP280 is not known in this build”. What now?
The driver was compiled out to save flash. Re-build OpenBK with #define ENABLE_DRIVER_BMP280 1 (or ENABLE_DRIVER_BMPI2C 1) in obk_config.h, then flash the new binary [Elektroda, p.kaczmarek2, post #20945538]
How can I slow down the 1-second MQTT flood?
With the new BMPI2C driver run BMPI2C_Cycle <seconds>; e.g., BMPI2C_Cycle 60 publishes once a minute [Elektroda, p.kaczmarek2, post #21123022] Older BMP280 driver lacks this option—update or script throttling.
Which chip ID or I²C address should I expect?
• BMP280: ID 0x58, address 0x76/0x77
• BME280: ID 0x60, address 0x76/0x77
• BME680: ID 0x61, address 0x76/0x77 [Elektroda, bilbs84, #20862072; divadiow, #21072813].
Home Assistant shows temperature but no pressure or humidity—why?
Assign correct channel types: set Temp_div100, Pressure_div100, and Humidity_div100 for the respective channels, or let discovery auto-map them. Missing mapping leaves blank fields on the device page even though MQTT data is sent [Elektroda, bilbs84, post #20864417]
Yes. Use different I²C addresses (0x76 and 0x77). Example autoexec:
startDriver BMPI2C 26 24 4 5 6 238 (BME680 0x77)
startDriver BMP280 8 7 1 2 3 236 (BMP280 0x76) [Elektroda, DeDaMrAz, post #21275971]
Does the temperature reading need calibration?
Datasheet states the internal temp is mainly for pressure/humidity compensation and can be 2-3 °C high [Elektroda, Helmi_Beh, post #20862559] Add an offset with the addChannelOffset command or in Home Assistant if precise ambient values are required.
Edge case: chip detected but reads wrong ID, driver fails.
This occurs when SDA/SCL pins are swapped or floating, or if VDDIO is at 5 V (sensor is 3.6 V max). Correct wiring and level-shift if needed [Elektroda, p.kaczmarek2, post #21054975]
How stable is the sensor with OpenBK long-term?
A BME280 test node has run for >10 days without data drop [Elektroda, DeDaMrAz, post #21143369] That equals ~14,400 successful cycles at a 1-minute interval.
Quick 3-step build-and-flash guide?
Fork repo, edit obk_config.h, enable driver.
Push to GitHub; Actions produce *.ota artifact (≈400 kB).