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: Thu, 20 Dec 2018 09:40:56 +0200	[thread overview]
Message-ID: <53682349-3998-63a7-db0f-ebd23eff6167@gmail.com> (raw)
In-Reply-To: <20181216155900.GA19465@himanshu-Vostro-3559>

Hello,


>> 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.
> 5 mins ? Are you sure ?
>
> Datasheet:
> ---------
>
> "The heating duration is specified by writing to the corresponding
> gas_wait_x<7:0> control register. Heating durations between 1 ms
> and 4032 ms can be configured. In practice, approximately 20–30 ms
> are necessary for the heater to reach the intended target temperature."
>
> For ensuring that the heater sink is heated to the target temperature, I
> added the following in the driver, and if it fails to do that we just
> abort:
>
> <snip>
>
> 729         /*
> 730          * occurs if either the gas heating duration was insuffient
> 731          * to reach the target heater temperature or the target
> 732          * heater temperature was too high for the heater sink to
> 733          * reach.
> 734          */
> 735         if ((check & BME680_GAS_STAB_BIT) == 0) {
> 736                 dev_err(dev, "heater failed to reach the target temperature\n");
> 737                 return -EINVAL;
> 738         }
>
> </snip>
>
> And now I wonder that -EINVAL isn't the best way to represent such a
> failure. -ERETRY or something more appropriate should have been used.
>
> That thread was about adding power management support + triggered buffer
> support.
>
> Device is already power managed as it automatically goes to sleep mode
> soon after a single TPHG cycle is performed.
>
> OTOH, I'm not brave and smart enough to add triggered buffer support
> even after the long string of email threads.
I don't know about data-sheet but when you rapidly read BME680 then 
resistance in VOC reader tends to rise something like 3-5 mins and then 
you can get 'correct' reading (rising stops in somepoint). To have 
something in kernel under public eye is brave enough :). But I have to 
investigate data-sheet better and see if I am doing something very very 
stupid and heater just heats up.
>>> 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.
> Sorry! I will try to recticy those and others that I have in mind, but
> might not quick about it.

No worries, take you time as I have 'working' solution and I can test 
new features as they appear as I have personal interest about this.

Sincerely,

Tuukka


      reply	other threads:[~2018-12-20  7:41 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
2018-12-16 15:59     ` Himanshu Jha
2018-12-20  7:40       ` Tuukka Pasanen [this message]

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=53682349-3998-63a7-db0f-ebd23eff6167@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).