Comments on: MicroPython: MQTT – Publish BME280 Sensor Readings (ESP32/ESP8266) https://randomnerdtutorials.com/micropython-mqtt-publish-bme280-esp32-esp8266/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 25 Dec 2022 00:21:02 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Tom https://randomnerdtutorials.com/micropython-mqtt-publish-bme280-esp32-esp8266/#comment-805035 Sun, 25 Dec 2022 00:21:02 +0000 https://randomnerdtutorials.com/?p=95819#comment-805035 How can I go about changing the Pressure units in the micropython code (main.py) from hPa to in-Hg?

]]>
By: Syd https://randomnerdtutorials.com/micropython-mqtt-publish-bme280-esp32-esp8266/#comment-735892 Mon, 04 Apr 2022 13:01:42 +0000 https://randomnerdtutorials.com/?p=95819#comment-735892 It works great on a ESP32 – however when I tried it on a D1mini 8266 – got out of memory errors… Any way around this – what I would like to do in >>> is to query the amount of memory/flash available

]]>
By: Beyonlo https://randomnerdtutorials.com/micropython-mqtt-publish-bme280-esp32-esp8266/#comment-703851 Sun, 28 Nov 2021 14:21:36 +0000 https://randomnerdtutorials.com/?p=95819#comment-703851 In reply to Sara Santos.

Why the SoftI2C works and the Hardware I2C driver do not?

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-mqtt-publish-bme280-esp32-esp8266/#comment-686985 Thu, 21 Oct 2021 10:21:51 +0000 https://randomnerdtutorials.com/?p=95819#comment-686985 In reply to Nick Kavanagh.

Hi.
Try initializing the sensor with SoftI2C
i2c = SoftI2C(scl=Pin(22), sda=Pin(21), freq=10000)

instead of I2C:
i2c = I2C(scl=Pin(22), sda=Pin(21), freq=10000)

Let me know if this solves the issue.

Regards,
Sara

]]>
By: Nick Kavanagh https://randomnerdtutorials.com/micropython-mqtt-publish-bme280-esp32-esp8266/#comment-686539 Wed, 20 Oct 2021 13:46:13 +0000 https://randomnerdtutorials.com/?p=95819#comment-686539 I have attempted this with both an ESP32 and ESP8266. In both cases, initialization of the bme280 device on i2c fails with a timeout, and a warning that I2C is deprecated, use SoftI2C instead.
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:5656
load:0x40078000,len:12696
load:0x40080400,len:4292
entry 0x400806b0
Connection successful
Traceback (most recent call last):
File “main.py”, line 46, in
File “BME280.py”, line 153, in init
File “BME280.py”, line 159, in _load_calibration
File “BME280.py”, line 119, in readU16LE
File “BME280.py”, line 102, in readU16
OSError: [Errno 116] ETIMEDOUT
MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32

Any idea of how to solve this particular error. Thanks,
a loyal follower
NK

]]>