BME280 | Micropython driver for the BME280 sensor

 by   robert-hh Python Version: Current License: Non-SPDX

kandi X-RAY | BME280 Summary

kandi X-RAY | BME280 Summary

BME280 is a Python library typically used in Manufacturing, Utilities, Machinery, Process, Internet of Things (IoT), Raspberry Pi applications. BME280 has no bugs, it has no vulnerabilities and it has low support. However BME280 build file is not available and it has a Non-SPDX License. You can download it from GitHub.

The Bosch BME280 Environmental Sensor is a combined temperature, pressure and humidity sensor. It can communicate via I2C or SPI; this driver uses I2C. See the datasheet at for details.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              BME280 has a low active ecosystem.
              It has 52 star(s) with 12 fork(s). There are 10 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 4 have been closed. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of BME280 is current.

            kandi-Quality Quality

              BME280 has 0 bugs and 0 code smells.

            kandi-Security Security

              BME280 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              BME280 code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              BME280 has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              BME280 releases are not available. You will need to build from source code and install.
              BME280 has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              BME280 saves you 112 person hours of effort in developing the same functionality from scratch.
              It has 283 lines of code, 16 functions and 3 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed BME280 and discovered the below as its top functions. This is intended to give you an instant insight into BME280 implemented functionality, and help decide if they suit your requirements.
            • Return the altitude of the forecast
            • Reads the raw data from the L3 result
            • Read raw data
            • Calculate dew_point
            • Return a tuple of the temperature and pressure
            Get all kandi verified functions for this library.

            BME280 Key Features

            No Key Features are available at this moment for BME280.

            BME280 Examples and Code Snippets

            No Code Snippets are available at this moment for BME280.

            Community Discussions

            QUESTION

            BME280 function without library, but getting negative numbers
            Asked 2021-May-16 at 16:52

            so i was working with the bme280 and tried to make a function that reads the temperature without using the library. but for some reason it is giving me - numbers. does someone know why that is the case?

            ...

            ANSWER

            Answered 2021-May-16 at 16:52

            The int in Arduino environment is 16-bit long. It is used for calculations of values with the size of int or below, but it is not sufficient to deal with 20-bit temperature value of BME280. You should use long, which is 32-bit long, instead.

            Also the shifting amounts looks wrong. According to 5.4.8 of the datasheet of BME280, The bits [3:0] are stored in the high half of 0xFC, bits [11:4] are stored in 0xFB and bits [19:12] are stored in 0xFA. The shift amount should match these.

            In conclusion, the lines

            Source https://stackoverflow.com/questions/67552122

            QUESTION

            Get data from ESP32 over video in OpenCV - Python => freezing video
            Asked 2021-Apr-12 at 09:47

            I am working in a project where I need to show external data (from an ESP32 with an BME280 sensor) over a video in real time. I'm using opencv in Python to get the video from my webcam. The video working fine until I put the code for get the sensor data over the video, it turn very slow and freezing every 1/2 second (related with the delay in ESP32 code). Too I found that timeout (in python code) has a very important role... if I put it in 0 the video flow fine, but the data cant show properly. So I understand that readline() in my code has a blocking behaviour, if it doesn't receiver the last character of the line ("\n"), it can't to continue in the loop "while". The question is, how I can to redefine my code for avoid that??

            Python code:

            ...

            ANSWER

            Answered 2021-Apr-12 at 09:47

            I can immediately think of three ways to solve your problem.

            A simple solution is to read the temperature from ESP32 in non-blocking way. As a useful hack you can be specify a very small timeout value when creating the pyserial port - say 1 ms. Then readline() will return nothing if there's no data in the serial buffer from the ESP32. When that happens, simply skip updating the variable rawString. See the notes on readline()

            Source https://stackoverflow.com/questions/67051192

            QUESTION

            PICO hangs on micropython object creation
            Asked 2021-Apr-06 at 15:24

            I recently started working on a small driver for the raspberry pico and the bme280 sensor. I wanted to use the official bosh API written in C and therefore decided to write all the code in C using the micropython C api to write usermodules. I managed to get my code compiled into a UF2 file and my module shows up when I try to list the modules with help('modules'). When I import my module the class with the driver code shows up in dir(mymodule) but when I try to create an object the terminal connected to the PICO hangs and doesn't respond anymore.

            ...

            ANSWER

            Answered 2021-Apr-06 at 08:58

            You have .print defined but it doesn't exist in your code.

            Source https://stackoverflow.com/questions/66952337

            QUESTION

            Raspberry Pi [Errno 121] Remote I/O Error with Temperature Sensor
            Asked 2021-Mar-09 at 01:43

            I'm trying to setup a Raspberry Pi 3 B+ with a Waveshare BME280 Environmental Sensor. I followed this guide to wire the cables and ran the supplied bme280.py script. My sensor has 2 additional cables, the CS and ADDR/MISO, that are not present in the model on the guide but the rest are plugged in to the same GPIO pins. The I2C and SPI interfaces are enabled and I am running the latest Raspbian OS Lite.

            When I run the script, I get the following message:
            Traceback (most recent call last):
            File "bme280.py", line 172, in
            main()
            File "bme280.py", line 161, in main
            (chip_id, chip_version) = readBME280ID()
            File "bme280.py", line 56, in readBME280ID
            (chip_id, chip_version) = bus.read_i2c_block_data(addr, REG_ID, 2)
            OSError: [Errno 121] Remote I/O error

            There's another odd issue: when I run i2cdetect -y 1 I get every line with dashes, but if I run it a second time immediately after, I get x77 to show up, but x76 still doesn't.

            I found a similar thread and tried modifying my /boot/config.txt file by adding i2c_baudrate=100000 and rebooting but that did not fix it.

            I made sure to test the pi using gpiotest and the results came back as
            Skipped non-user gpios: 0 1 28 29 30 31
            Tested user gpios: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
            Failed user gpios: None

            I had gotten similar issues using a DHT11 sensor and running Adafruit libraries and got an error signifying there was no data flowing from the sensor. I tried using several different sensors and Raspberry Pis and have reinstalled the OS several times over. At this point, I'm not sure how to proceed. Any help is appreciated.

            ...

            ANSWER

            Answered 2021-Mar-09 at 01:43

            I managed to create a very hacky solution to this issue. Since i2cdetect seems to only read devices on the second (or later) times it is run, I decided to simulate running it inside the sensor script.

            I added the following lines to my code:

            Source https://stackoverflow.com/questions/66252615

            QUESTION

            using usocket seems to halt the loop (micropython)
            Asked 2021-Jan-09 at 19:57

            I'm trying to code a simple program for a ESP32 board. My main program is fairly simple and it has to run on a loop. On the side, the device also needs to be able to respond to HTTP requests with a very simple response.

            This is my attempt (a rework of https://randomnerdtutorials.com/micropython-esp32-esp8266-bme280-web-server/):

            ...

            ANSWER

            Answered 2021-Jan-09 at 19:57

            The problem is that s.accept() is a blocking call...it won't return until it receives a connection. This is why it pauses your loop.

            The easiest solution is probably to check whether or not a connection is waiting before calling s.accept(); you can do this using either select.select or select.poll. I prefer the select.poll API, which would end up looking something like this:

            Source https://stackoverflow.com/questions/65646815

            QUESTION

            NodeMCU Lua bme280: float values on integer build?
            Asked 2020-Dec-22 at 16:06

            How can I get float values from a BME280 on a integer build using the BME280 Lua module with bme280_math?

            Using the deprecated bme280 c-Module, for instance, temperature values were: temperature in °C * 100, getting float values was like:

            tempFloat = tostring(temp/100).."."..temp%100

            Now, with bme280 Lua module and bme280_math, the temperature is returned in °C, so on an integer build readings are now "24" instead of "24378". How to get "24378" again?

            ...

            ANSWER

            Answered 2020-Dec-22 at 16:06

            The bme280 lua module used on an integer build will return integer values with 1°C resolution only.

            Source https://stackoverflow.com/questions/65064892

            QUESTION

            Instantiate member from class inside library inside current class?
            Asked 2020-Oct-11 at 12:42

            I feel like I'm missing something obvious here and need it pointed out. I'm trying to create an instance of a struct that's a member of a class contained within a library that's been included in the current file, but inside a class I've defined myself. If I do this outside of the class, it works, but inside the class it appears to try to instantiate the struct as if it was a member of the parent class it's in.

            The library is for a BME280 sensor and the struct is to pass chip settings to the constructor of the main class that drives the sensor. Not even sure how to word this problem, but hopefully the code illustrates what I'm trying to say.

            If I instantiate this struct outside of a class it works fine,

            ...

            ANSWER

            Answered 2020-Oct-11 at 12:42

            Yes it is possible to default initialize members, although in the C++ standard in-class initialization can only use = or {}. This is better answered here.

            Using parentheses is confusing since it looks like a function declaration. IntelliSense is most likely complaining about error types since it thinks you are declaring a function with invalid types and a return type of BME280I2C::Settings (assuming the setting values you provided are values and not types).

            The initilization could look like this assuming there exists a non-explicit constructor (notice the change from () to {})

            Source https://stackoverflow.com/questions/64303701

            QUESTION

            Change a label value dynamically in Tkinter
            Asked 2020-Jul-11 at 17:46

            Fisrt of all i want to say that i am new in python I am trying to get the temperature value of a BME280 sensor and display it into a label widget via tkinter.

            Here is my sample code:

            ...

            ANSWER

            Answered 2020-Jul-11 at 17:46

            This is your code updated

            Source https://stackoverflow.com/questions/62850241

            QUESTION

            Why are includes not compatible with RTCZero library?
            Asked 2020-Mar-06 at 07:29

            Long story short, I am using RTCZero library to create an alarm to wake up my arduino, after some time, but I have ascertained, that when I add more sensors, with more libraries, RTC library is not compatible with them. I thought that it is caused my including , but problem still persists. Any solution?

            !!!EDIT!!!

            More precisely, I found, that problematic libraries are only these: Here you can download whole library (includes in this script are in). https://github.com/charles-the-forth/openCanSat-library

            ...

            ANSWER

            Answered 2020-Mar-06 at 07:29

            In the RTCZero.cpp you can see #include which is standard header and library rely on it.

            In linked library (openCanSat) you can see Time.h and Time.cpp which is some custom implementation of time functions and it's completely incompatible with standard time.h. However, because Arduino IDE is such a dummy IDE, the Time.h took precedence before time.h (this won't happen on OS with case sensitive filesystems - like linux, osx, ...). So you can either rename Time.h in the library, or you can try changing #include to #include , but it's probably including time.h too, so...

            Source https://stackoverflow.com/questions/60493372

            QUESTION

            I2C returning Busy or Error on memory reading
            Asked 2020-Jan-07 at 22:21

            I started the following code to handle a Bosch BME280 sensor with a Nucleo-F446ZE and a Nucleo-F411RE boards.

            ...

            ANSWER

            Answered 2020-Jan-05 at 20:20

            No, between HAL_I2C_Mem_Read and the HAL_I2C_Master_Transmit, wait, HAL_I2C_Master_Receive procedure is only a nuance cf How do I use the STM32CUBEF4 HAL library to read out the sensor data with i2c? . If you know what size of data you want to receive you can use the HAL_I2C_Master_Transmit, wait, HAL_I2C_Master_Receive procedure.

            A C++ HAL I2C example is in https://letanphuc.net/2017/05/stm32f0-i2c-tutorial-7/

            Source https://stackoverflow.com/questions/59599362

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install BME280

            You can download it from GitHub.
            You can use BME280 like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/robert-hh/BME280.git

          • CLI

            gh repo clone robert-hh/BME280

          • sshUrl

            git@github.com:robert-hh/BME280.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link