logo elektroda
logo elektroda
X
logo elektroda

Integrating BME280 Sensor with OpenBK on WB2S Modules for Home Automation

bilbs84 7452 75
Best answers

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]
Generated by the language model.
ADVERTISEMENT
  • #31 20889503
    Alexpress
    Level 2  
    Posts: 2
    Rate: 1

    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.
  • ADVERTISEMENT
  • #32 20889667
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    BME680 or BME280? I haven't seen BME680 yet, I would need to buy one and try.
    Helpful post? Buy me a coffee.
  • #33 20890106
    Alexpress
    Level 2  
    Posts: 2
    Rate: 1

    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. BME680 and CB2S modules connected by wires on a white background.
    Greetings!

    https://es.aliexpress.com/item/10050059703827...t_main.11.21ef194dbFEnlm&gatewayAdapt=glo2esp
  • #34 20945270
    Osrx
    Level 5  
    Posts: 11

    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. =(

    Thank you for your work anyway! =)
  • #35 20945538
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    I apologize for the confusion. The code is still here, but the driver may be disabled because we are slowly running out of the flash memory.

    If you want to get a build with BME280 driver, you need to add:
    
    #define ENABLE_DRIVER_BMP280 1
    

    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
    Helpful post? Buy me a coffee.
  • #37 20990186
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    I apologize for the issue. It seems that something have randomly broken on Github:
    
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-objcopy -O binary ../../../apps/OpenBK7231T/output/BMP280-driver-enabled-fork_83eb11c040fc/OpenBK7231T_BMP280-driver-enabled-fork_83eb11c040fc.axf ../../../apps/OpenBK7231T/output/BMP280-driver-enabled-fork_83eb11c040fc/OpenBK7231T_BMP280-driver-enabled-fork_83eb11c040fc.bin
    make[3]: Leaving directory '/home/runner/work/OpenBK7231T_App/OpenBK7231T_App/sdk/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    make[2]: Leaving directory '/home/runner/work/OpenBK7231T_App/OpenBK7231T_App/sdk/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    Start Combined
    Combined will do cd
    Combined will do OTAFIX
    Combined will do ENCRYPT
    /**< @author <jiewu@bekencorp.com> */
    /**< @version v0.3.1 */
     encrypt without crc successfully!
     -file size: 0xc6df0
    Combined will do mpytools.py
    {
        "count": 4,
        "magic": "RT-Thread",
        "section": [
            {
                "firmware": "bootloader_enc.bin",
                "partition": "bootloader",
                "size": "68K",
                "start_addr": "0x00000000",
                "version": "1.00"
            },
            {
                "firmware": "OpenBK7231T_BMP280-driver-enabled-fork_83eb11c040fc_enc.bin",
                "partition": "app",
                "size": "978944",
                "start_addr": "0x00011000",
                "version": "1.00"
            }
        ],
        "version": "0.1"
    }
    Combined will do BEKEN_PACK
    beken packager V2.1.0
    Shanghai Real-Thread Electronic Technology Co.,Ltd
    Linux-5.15.0-1057-azure-x86_64-with-Ubuntu-20.04-focal
    
    load_config: config.json
    
    partition    flash_name       phy addr   size       logic addr size       file
    ------------ ---------------- ---------- ---------- ---------- ---------- ----------------
    bootloader   beken_onchip_crc 0x00000000 68K        0x00000000 64K        bootloader_enc.bin
    app          beken_onchip_crc 0x00011000 956K       0x00010000 921359     OpenBK7231T_BMP280-driver-enabled-fork_83eb11c040fc_enc.bin
    
    image size: 1024 KB
    image name: all_1.00.bin
    
    export app partition image: OpenBK7231T_BMP280-driver-enabled-fork_83eb11c040fc_enc_uart_1.00.bin
    
    time: 0.95s
    Good bye!
    End Combined
    generate ota file
    malloc(): corrupted top size
    Aborted (core dumped)
    make[1]: *** [Makefile:107: build-BK7231] Error 134
    make[1]: Leaving directory '/home/runner/work/OpenBK7231T_App/OpenBK7231T_App'
    make: *** [Makefile:80: OpenBK7231T] Error 2
    Error: Process completed with exit code 2.
    

    This is very strange! I don't know why it failed.

    I've recreated PR and here it is, it's working. Strange indeed:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1111/files

    Now you can download build files from that PR.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #38 21010592
    olekwal
    Level 6  
    Posts: 12

    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?

    Thank you for the information.
  • #39 21010867
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    BL602 is low on memory, BMP280 is not enabled there. You need to enable it and compile it yourself. Here is the configuration file:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/obk_config.h
    Here is #define:
    
    //#define ENABLE_DRIVER_BMP280 1
    

    Here is an instruction to compile online on Github without installing anything on your computer:
    OpenBeken online builds system - firmware compilation for all platforms on Github
    Additionally, you may need to add missing files to the Makefile, but that will come out in the end. Try it, I`ll help you if you need it.
    Helpful post? Buy me a coffee.
  • #40 21011595
    olekwal
    Level 6  
    Posts: 12

    Oh, something`s not working for me....

    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 :D 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:
    Quote:
    #elif PLATFORM_BL602

    // I have enabled drivers on BL602
    #define ENABLE_TASMOTADEVICEGROUPS 1
    #define ENABLE_NTP 1
    #define ENABLE_DRIVER_LED 1
    //#define ENABLE_DRIVER_BL0937 1
    //#define ENABLE_DRIVER_BL0942 1
    //#define ENABLE_DRIVER_CSE7766 1
    #define ENABLE_DRIVER_WEMO 1
    #define ENABLE_DRIVER_BMP280 1


    Compilation without errors, but "Info:MAIN :D river BMP280 is not known in this build."

    Third attempt: I took the compiler from here: https://github.com/openshwprojects/OpenBK7231T_App/pull/1111 - I uploaded it, unfortunately the same thing again: "Driver BMP280 is not known in this build"

    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"?
  • #41 21011607
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    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.

    Added after 1 [minutes]:

    PS: And this:
    olekwal wrote:

    3rd attempt: I took the compiler from tad: https://github.com/openshwprojects/OpenBK7231T_App/pull/1111 - I uploaded it, unfortunately the same thing again: "Driver BMP280 is not known in this build"

    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)

    Added after 8 [minutes]:

    I found the problem:
    Screenshot of a source code snippet in a text editor.
    Helpful post? Buy me a coffee.
  • #42 21011634
    olekwal
    Level 6  
    Posts: 12

    No, it's like yesterday (2nd attempt)

    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 :)
  • #43 21011662
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    This controller uses I2C software, it should work with BL602 without any problems, have you checked the latest version from my PR?
    Helpful post? Buy me a coffee.
  • #44 21011686
    olekwal
    Level 6  
    Posts: 12
    yes, now I can load the driver.

    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...
  • #45 21012263
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    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.
    Helpful post? Buy me a coffee.
  • #46 21013338
    olekwal
    Level 6  
    Posts: 12

    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....
  • ADVERTISEMENT
  • #47 21013349
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    There is a flag on the divider. It`s all because of the TuyaMCU standard that we based on at the beginning. Turn on:
    Screenshot of a feature list with a highlighted MQTT feature: Apply channel type multiplier on channel value before publishing it.


    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
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #48 21013368
    olekwal
    Level 6  
    Posts: 12

    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...
  • #49 21013378
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    You can give a tick per driver, it`s certainly better than adding a separate command for each driver for the measurement period.

    To be something like this
    
    drvTick BMP280 60
    

    then the measurement would be triggered every 60 seconds
    Helpful post? Buy me a coffee.
  • #50 21013400
    olekwal
    Level 6  
    Posts: 12
    that would be good :)
  • #51 21026799
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    I have a BMP280/AHT20 combined sensor module.

    Combined sensor module BMP280/AHT20 with Feiyang logo.
    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.
  • #52 21054355
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    hmmm

    Screen showing error messages for BMP280 sensor.

    startDriver BMP280 16 7 01

    Info:SENSOR:BMx280 wrong ID!
    Info:SENSOR:BMP280 failed!
    Info:MAIN:Started BMP280.
  • #53 21054975
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    There is a PR with AHT sensor, but you are already aware about it I guess: https://github.com/openshwprojects/OpenBK7231T_App/pull/1187
    Regarding BMP280, are you sure you got GPIO correctly?
    Helpful post? Buy me a coffee.
  • #55 21072813
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    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. ;/

    https://github.com/openshwprojects/OpenBK7231T_App/pull/1213

    Added after 52 [minutes]:

    can the this have multiple values

    Code: Text
    Log in, to see the code


    eg

    can the this have multiple values

    Code: Text
    Log in, to see the code


    I guess I could try. I will

    Added after 2 [hours] 53 [minutes]:

    Nevermind. I was not aware of the difference between chip ID and i2c address.
  • #56 21080070
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    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.

    https://github.com/openshwprojects/OpenBK7231T_App/actions/runs/9054242982

    BMP280/AHT20 combined module test

    Screenshot of the OpenBK7231N command tool with BMP280 module test results.

    Screenshot displaying the OpenBK7231N_E1BA8FEA identifier and BMP280 readings: temperature 26.03°C and pressure 1005.00 hPa.


    BME680

    Screenshot of the Command Tool interface displaying messages about detected BME680 and BMP280 sensors.

    Screenshot of BMP280 driver test results.


    Code: Text
    Log in, to see the code
  • #57 21080397
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    Merged, but first I disabled it in obk_config.h, if you need a new binary, open new PR
    Helpful post? Buy me a coffee.
  • #58 21080410
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    Oh cool. Thanks. Yes, would have expected to make PR for updated binary.
  • #59 21080988
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14616
    Help: 655
    Rate: 12633
    I've seen there is a new PR with BME280 support update, have you tried that @divadiow ?
    Helpful post? Buy me a coffee.
  • #60 21081004
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    I saw the new PR yes but I do not have a BME280 yet. I ordered one but it was definitely DOA. I keep meaning to order another.

