|
7 | 7 |
|
8 | 8 | Suitable for measuring ambient temperature, barometric pressure, and humidity, the BME280 is a great indoor environmental sensor. |
9 | 9 |
|
10 | | -# Pre-requisites |
| 10 | +## Installing |
11 | 11 |
|
12 | | -You must enable: |
| 12 | +We'd recommend using this library with Raspberry Pi OS Bookworm or later. It requires Python ≥3.7. |
13 | 13 |
|
14 | | -* i2c: `sudo raspi-config nonint do_i2c 0` |
| 14 | +## Full install (recommended): |
15 | 15 |
|
16 | | -You can optionally run `sudo raspi-config` or the graphical Raspberry Pi Configuration UI to enable interfaces. |
| 16 | +We've created an easy installation script that will install all pre-requisites and get you up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal |
| 17 | +on your Raspberry Pi desktop, as illustrated below: |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +In the new terminal window type the commands exactly as it appears below (check for typos) and follow the on-screen instructions: |
| 22 | + |
| 23 | +```bash |
| 24 | +git clone https://github.com/pimoroni/bme280-python |
| 25 | +cd bme280-python |
| 26 | +./install.sh |
| 27 | +``` |
| 28 | + |
| 29 | +**Note** Libraries will be installed in the "pimoroni" virtual environment, you will need to activate it to run examples: |
| 30 | + |
| 31 | +``` |
| 32 | +source ~/.virtualenvs/pimoroni/bin/activate |
| 33 | +``` |
17 | 34 |
|
18 | | -# Installing |
| 35 | +## Development: |
19 | 36 |
|
20 | | -Stable library from PyPi, the smbus library is also needed: |
| 37 | +If you want to contribute, or like living on the edge of your seat by having the latest code, you can install the development version like so: |
21 | 38 |
|
22 | | -* Just run `python3 -m pip install pimoroni-bme280` |
| 39 | +```bash |
| 40 | +git clone https://github.com/pimoroni/bme280-python |
| 41 | +cd bme280-python |
| 42 | +./install.sh --unstable |
| 43 | +``` |
23 | 44 |
|
24 | | -Latest/development library from GitHub: |
| 45 | +## Install stable library from PyPi and configure manually |
25 | 46 |
|
26 | | -* `git clone https://github.com/pimoroni/bme280-python` |
27 | | -* `cd bme280-python` |
28 | | -* `sudo ./install.sh` |
| 47 | +* Set up a virtual environment: `python3 -m venv --system-site-packages $HOME/.virtualenvs/pimoroni` |
| 48 | +* Switch to the virtual environment: `source ~/.virtualenvs/pimoroni/bin/activate` |
| 49 | +* Install the library: `pip install pimoroni-bme280` |
| 50 | + |
| 51 | +In some cases you may need to us `sudo` or install pip with: `sudo apt install python3-pip`. |
| 52 | + |
| 53 | +This will not make any configuration changes, so you may also need to enable: |
| 54 | + |
| 55 | +* i2c: `sudo raspi-config nonint do_i2c 0` |
| 56 | + |
| 57 | +You can optionally run `sudo raspi-config` or the graphical Raspberry Pi Configuration UI to enable interfaces. |
29 | 58 |
|
0 commit comments