{ "info": { "author": "Richard Hull", "author_email": "richard.hull@destructuring-bind.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Education", "Topic :: System :: Hardware" ], "description": "BME280 Sensor Driver\n====================\n.. image:: https://travis-ci.org/rm-hull/bme280.svg?branch=master\n :target: https://travis-ci.org/rm-hull/bme280\n\n.. image:: https://coveralls.io/repos/github/rm-hull/bme280/badge.svg?branch=master\n :target: https://coveralls.io/github/rm-hull/bme280?branch=master\n\n.. image:: https://img.shields.io/pypi/pyversions/rpi-bme280.svg\n :target: https://pypi.python.org/pypi/rpi-bme280\n\n.. image:: https://img.shields.io/pypi/v/rpi-bme280.svg\n :target: https://pypi.python.org/pypi/rpi-bme280\n\n.. image:: https://img.shields.io/maintenance/yes/2018.svg?maxAge=2592000\n\n\nInterfacing a Bosch BME280 digital sensor module (capable of sensing\ntemperature, humidity and pressure) in Python 2 or 3 using I2C on the Raspberry\nPi. The particular kit I bought can be acquired for a few pounds from `eBay\n`_. Further technical details for the\nBME280 sensor can be found in the `datasheet\n`_\n[PDF].\n\n.. image:: https://raw.githubusercontent.com/rm-hull/bme280/master/doc/bme280-sensor.jpg\n :alt: mounted\n\nGPIO pin-outs\n-------------\nThe BME280 is an I2C device, so connecting to the RPi is very straightforward:\n\nP1 Header\n^^^^^^^^^\nFor prototyping, the P1 header pins should be connected as follows:\n\n========== ====== ============ ======== ==============\nBoard Pin Name Remarks RPi Pin RPi Function \n========== ====== ============ ======== ==============\n1 VIN +3.3V Power P01-1 3V3 \n2 GND Ground P01-6 GND \n3 SCL Clock P01-5 GPIO 3 (SCL) \n4 SDA Data P01-3 GPIO 2 (SDA) \n========== ====== ============ ======== ==============\n\nPre-requisites\n--------------\nEnsure that the I2C kernel driver is enabled::\n\n $ dmesg | grep i2c\n [ 4.925554] bcm2708_i2c 20804000.i2c: BSC1 Controller at 0x20804000 (irq 79) (baudrate 100000)\n [ 4.929325] i2c /dev entries driver\n\nor::\n\n $ lsmod | grep i2c\n i2c_dev 5769 0\n i2c_bcm2708 4943 0\n regmap_i2c 1661 3 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core\n\nIf you have no kernel modules listed and nothing is showing using ``dmesg`` then this implies\nthe kernel I2C driver is not loaded. Enable the I2C as follows:\n\n#. Run ``sudo raspi-config``\n#. Use the down arrow to select ``9 Advanced Options``\n#. Arrow down to ``A7 I2C``\n#. Select **yes** when it asks you to enable I2C\n#. Also select **yes** when it asks about automatically loading the kernel module\n#. Use the right arrow to select the **** button\n#. Select **yes** when it asks to reboot\n\nAfter rebooting re-check that the ``dmesg | grep i2c`` command shows whether\nI2C driver is loaded before proceeding.\n\nOptionally, to improve permformance, increase the I2C baudrate from the default\nof 100KHz to 400KHz by altering ``/boot/config.txt`` to include::\n\n dtparam=i2c_arm=on,i2c_baudrate=400000\n\nThen reboot.\n\nThen add your user to the i2c group::\n\n $ sudo adduser pi i2c\n\nInstall some packages::\n\n $ sudo apt-get install i2c-tools python-pip\n\nNext check that the device is communicating properly (if using a rev.1 board,\nuse 0 for the bus not 1)::\n\n $ i2cdetect -y 1\n 0 1 2 3 4 5 6 7 8 9 a b c d e f\n 00: -- -- -- -- -- -- -- -- -- -- -- -- --\n 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n 70: -- -- -- -- -- -- 76 --\n\nInstalling the Python Package\n-----------------------------\nFor python2, from the bash prompt, enter::\n\n $ sudo python setup.py install\n\nThis will install the Python files in ``/usr/local/lib/python2.7``\nmaking them ready for use in other programs.\n\nAlternatively for python3, type::\n\n $ sudo python3 setup.py install\n\nCheeseshop install\n^^^^^^^^^^^^^^^^^^\nAlternatively, a version on PyPi is available, just do::\n\n $ sudo pip install RPi.bme280\n\nSoftware Driver - Example Usage\n-------------------------------\nOnce installed, confirm the I2C address (see prerequisites, it will most \nlikely be 0x76 or 0x77) and port.\n\nThen in a python script or REPL:\n\n.. code:: python\n\n import smbus2\n import bme280\n\n port = 1\n address = 0x76\n bus = smbus2.SMBus(port)\n\n calibration_params = bme280.load_calibration_params(bus, address)\n\n # the sample method will take a single reading and return a\n # compensated_reading object\n data = bme280.sample(bus, address, calibration_params)\n\n # the compensated_reading class has the following attributes\n print(data.id)\n print(data.timestamp)\n print(data.temperature)\n print(data.pressure)\n print(data.humidity)\n\n # there is a handy string representation too\n print(data)\n\nThis then should print something like::\n\n ee50df9c-3aa3-4772-8767-73b6bb74f30f\n 2016-11-18 17:33:28.937863\n 20.563\n 980.91\n 48.41\n compensated_reading(id=ee50df9c-3aa3-4772-8767-73b6bb74f30f, \n timestamp=2016-11-18 17:33:28.937863, temp=20.563 \u00b0C, \n pressure=980.91 hPa, humidity=48.41 % rH)\n\nFor a data-logger like application, periodically call ``bme2.sample(bus, address, calibration_params)`` to\nget time-based readings.\n\nSee the `weatherstation project `_ for\na more complete example usage.\n\nReferences\n----------\n> TODO\n\nLicense\n-------\nThe MIT License (MIT)\n\nCopyright (c) 2016 Richard Hull\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/rm-hull/bme280/tarball/0.2.3", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rm-hull/bme280", "keywords": "raspberry pi", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "RPi.bme280", "package_url": "https://pypi.org/project/RPi.bme280/", "platform": "", "project_url": "https://pypi.org/project/RPi.bme280/", "project_urls": { "Download": "https://github.com/rm-hull/bme280/tarball/0.2.3", "Homepage": "https://github.com/rm-hull/bme280" }, "release_url": "https://pypi.org/project/RPi.bme280/0.2.3/", "requires_dist": null, "requires_python": "", "summary": "A library to drive a Bosch BME280 temperature, humidity, pressure sensor over I2C", "version": "0.2.3" }, "last_serial": 5290835, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fdab2d698e766766a3843e4b849121d9", "sha256": "96395b06ce75e24db39468ce3c28dffc2f3e98fad9923ff1942aa3dd0da624bd" }, "downloads": -1, "filename": "RPi.bme280-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fdab2d698e766766a3843e4b849121d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1706960, "upload_time": "2016-11-15T21:03:56", "url": "https://files.pythonhosted.org/packages/52/e2/bc03f435654a96f53d696c475fe9bde70b6ae8923826af67ba986e7badfa/RPi.bme280-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "15daa8fb161c92a4eea838e2f85758a3", "sha256": "8911d888d876ed90e1303841b82e07c6601e96685ced400c670a3f3626cfb806" }, "downloads": -1, "filename": "RPi.bme280-0.1.1.tar.gz", "has_sig": false, "md5_digest": "15daa8fb161c92a4eea838e2f85758a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1730807, "upload_time": "2016-11-24T20:51:44", "url": "https://files.pythonhosted.org/packages/1a/a9/2fdda1a72df78e4edd90cfb4d90edbf0670f2ea15eb92f788d48ffb71f49/RPi.bme280-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3f55cd4f79bdbb25c4d9acd67c810212", "sha256": "e972ec2aa9a3a9acf74b32fa81c4496e4d1581bfe5924fda95d03def526e4e46" }, "downloads": -1, "filename": "RPi.bme280-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3f55cd4f79bdbb25c4d9acd67c810212", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1732241, "upload_time": "2016-11-24T22:57:17", "url": "https://files.pythonhosted.org/packages/ee/3c/e58e0bfa6c286df3860e46da83e6e694e118443a0acd7e98e04f0bd42bb9/RPi.bme280-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "641b68bbd80ebf42f9f48d4a2c43dca5", "sha256": "29be2f0354a8c3bf817f348cd86806723d1cc7e8e2521c941ce5d30121792bbf" }, "downloads": -1, "filename": "RPi.bme280-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "641b68bbd80ebf42f9f48d4a2c43dca5", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13111, "upload_time": "2017-05-23T20:32:02", "url": "https://files.pythonhosted.org/packages/2c/28/7622c16bdd93d8bc92f79c5142254cfe84f0a35736299324c64d448be0a9/RPi.bme280-0.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1485cb020c7ef98bf9af9f5c18b3bf18", "sha256": "c9d8d986a4d8edfdb2486b2a436fa1d23613aa10fe9f791741040739c3968200" }, "downloads": -1, "filename": "RPi.bme280-0.1.3.tar.gz", "has_sig": false, "md5_digest": "1485cb020c7ef98bf9af9f5c18b3bf18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1734115, "upload_time": "2017-05-23T20:31:58", "url": "https://files.pythonhosted.org/packages/02/32/81eaa5b02aa06406c71bf3d09e00835ca58f75e81f685bf5419813ae2909/RPi.bme280-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4519f00c5d9c79721fccf28536812446", "sha256": "172f2cad62278577b5624cff6a895529f87983db022e0fc679d06e53e6978782" }, "downloads": -1, "filename": "RPi.bme280-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4519f00c5d9c79721fccf28536812446", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13561, "upload_time": "2018-03-18T19:44:11", "url": "https://files.pythonhosted.org/packages/fc/aa/b9e8b776d95f0f9968e40a789e7b27327b1bae78f838748cd6ee843ba806/RPi.bme280-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61f9c706d8b25759c439b36ba5635945", "sha256": "171786d88ddf39a5872ad3a04108f144cd4ae3b0211c07932c77de242015fcb7" }, "downloads": -1, "filename": "RPi.bme280-0.2.0.tar.gz", "has_sig": false, "md5_digest": "61f9c706d8b25759c439b36ba5635945", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1733575, "upload_time": "2018-03-18T19:44:08", "url": "https://files.pythonhosted.org/packages/ec/4c/270c17c2b08223af35aea2fb7902ac99f3f1743006b79bc6ac9b675977b1/RPi.bme280-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b1c8c12a05640ff95a818cb3e72ca84e", "sha256": "d2b4576a3fc173d605fd14d5940b7a31a338cd324f288a0e140ef77c0e536ac8" }, "downloads": -1, "filename": "RPi.bme280-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b1c8c12a05640ff95a818cb3e72ca84e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13650, "upload_time": "2018-03-18T22:18:23", "url": "https://files.pythonhosted.org/packages/67/8f/3f17b5be318511327dd46e58f1fd25b2cc23f8089effe5bf9cf57cd4d2c5/RPi.bme280-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "154369e73eb03c61e3c69bd0e21f66b9", "sha256": "31d87b87a6c98a9c1dcf5f2c2eee838bc96284f4cd442c60b3ffcb76e10cb221" }, "downloads": -1, "filename": "RPi.bme280-0.2.1.tar.gz", "has_sig": false, "md5_digest": "154369e73eb03c61e3c69bd0e21f66b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1733676, "upload_time": "2018-03-18T22:18:20", "url": "https://files.pythonhosted.org/packages/c2/08/d458e55745d516bd38300a27b942c73502d67350d533f5a76ae308bbf5fd/RPi.bme280-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "b2c730f65e99639fd44cedd17a60d773", "sha256": "a2359894dab98dcb9f8bef53de6377b6ab7aef61cacf109e30703698a1206667" }, "downloads": -1, "filename": "RPi.bme280-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b2c730f65e99639fd44cedd17a60d773", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13614, "upload_time": "2018-06-12T20:49:31", "url": "https://files.pythonhosted.org/packages/64/a9/606b2f986da18b752f02c9b0062d562907a43701d3e3ecec4a503259852f/RPi.bme280-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8d266b4b7b5ddcc3e573d16c4089f699", "sha256": "c6122dbc416699983ede6a52590ae35ee51a417c3567ec73165b3d0cfa2164d2" }, "downloads": -1, "filename": "RPi.bme280-0.2.2.tar.gz", "has_sig": false, "md5_digest": "8d266b4b7b5ddcc3e573d16c4089f699", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1733697, "upload_time": "2018-06-12T20:49:29", "url": "https://files.pythonhosted.org/packages/8e/91/6298acff65d9fd36e89caf8dcb2414aeac1386a647eb93e3633b71aa5cb0/RPi.bme280-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "aa5f4988606e51fbd41ab1d5a9bc2717", "sha256": "1654a007a828373e083173d5e319475af8cb660a817acd78d0bc7c52ef0de9a5" }, "downloads": -1, "filename": "RPi.bme280-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa5f4988606e51fbd41ab1d5a9bc2717", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 10406, "upload_time": "2019-05-20T07:45:38", "url": "https://files.pythonhosted.org/packages/8a/55/2c738564ceb478952f15d6331759c0ca4f4d518e8e44689766deac9f42de/RPi.bme280-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5924824c8862927b6850b9a2ef91bc28", "sha256": "11c25e549b7f3ef2e41d463195e04994ef7add9e8ccd2616ccf58d322d783b9c" }, "downloads": -1, "filename": "RPi.bme280-0.2.3.tar.gz", "has_sig": false, "md5_digest": "5924824c8862927b6850b9a2ef91bc28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1732454, "upload_time": "2019-05-20T07:45:35", "url": "https://files.pythonhosted.org/packages/0a/25/486a1ec01bfd3490987ed7f0f75e475e09242c0057d6a2e0d22d56b77046/RPi.bme280-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aa5f4988606e51fbd41ab1d5a9bc2717", "sha256": "1654a007a828373e083173d5e319475af8cb660a817acd78d0bc7c52ef0de9a5" }, "downloads": -1, "filename": "RPi.bme280-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa5f4988606e51fbd41ab1d5a9bc2717", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 10406, "upload_time": "2019-05-20T07:45:38", "url": "https://files.pythonhosted.org/packages/8a/55/2c738564ceb478952f15d6331759c0ca4f4d518e8e44689766deac9f42de/RPi.bme280-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5924824c8862927b6850b9a2ef91bc28", "sha256": "11c25e549b7f3ef2e41d463195e04994ef7add9e8ccd2616ccf58d322d783b9c" }, "downloads": -1, "filename": "RPi.bme280-0.2.3.tar.gz", "has_sig": false, "md5_digest": "5924824c8862927b6850b9a2ef91bc28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1732454, "upload_time": "2019-05-20T07:45:35", "url": "https://files.pythonhosted.org/packages/0a/25/486a1ec01bfd3490987ed7f0f75e475e09242c0057d6a2e0d22d56b77046/RPi.bme280-0.2.3.tar.gz" } ] }