Hi,

I don't think the BME280 extension is trying to do anything with the 
lightning data per se. If you look at the BME280 extension code you will 
see that it attempts to add temperature, pressure and humidity data to the 
loop packet. The last thing it does is log the packet. What I suspect is 
happening is the lightning data is already in the loop packet when the 
BME280 extension is executed (this is almost certainly the case if you are 
using the SDR driver). The BME280 is unable to obtain any temperature, 
pressure and humidity data but it still logs the packet before it exits 
hence you see a bme280: prefixed log entry with lightning data but no 
BME280 data.

I would be looking at these lines:

if all(must_have in packet for must_have in self.pressure_must_have): 
    pressurePA = (bme280data.pressure, 'mbar', 'group_pressure') 
    converted = converter.convert(pressurePA) 
    for key in self.pressureKeys: 
        packet[key] = converted[0] 
if all(must_have in packet for must_have in self.temperature_must_have): 
    temperatureC = (bme280data.temperature, 'degree_C', 'group_temperature') 
    converted = converter.convert(temperatureC) 
    for key in self.temperatureKeys: 
        packet[key] = converted[0] 
if all(must_have in packet for must_have in self.humidity_must_have): 
    humidityPCT = (bme280data.humidity, 'percent', 'group_percent') 
    converted = converter.convert(humidityPCT) 
    for key in self.humidityKeys: 
        packet[key] = converted[0]

The first log entry indicates the BME280 data is being successfully read but I 
suspect those three conditionals are failing somewhere and hence no BME280 data 
makes it into the packet.

Gary


On Sunday, 24 May 2020 10:15:05 UTC+10, Greg Gowins wrote:
>
>
> I posted this in another thread, but figured it might be better seen if I 
> started a new topic.
>
> For a while I have been running an Acurite 5-n-1 and Acurite Lightning 
> sensor via SDR, and have a BME280 connected to the Pi, with the weewx 
> extension from here to run it:  https://gitlab.com/wjcarpenter/bme280wx.  
>
> I upgraded to Weewx 4  from 3.9.1 last night, and everything seems to be 
> running ok except for weewx processing the data from the BME280.   When I 
> see it process, it appears to be trying to put the BME280 data into fields 
> for the lightning meter:
>
> May 23 10:02:13 weatherstation weewxd: bme280: BME280 data 
> compensated_reading(id=6e6ccd6e-39bd-42bb-8648-d9e1e855719c, 
> timestamp=2020-05-23 10:02:13.100774, temp=27.089 °C, pressure=977.55 hPa, 
> humidity=42.11 % rH)
> May 23 10:02:13 weatherstation weewxd: bme280: {u'distance': 0, 
> u'lastStrikeTime': 1590246128, u'strikes_total': 15, u'strikes': 0, 
> 'dateTime': 1590246128, 'usUnits': 1}
> May 23 10:02:13 weatherstation weewxd: sdr: MainThread: 
> packet={u'distance': 0, u'lastStrikeTime': 1590246128, 'dateTime': 
> 1590246128, 'usUnits': 1, u'strikes_total': 15}
> May 23 10:02:13 weatherstation weewx[593] INFO weewx.restx: MQTT: 
> Published record 2020-05-23 10:02:08 CDT (1590246128)
>
> It appears that somehow the barometric pressure info is making it into the 
> processing engine, as I'm getting barometric pressure successfully 
> calculated and displayed via Belchertown.  But the inTemp in the DB isn't 
> being populated from the BME280 so obviously no data displayed.  Any clue 
> on where to look for troubleshooting this one?  When I upgraded weewx to 4, 
> I used the existing weewx.conf.  I looked through the weewx.conf-4.0.0 to 
> to see if anything jumped out, but nothing did.  Any info is appreciated.  
> Thanks!
>
> Greg
>
>
>
>
>
>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/def94380-140a-49d8-bb4e-cde892e118d9%40googlegroups.com.

Reply via email to