Several of my projects use Bosch BME280 sensor chips for measuring temperature, pressure and humidity.
Some correspondents have expressed problems using BME280 modules that they bought online, and it is usually because they have been cheated by online sellers misrepresenting BMP280 as BME280.
My projects that include code to initialise and read BME280 humidity will fail on a BMP280… check to see if the humidity results returned look sane. A driver may read the ChipID and fault on the ID returned by a BMP280.
The Bosch chips are usually visually different, and most clones likewise.
Above, the BME280 is a small square package, about 2.5mm each side.
Above, the BMP280 is a smaller rectangular package. The modules are usually quite a bit cheaper, but they are NOT compatible with the BME280.
If you don't want humidity measurement, the BMP280 is sufficient, and usually quite a bit cheaper.
Online sellers practices
The words replaces or compatible are strong indications of an attempt to confuse and perform a “bait and switch”. My own practice is to scour the eBay listing for any pics or specifications that are for BMP280 and if found, reject them. Listings that describe the module as including temperature pressure and humidity, and with pics that show the small square chip are lower risk. That said, I have obtained eBay refunds for more than half my purchases, BMP280s wind up in the bin.