Comments on: MicroPython: BME680 with ESP32 and ESP8266 (Temperature, Humidity, Pressure, Gas) https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Thu, 07 Aug 2025 17:41:38 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: niko https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-1079426 Thu, 07 Aug 2025 17:41:38 +0000 https://randomnerdtutorials.com/?p=99595#comment-1079426 In reply to Silver.

I had the same issue. The problem with ENODEV is, that the sensor cannot be found. The solution that worked for me was:
when creating the BME680 object as described with: “bme = BME680_I2C(i2c=i2c)” use “bme = BME680_I2C(i2c, i2c.scan().pop())” instead.
explanation: I found that in init of class BME680_I2C, the address is set to 0x77 by default, but my sensor´s address is 0x76. Using “i2c.scan()” brings you the actual address and use it as an argument for the new object.

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-605710 Thu, 13 May 2021 18:14:19 +0000 https://randomnerdtutorials.com/?p=99595#comment-605710 In reply to WILLIAM E WEBB.

Hi.
Thanks for sharing. I’ll have to try it.
It may be useful for others too.
Regards,
Sara

]]>
By: WILLIAM E WEBB https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-605652 Thu, 13 May 2021 16:03:47 +0000 https://randomnerdtutorials.com/?p=99595#comment-605652 In reply to Sara Santos.

Sara, as time permits, I have tried to find a solution to the reconnect issue. I have a proposed approach for the ESP32 that seems WAY to complicated.

I run the BME680 server in one thread and a periodic connection test on the second thread. This way, the timer for the connection test is non-blocking. If the gateway (192.168.0.1 in my case) can not be reached a hard reset is sent. I got the basic approach to the non-blocking timer here: https://www.youtube.com/watch?v=9vvobRfFOwk&t=291s

This is pretty crude but it should cover all manner of network ills. Any suggestion on how to improve or simplify this code is appreciated.

https://github.com/bill-orange/MicroPython/tree/main/esp32%20MicroPython%20BME680

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-583317 Fri, 02 Apr 2021 14:33:12 +0000 https://randomnerdtutorials.com/?p=99595#comment-583317 In reply to WILLIAM E WEBB.

Hi.
At the moment, we don’t have a tutorial about how to reconnect to wi-fi using micropython.
But, I think this will help you: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
Regards,
Sara

]]>
By: WILLIAM E WEBB https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-583314 Fri, 02 Apr 2021 14:27:28 +0000 https://randomnerdtutorials.com/?p=99595#comment-583314 This project worked pretty well. However, I do have one problem. If my WiFi network goes away (which it frequently does) the connection is lost and the main.py will not recover. A brief Google on “MicroPython Auto-reconnect” did not reveal a solution. I did see that other people have the same problem with there code.

Is there a way to add an auto-reconnect function to MicroPython?

]]>
By: Desh https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-539323 Sun, 10 Jan 2021 11:51:18 +0000 https://randomnerdtutorials.com/?p=99595#comment-539323 I’m still running the BME680 with Arduino C++ as I’m using the Bosch BSEC library to get air quality (IAQ), VOC and CO2 (github.com/BoschSensortec/BSEC-Arduino-library). The BSEC library calculates this values by using gas resistance, humidity and temperature (as shown above).

Is there any chance to use this C++ library with MicroPython, i.e. call the library functions and get their values? The used calculation seems to be closed source.

]]>
By: Silver https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-537131 Tue, 05 Jan 2021 12:44:02 +0000 https://randomnerdtutorials.com/?p=99595#comment-537131 In reply to richard sauvant.

I have the same exact issue with CJMCU-680. At first I had a problem:
“NameError: name ‘BME680_I2C’ isn’t defined”
Then I BurnFirmware and now I have a problem like Richard. And usual memory allocating problem on second run and above. It just won’t work.

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-506835 Fri, 16 Oct 2020 09:05:21 +0000 https://randomnerdtutorials.com/?p=99595#comment-506835 In reply to Shehu Bello.

Make sure you upload the code to your board. You’re probably just “running” the code.
After uploading make sure you press the RST button to restart the board.
Regards,
Sara

]]>
By: Shehu Bello https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-506376 Thu, 15 Oct 2020 04:18:09 +0000 https://randomnerdtutorials.com/?p=99595#comment-506376 In reply to Miloš.

What I mean is that it does not work as a stand alone with external power supply.

My aim is to use it in a project using a separate power supply such as battery. However, it does not allow me do that. The script only runs when the board is not disconnected from the IDE.

Thanks

]]>
By: richard sauvant https://randomnerdtutorials.com/micropython-bme680-esp32-esp8266/#comment-506273 Wed, 14 Oct 2020 21:27:48 +0000 https://randomnerdtutorials.com/?p=99595#comment-506273 Hello iI try your code but I has a problem
exec(open(‘./testbme680.py’).read(),globals())
Traceback (most recent call last):
File “”, line 1, in
File “”, line 35, in
here >> bme = BME680_I2C(i2c=i2c)
File “bme680.py”, line 217, in init
File “bme680.py”, line 46, in init
File “bme680.py”, line 228, in _write
OSError: [Errno 19] ENODEV
I use this bme680
GY-MCU680V1
https://wiki.liutyi.info/display/ARDUINO/BME680
Do you ave an idea *???
Thank you !

]]>