The O/S is giving you an I/O error, so it looks like there’s an issue with the bme280 sensor. We had another person report this and it turned out to be a defective Raspberry Pi.
SSH into the pi and run i2cdetect -y 1
and the output should look something like this. You may have additional numbers there, but the important thing is that you should see either 76 or 77 there in that grid.
If neither 76 nor 77 are there, then the issue is that the pi can’t see the sensor. Most likely causes of this include:
- Incorrect wiring of the BME280 sensor (see the docs for the pinout)
- Defective sensor (replace if you have another)
- Defective pi (replace if you have another)
If you have any other i2c devices, that might help you determine if the pi is broken. If it can see other devices, it points more towards the sensor being the issue.
I don’t own a Pi 4, so I’ve never tested on that platform, but others have been reporting success, and the software should be compatible.