linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tuukka Pasanen <pasanen.tuukka@gmail.com>
To: Himanshu Jha <himanshujha199640@gmail.com>
Cc: linux-iio@vger.kernel.org, dpfrey@gmail.com
Subject: Re: IIO BME680 driver
Date: Sun, 16 Dec 2018 16:39:40 +0200	[thread overview]
Message-ID: <6f1d36a0-f059-4c8b-4497-12c9b2c73a12@gmail.com> (raw)
In-Reply-To: <20181215191743.GA1263@himanshu-Vostro-3559>

Hello,

Hmm. Why would anyone want to play with those calibration constants
> programmed into the NVM of the sensor.
>
> And I wonder how the following came up ?
> https://github.com/pimoroni/bme680-python/blob/e827e5d622fd70df2aee6a68ebac626cf539ee55/library/bme680/__init__.py#L331
>
> These algorithms are provided by Bosch and probably should be used as-is
> unless you got some information from them. But I don't see any such
> reference in the datasheet nor in their API.
I think noone wants to tough those defaults. BME680 as said work as 
expected. Idea behind that line is when it's not getting correct value 
for temperature one adjust that little bit. It's ugly and it's not what 
datasheet or API tolds us todo but it's practical.
> Or it might be some heuristics. Not sure about it!
>
>> This one adjust temperature every time one reads it. For example my room
>> temperature is something like 21C (I live in north) and BME680 reports 28C
>> so humidity and pressure are incorrect (not much but notable).
> Now since you're using IIO driver, I see the problem here:
> https://github.com/torvalds/linux/blob/master/drivers/iio/chemical/bme680.h#L52
>
> 	#define BME680_AMB_TEMP				25
>
> Yes, it is hardcoded here and you should change it to according to your
> room temperature(20-21 degC).
Could this one turn into module parameter as it would be more 
convenient? As it's hard breaking in year 2019 to recompile kernel to 
make it fit to your room temperature. I can compile for testing but as I 
can imagine most of the earth population won't do it.
> There are two things that I shall be soon working on as soon as my
> current work with Zephyr ends:
>
> 1. add profile duration function
> 2. check for new available data before fetching
>   ... and more if anything comes up.

One thing that should be addressed is that if you only read one 
measurement and go to sleep then your VOC is incorrect as it needs 5 
mins or something to warm up. Of course I can read very rapidly to make 
that work and I assume that thread in mailing list with continous stream 
is all about that.

> Bosch claimed that new datasheet shall be soon be available with all the
> missing info, and then anyone wouldn't need to reverse engineer their API
> or BSEC to get the desired info :P
Hopefully this comes sooner than later as it would make things more easier
> Thank you for using the IIO driver and I'm glad that there are users out
> there testing it. Please let me know if there are any more issues :)

No problem.. I'll try to make it work as that Python library but I have 
to over come these few problems.

Sincerely,

Tuukka


  reply	other threads:[~2018-12-16 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <712905bc-4d81-0b38-44d6-d4f31f08c3ae@gmail.com>
2018-12-15 19:17 ` IIO BME680 driver Himanshu Jha
2018-12-16 14:39   ` Tuukka Pasanen [this message]
2018-12-16 15:59     ` Himanshu Jha
2018-12-20  7:40       ` Tuukka Pasanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f1d36a0-f059-4c8b-4497-12c9b2c73a12@gmail.com \
    --to=pasanen.tuukka@gmail.com \
    --cc=dpfrey@gmail.com \
    --cc=himanshujha199640@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).