Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

MS8607 and CircuitPython
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MS8607 and CircuitPython

by Tom_Henry on Tue Sep 01, 2020 10:31 pm

Tuesday, September 1, 2020

I have read that it's supposed to be very easy to set up CircuitPython and easily run CircuitPython programs.

Well, I disagree.

I have spend hours trying to figure out why I can't make a simple sensor, MS8607, work with CircuitPython and my Raspberry Pi 4.

Ok, so I decided to try a clean install of Raspberry Pi OS. I followed very carefully the steps on Adafruit's website and documented all the steps below. Maybe someone can help me with this. Otherwise I have no choice but to return the module to Adafruit a defective.

Step 1:

Completed all directions from the following website:

https://learn.adafruit.com/circuitpytho ... spberry-pi

Step 2:

Ran the python3 blinkatest.py program at the command line:

Here are the results:

pi@raspberrypi:~ $ python3 blinkatest.py

Hello blinka!
Digital IO ok!
I2C ok!
SPI ok!
Done!

Step 3:

Went to this website for the CircuitPython installation of the MS8607 library.

https://learn.adafruit.com/adafruit-te- ... cuitpython

Step 4:

First I connected my Raspberry Pi 4 to the Adafruit’s MS8607 sensor using the Stemma QT connectors.

Step 5:

I used pip3 to install the driver for the ms8607.

Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-ms8607

I received the message:

Successfully installed adafruit-circuitpython-ms8607-1.0.1



Step 6:

I tried to run the following Adafruit program:

from time import sleep
import board
import busio
from adafruit_ms8607 import MS8607

i2c = busio.I2C(board.SCL, board.SDA)
sensor = MS8607(i2c)

while True:

print("Pressure: %.2f hPa" % sensor.pressure)
print("Temperature: %.2f C" % sensor.temperature)
print("Humidity: %.2f %% rH" % sensor.relative_humidity)
sleep(1)

Step 7: Error messages:

Traceback (most recent call last):
File "/home/pi/ms8607.py", line 4, in <module>
from adafruit_ms8607 import MS8607
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_ms8607.py", line 38, in <module>
import adafruit_bus_device.i2c_device as i2c_device
ModuleNotFoundError: No module named 'adafruit_bus_device'

I keep getting module not found. Tis a mystery to me.

Hope someone can put me on the right track.

Thanks.

Tom_Henry
 
Posts: 15
Joined: Wed Aug 26, 2020 8:19 pm

Re: MS8607 and CircuitPython

by smccamy1 on Tue Sep 01, 2020 11:39 pm

Try

pip3 install adafruit_bus_device

and/or

pip3 install adafruit-circuitpython-busdevice

smccamy1
 
Posts: 21
Joined: Tue May 17, 2016 8:57 pm

Re: MS8607 and CircuitPython

by tannewt on Wed Sep 02, 2020 11:28 am

This is a bug in the configuration of the MS8607 library. It should have Bus Device as a dependency so pip always installs it.

I've filed an issue to fix it: https://github.com/adafruit/Adafruit_Ci ... 7/issues/1

tannewt
 
Posts: 1784
Joined: Thu Oct 06, 2016 8:48 pm

Re: MS8607 and CircuitPython

by Tom_Henry on Wed Sep 02, 2020 3:23 pm

tannewt

Perfect.

Just what I didn't need for my first circutpython sensor.

Now that I know it really works, I'll be purchasing several more sensors.

Thanks very much,

Tom Henry

Here are the results:

Python Program:

from time import sleep
import board
import busio
from adafruit_ms8607 import MS8607

i2c = busio.I2C(board.SCL, board.SDA)
sensor = MS8607(i2c)

while True:

print("Pressure: %.2f hPa" % sensor.pressure)
print("Temperature: %.2f C" % sensor.temperature)
print("Humidity: %.2f %% rH" % sensor.relative_humidity)
sleep(1)

Results

Python 3.7.3 (/usr/bin/python3)
>>> %Run ms8607.py

Pressure: 1012.35 hPa
Temperature: 24.90 C
Humidity: 53.07 % rH

Pressure: 1012.27 hPa
Temperature: 24.91 C
Humidity: 53.05 % rH

Pressure: 1012.28 hPa
Temperature: 24.92 C
Humidity: 53.04 % rH

Pressure: 1012.30 hPa
Temperature: 24.92 C
Humidity: 53.02 % rH

Pressure: 1012.30 hPa
Temperature: 24.93 C
Humidity: 53.01 % rH

Tom_Henry
 
Posts: 15
Joined: Wed Aug 26, 2020 8:19 pm

Re: MS8607 and CircuitPython

by tannewt on Wed Sep 02, 2020 6:42 pm

Great! Sorry for the trouble.

Looks like it's been fixed but not released yet: https://github.com/adafruit/Adafruit_Ci ... 607/pull/2

tannewt
 
Posts: 1784
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.