Deep Sleep Shield Update
-
@ledbelly2142 My code extends the BME280.py driver linked to in this forum (a pythonized version of existing c++ drivers). The gist is given in the pycom documentation for I2C - you pass in a tuple for the "pins" keyword:
i2c.init(I2C.MASTER, baudrate=100000, pins=('P8', 'P9'))
In this example, 'P8' being the SDA line, 'P9' being the SCL. I happen to be using those two at the moment as they simplified routing on my mating PCB. I was using ('P9','P8') prior to this and they work fine, just make sure they are connected to the corresponding pins on the BME280. I don't believe "any" pin combination will work - you either have to get familiar with the ESP32 and the pins in use by the LoPy, or just use trial and error, or my case, trial and smoke.
I needed to drop the baud rate to 100K to work with the BME280 (Embedded Adventures). I have ~ 10 cm of wiring between the LoPy and BME - perhaps that is why. When working with I2C, it is helpful to have a device you are very familiar with to debug your connection setup, then switch in the new driver and sensor. Going step by step and using the REPL is your friend in this regard.
-
@lambda280
I am using @Butch 's BME280 lib from HEREIf I can get away with using P10 sequentially I will. Moving SCL to another pin is a great alternative. My BME280's are pretty close, about 5cm, but they are plugged into the LoPy expansion shield pin headders, which have some 'play' in them (not a solid connection). I would prefer to solder them somewhere for impact testing. What's hot glue for anyway :-)
I'm using a fully made breakout BME280 board from HERE
@jmarcelino thought moving the I2C pins is best, since you can't move the deep sleep shield pin 10. -Thank you!
in the main.py I added the pin assignment:
i2c = I2C(0, I2C.MASTER, baudrate=100000, pins=('P8','P9'))Works fine now.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login