As a matter of style, imports like from grovepi import *
are dangerous. They can import random things which mask something else. It also makes it hard for an outsider to read your code, because it's impossible to tell where a variable might be coming from. Better to explicitly scope the thing you are importing, or, at least, import just what you need. I suspect the problem might be you have two definitions of self.bme280: self.bme280 = BME280(mode=BME280_OSAMPLE_8) def hardware_name(self): return DRIVER_NAME def bme280(self): The first definition will shadow the second. Is that what you intended? -tk On Thu, Oct 20, 2016 at 3:16 PM, 'Mike Whimick' via weewx-user < [email protected]> wrote: > Hello All, > > For the past few months I have been playing around at writing a new > driver. This week I have decided to change my current driver that uses > FileParse (which works ok-ish), to using loop packets, which I believe to > be more effient. > > Using my efforts and borrowing from other drivers I have created a small > part of my driver that uses data from a BME280 sensor, plugged into a > SwitchDoc labs Groveweather, the connect onto my GrovePi by the l2c port. > > So far my efforts at least runs on Weewx and as far as I know with out > throwing any errors which I check by using sudo tail -f /var/log/syslog. > How ever it does not appear to port date into Weewx. > > Please can some-one take a look at my code and point in the right > direction too getting it to work, so I may later add more sensors to it. > It is likely I have made some howling mistakes, for which I am sory. > > Many thanks Michael. > > -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
