BME280 with PI 4

Hello Core. Well I feel that I am getting somewhere as I can detect my BME280 on port 77 and I can see this below, but I still cant get the bloody thing to work, syntax errors and all sorts when I use scripts downloaded on from the net. Any ideas?

pi@raspberrypi:~ $ sudo i2cdump -y 1 0x77
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 90 50 89 2e a5 0f a8 06 8e 6f e8 69 32 00 07 94    ?P?.?????o?i2.??
90: 16 d7 d0 0b 50 23 59 ff f9 ff ac 26 0a d8 bd 10    ????P#Y.?.?&????
a0: 00 4b 59 00 00 00 00 00 00 00 00 00 33 00 00 c0    .KY.........3..?
b0: 00 54 00 00 00 00 60 02 00 01 ff ff 1f 60 03 00    .T....`?.?..?`?.
c0: 00 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    `...............
e0: 00 76 01 00 12 23 03 1e 8e 41 ff ff ff ff ff ff    .v?.?#???A......
f0: ff 00 00 00 00 00 00 80 00 00 80 00 00 80 00 80    .......?..?..?.?
pi@raspberrypi:~ $ 

regards

Greg

2 Likes

Hey Greg,

Welcome to the forum!

We’re sorry to hear you’re running into some issues. Just to confirm, what specific BME280 module were you using and what scripts were you running on the Pi?

We’ll try and get a solution for this one ASAP!

2 Likes

Hello Owen

Thanks for your reply.

All my PI 4 stuff I have bought off Core, the BME280 is your part number P2652. As mentioned before on the command prompt I can see it on port 77 and when I run sudo i2cdump I can see the codes being sent from the BME280. My problem is all of the scripts I find are coming up with various errors like syntax and attribute and to be honest I have tried heaps of scripts. Being very new to PI and its something I want to learnt and I have read the Official Beginners Guide for PI that I bought off Core I sort of get it but I am obviously missing something. Any help would be very appreciated and no doubt lead to more orders to Core.

Regards

Greg Fletcher

2 Likes

Hello Owen

This is what I see on the i2cdump

Regards

Greg Fletcher

2 Likes

Hi Greg,

Sad to hear your BME280 is giving you problems! Could you post some screenshots/photos of the errors you’re getting with your code? (And maybe attach the code so we can have a look)

Keen to get to the bottom of this one!
-James

P.S. Since this forum is open to the whole internet, we strongly recommend not putting your phone number up on your posts

1 Like

Hi Greg.
Don’t know much about the hardware, especially Pi.
Just a thought, how long is the I2C connecting cable???
No mention of this so far.
Cheers Bob

1 Like

Hello James

First thanks for the heads up on the phone number bit, I didn’t give it a second thought.

See attached files, look I am very new to Pi and I want to get this right, your help would be appreciated I am obviously messing it up somewhere.

Regards

Greg Fletcher

(Attachment Untitled 1.odt is missing)

(Attachment Untitled 2.odt is missing)

(Attachment Untitled 3.odt is missing)

1 Like

Hello James

I just tried to put some screen shots on an email to you but they got rejected. They were in Word?

Regards

Greg Fletcher

Communication Systems Geraldton

1 Like

Hi Greg
Bill Gates may have his hooks in here too
Try changing these to .doc or .docx
I too use software that produces .odt files but I can save to Microsoft format to keep old Bill happy. Or if this fails PDF links seem to be OK.
Cheers Bob

1 Like

Hey Greg,

Welcome to the forum!!

Just to confirm, were you using the Adafruit BME280?

They have an excellent guide on getting it hooked up and running along with the wiring and an FAQ: Python & CircuitPython Test | Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout | Adafruit Learning System

In regards to the images/code, you should be able to paste them directly into a forum post if you are on a PC. Python is interpreted line by line so just the text will do!

Liam.

1 Like

Hi Greg,

Turns out Michael has created a tutorial on exactly what you’re after!

Give it a whirl :slight_smile:
-James

1 Like

Since the PiicoDev driver is written for the same device, with the same default address - the guide linked by @James should work out of the box.

Adafruit’s guide, linked by @Liam, uses CircuitPython - which requires additional steps to get working on a Raspberry Pi (namely, using adafruit_blinka)

2 Likes

Hi Greg.
I did ask earlier about the length of the I2C connecting cable and to date there has been no reply. I suggest this because others have come unstuck trying to communicate over too long a distance with this protocol.
Have you thought about this re your instability.
Cheers Bob

2 Likes

Hello Bob

I am sure I did answer this previously but the cable length is only about 150mm

1 Like

Hi Greg
That should not be causing any problem.
Your reply may have been part of the attachments that didn’t come.
Cheers Bob

Thanks Bob