Topic summary

✨ 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.

FAQ

TL;DR: With 1 sensor per WB2S and a simple command, OpenBK can read BME280 data over software I2C; one contributor confirmed, "all working fine" with BMPI2C_Cycle 60, which also stops 1-second MQTT flooding. This FAQ helps OpenBK users connect BME280/BMP280/BME680-class sensors and publish stable readings to Home Assistant or OpenHAB. [#21510838]

Why it matters: This thread shows the practical path from a first BME280 question to working OpenBK drivers, Home Assistant publishing, BL602 builds, and configurable reporting intervals.

Driver Sensors discussed Humidity support Address handling Reporting interval
BMP280 BMP280, partial BME280 use No native BME humidity at first Later extended Originally every 1 s
BMPI2C BME280, BMP280, BME680-class testing Yes, via humidity channel Explicit address parameter BMPI2C_Cycle 60 supported

Key insight: Use the older BMP280 driver only for basic temperature and pressure tests. For real deployments, BMPI2C is the better OpenBK path because it adds humidity-channel support and a configurable measurement cycle.

Quick Facts

  • BME280 and BMP280 use different chip IDs: BME280 reports 0x60, while BMP280 reports 0x58; confusing those values causes the classic "wrong ID" error. [#20862072]
  • The same BME280 breakout can expose two I2C addresses, 0x76 or 0x77, selected by switch or ADDR wiring on the board. [#20861920]
  • OpenBK later introduced startDriver BMPI2C [CLK] [DATA] [TempCh] [PressureCh] [HumidityCh] [Addr], where 0 means 0x77 and 1 means 0x76 in the newer syntax. [#21123022]
  • One BL602 user confirmed working wiring on P16 = SCL and P7 = SDA, after initial ID errors caused by wrong pin guesses. [#21011686]
  • A long-run test device with BME280 stayed stable for 10+ days, suggesting the OpenBK integration is practical beyond bench testing. [#21143369]

How do I connect a BME280 sensor to a WB2S module running OpenBK using software I2C?

Wire the sensor to two free GPIOs and start the OpenBK driver with those pins as software I2C clock and data. 1. Connect SCL to your chosen CLK GPIO and SDA to your chosen DATA GPIO. 2. Power the sensor and set its address to 0x76 or 0x77. 3. Run startDriver BMP280 24 11 1 2 for temp and pressure, or use BMPI2C if you also want humidity. The thread confirms one BME280 worked immediately after pin selection and driver start on WB2S-class hardware. [#20862072]

What does the OpenBK command "startDriver BMP280 [CLK] [DATA] [ChannelForTemp] [ChannelForPressure]" actually do, and how should I choose the GPIO pins and channels?

It starts the BMP280-family driver on two chosen GPIOs and stores readings in the channels you assign. CLK and DATA are the software I2C pins, while ChannelForTemp and ChannelForPressure are numeric OpenBK channels, such as 1 and 2. Pick GPIOs that are free on your board, then map the channels to channel types like Temp_div100 or Pressure_div100. One working example from the thread is startDriver BMP280 8 14 1 2. [#20862067]

Why does OpenBK report "BMx280 wrong ID" with a BME280 or BMP280 sensor, and how do I troubleshoot chip ID versus I2C address issues?

OpenBK reports "BMx280 wrong ID" when it can talk on I2C but the returned chip ID does not match what the driver expects. Check three things in order: 1. Confirm SCL and SDA are on the correct GPIOs. 2. Confirm the board is really a BME280 or BMP280. 3. Separate chip ID from I2C address during diagnosis. One BL602 user fixed the error simply by finding the correct pins, and another user found the BME280 returned 0x60 instead of the BMP280 0x58. [#21011686]

What is the difference between the BME280 chip ID and the I2C address, and why do values like 0x60, 0x58, 0x76, and 0x77 get mixed up?

The chip ID identifies the sensor model, while the I2C address identifies where that sensor sits on the bus. 0x60 is the BME280 chip ID, 0x58 is the BMP280 chip ID, and 0x76 or 0x77 are selectable I2C addresses. They get mixed up because both numbers appear during setup, but they solve different problems. One user explicitly realized the difference after trying to treat 0x77 as a chip ID value. [#21072813]

How can I publish BMP280 or BME280 temperature and pressure readings from OpenBK to Home Assistant over MQTT?

Use OpenBK channels with MQTT publishing, then let Home Assistant discover them or publish them manually. The thread gives two direct commands: publishFloat myTemp $CH1*0.01 and publishFloat myPress $CH2*0.1. You can also trigger updates on change with addEventHandler OnChannelChange 1 publishFloat myTemp $CH1*0.01. One user said the target platform was Home Assistant over MQTT, and the developer confirmed both discovery-based and script-based publishing paths. [#20862313]

What's the correct way to scale OpenBK BMP280 pressure and temperature values for Home Assistant, including Temp_div100 and Pressure_div100?

Scale temperature by 0.01 and pressure by the correct divider for the channel type you use. The thread shows raw values like T 2391 and P 100185, which correspond to about 23.91 °C and 1001.85 hPa after scaling. In OpenBK, Temp_div100 is the expected choice for temperature, and pressure needed its own corrected handling during development. One fix changed the web display from g_pressure*0.1f to g_pressure*0.01f for hectopascals. [#20865733]

How do channel types and the divider flag in OpenBK affect MQTT values for BME280 or BMP280 sensors?

Channel types control formatting and discovery, but MQTT can still send raw integers unless the divider flag is enabled. A BL602 user saw 2660 over MQTT instead of 26.60, even though the web page displayed scaled values correctly. The developer answered that a divider flag solves that mismatch because OpenBK still follows the TuyaMCU-style integer storage model. Turn that flag on if you want MQTT payloads to honor the selected divider. [#21013349]

What is the BMPI2C driver in OpenBK, and how is it different from the older BMP280 driver?

BMPI2C is the newer OpenBK driver for BMx280-style sensors, and it adds humidity support plus a configurable cycle command. "BMPI2C is a sensor driver that reads BMx280-family devices over software I2C, exposes separate temperature, pressure, and humidity channels, and accepts an explicit address parameter for multi-model support." The older BMP280 driver started as a simpler temp-and-pressure driver and originally ran every second. The BMPI2C command format adds [ChannelForHumidity] and [Addr], plus BMPI2C_Cycle 60. [#21123022]

BMP280 driver vs BMPI2C in OpenBK — which one should I use for BME280, BMP280, or BME680 sensors?

Use BMPI2C for new setups, especially if you need humidity or slower reporting. The older BMP280 driver is fine for quick BMP280 or basic BME280 temperature-and-pressure tests, and users confirmed it worked on real hardware. BMPI2C is the better fit for BME280 and newer experiments because it supports temp, pressure, humidity, and a cycle command. A later user switched to BMPI2C for a plain BMP280 and reported it worked after adding a placeholder humidity channel. [#21510838]

How can I slow down BME280 or BMP280 measurement and MQTT reporting in OpenBK so it doesn't publish every second?

Move to the newer BMPI2C driver and set a longer cycle. The older BMP280 path measured and published every 1 second, which multiple users called noisy or flooding for MQTT. The newer solution is BMPI2C_Cycle 60, which triggers the driver every 60 seconds instead. That change directly addresses the thread's repeated complaint about one-second updates on Home Assistant or OpenHAB. [#21123022]

What does the OpenBK command "BMPI2C_Cycle 60" do, and how should I set a practical measurement interval for Home Assistant or OpenHAB?

BMPI2C_Cycle 60 tells the BMPI2C driver to read and report every 60 seconds. For room temperature, pressure, and humidity, 60 seconds is a practical starting point because ambient conditions rarely need 1-second updates. One user wanted 5 minutes to reduce MQTT noise, while another confirmed 60 seconds worked fine in practice. Set the interval to match your dashboard and automation needs, not the fastest possible sensor rate. [#21510838]

Why is the BMP280 or BMPI2C driver missing from some OpenBK builds, and how do I enable it in obk_config.h and compile my own firmware?

Some OpenBK builds omit these drivers because flash space is tight, so you must enable them in obk_config.h and compile a custom binary. The developer explicitly said the BMP280 driver may be disabled because the project is slowly running out of flash memory. For the older driver, add #define ENABLE_DRIVER_BMP280 1. For newer builds, enable the newer BMPI2C path instead if that is the driver you need. [#20945538]

How do I build OpenBK with BMP280 or BMPI2C support for BL602, and what compile errors or missing dependencies should I watch for?

For BL602, enable the specific driver in the BL602 section of obk_config.h, then build without assuming generic I2C is required. The key trap is enabling ENABLE_I2C 1, which caused undefined references such as DRV_I2C_Init, DRV_I2C_EverySecond, and I2C_OnChannelChanged until it was fixed. The developer later clarified that ENABLE_I2C is not needed for this standalone BME/BMP driver on BL602. That makes the cleanest BL602 path: enable the sensor driver, skip generic I2C, and compile again. [#21370874]

What is OTA in OpenBK, and how do I prepare a custom BL602 firmware file so the web app accepts it for update?

OTA is the OpenBK web update package format, and BL602 custom builds may need repackaging before the web app accepts them. One user found that raw .bin and .ota.bin files were rejected as "Invalid OTA file was selected." They then compressed the OTA file to xz, renamed it to OpenBL602_OTA.bin.xz.ota, and got the file into the expected size range near 400 kB instead of about 700 kB. Later, the same user confirmed OTA worked with their BL602 custom builds. [#21371661]

How far can I get using a BME680 with OpenBK today, and what still needs extra driver work compared with BME280 support?

You can get partial detection and some experimental operation, but BME680 still needs extra driver work compared with BME280. One contributor added BME680 chip-ID detection only and stated that the driver itself still needed more work to function properly on BME680. Later, another user reported both BME680 and BME280 running on the same board with a custom BMPI2C-enabled build, but that was from a personal fork, not a standard public binary. So BME280 support is the mature path today. [#21275971]
Generated by the language model.
ADVERTISEMENT