catdog2 / mpy_bme280_esp8266

Driver for the Bosch BME280 for use with MicroPython on ESP8266 boards
73 stars 41 forks source link

Library cannot be used as described #1

Closed phieber closed 8 years ago

phieber commented 8 years ago

Hi,

thanks for writing this really helpful lib!! However, it seems that your documentation is probably outdated. When I follow your instructions, I get the following error:

>>> import machine >>> import bme280 >>> i2c = machine.I2C(scl=machine.Pin(2), sda=machine.Pin(0)) >>> i2c.scan() [119] >>> bme = bme280.BME280(i2c=i2c) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'BME280' >>>

catdog2 commented 8 years ago

I tried it with the micropython master branch as of today and it works exactly as described. The only problem which I can think of is that you don't have enough free memory to load the module. Usually you get an error at import in this case but I think sometimes it fails silently.

phieber commented 8 years ago

Do you have the 4MB module? I have the one MB version

Am 21. September 2016 02:27:13 MESZ, schrieb Peter Dahlberg notifications@github.com:

I tried it with the micropython master branch as of today and it works exactly as described. The only problem which I can think of is that you don't have enough free memory to load the module. Usually you get an error at import in this case but I think sometimes it fails silently.

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

catdog2 commented 8 years ago

4MB, but the amount of RAM should be same on all modules as far as i know.

phieber commented 8 years ago

That might be the case if you have the Adafruit Huzzah but I have the esp8266-01 (black). Those have 1MB and the older esp8266-01 (Green) mostly 512k. I think I have to get another esp.

Am 21. September 2016 14:08:45 MESZ, schrieb Peter Dahlberg notifications@github.com:

4MB, but the amount of RAM should be same on all modules as far as i know.

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

phieber commented 8 years ago

It works like a charm with 32Mbit modules like the ESP12-F. Can be closed.