“Send Sensor Reading via Email (IFTTT)” project in “MicroPython for ESP32 and ESP8266” works OK with ESP32 but it looks ESP8266 lacks memory.
Download OK exec(open(“BME280.py”).read(),globals())
Memory error : memory allocation failed, allocationg 9984 bytes (BME280.py 10k on windows)
I re-Burned firmware to clear and defrag memory, checked with gc.collect() and micropython.mem_info(1)
placed BME280.py in a “module” subdirectory and kept only boot.py in the workspace
but there is still the same Memory error : memory allocation failed, allocationg 9984 bytes
Has anyone done this project on a ESP8266 ?
This is the BME280.py for ESP8266 -> https://github.com/mchobby/esp8266-upy/blob/master/bme280-bmp280/bme280.py
The one on Random Nerd Tutorial works only for ESP32 -> https://github.com/RuiSantosdotme/ESPMicroPython/
Hello Jean, if you see the message “Download OK”. You can ignore that warning message saying “memory allocation failed” and simply restarting your ESP8266 should make it work.
Can you see if it’s working for you?
We must have different ESP8266 because simply restarting mine doesn’t work !
My ESP8266 only works with :
which is a bme280 intended for the MicroPython and esp8266 boards (explained line 7).
To make this “new” bme280.py file work with our boot.py file one must :
- first correct the “new”‘ BME280.py file the default address which is 0x76 instead of 0x77 (the opposite of what is written line 39) BME280_I2CADDR = 0x76 and BMP180_I2CADDR = 0x76
- than change a few lines in our boot.py file which are :
temp = result
pres = result
hum = result
instead of :
temp = bme.temperature
hum = bme.humidity
pres = bme.pressure
The “new” BME280 has no attibutes “temperature”, “pressure” and “humidity”.
But there is an attribute “values” which returns our three expected results in an array.
Why are you using that library? I recommend using this exact file for BME280.py: https://github.com/RuiSantosdotme/ESP-MicroPython/blob/master/code/WiFi/HTTP_Client_IFTTT_BME280/BME280.py
The library that I use in the eBook uses less spaces to save memory and it has no comments, so it works with the ESP8266…