So... I've recently set up one of these modules from DFRobot.  I started 
with their sample python code
and morphed into something that fits in my set of libraries.  In my case, I 
have it sending events out
via mqtt.  A quick look at the code doesn't give any hints to help you.  
>From the sample code, I set this up:
      #I2C address
      self.config['AS3935_I2C_ADDR1']   = 0x01
      self.config['AS3935_I2C_ADDR2']   = 0x02
      self.config['AS3935_I2C_ADDR3']   = 0x03
I think the hardware module has tiny switches to change it's address.

It's dead of winter here, so no lightning to detect for a few months.  I 
can share some of the code,
but not all.

Chris


On Friday, February 16, 2024 at 4:43:49 PM UTC-7 Pierre-Yves wrote:

> Finally, I succeeded to make the weewx running and capturing AS3935 
> lightning detector data
>
> For that, I had to force the detection of the i2c addresses from 0x03 to 
> 0x77 instead of 0x08 to 0x77 with the command:
> sudo i2cdetect -a -y 1 0x03 0x77
>
> I had also to add gpio to weewx group:
> sudo usermod -a -G gpio weewx
>
> PYB
> Le vendredi 16 février 2024 à 21:30:08 UTC+1, Pierre-Yves a écrit :
>
>> Hello All,
>>
>> Maybe a bit off-topic. But just in case someone would have faced to this 
>> strange behavior of a Raspberry i2c address map.
>>
>>
>> Rpi4-1: usual address map from 0x03 to 7x76.
>> Config.:
>> Weewx 4.10.2,
>> Bresser 7in1,
>> sdr driver,
>> RTC clock (UU),
>> BME280 (0x76) (pressure, temperature, humidity)
>> AS3935 (0x03) (lightning detector)
>>
>> Weewx on Rpi4-1 running without any error.
>>
>> pi@weewx:~ $ sudo i2cdetect -y 1
>>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
>> 00:          03 -- -- -- -- -- -- -- -- -- -- -- -- 
>> 10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- -- 
>> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
>> 70: -- -- -- -- -- -- 76 --                         
>> pi@weewx:~ $ 
>>
>> Rpi4-2: "abnormal" map with addresses 0x03 to 0x07 non selectable.
>> Config.:
>> Weewx 5.0.2,
>> Bresser 7in1,
>> RTC clock (UU),
>> AS3935 (??)
>>
>> Weewx on Rpi4-2 failing : File "/etc/weewx/bin/user/as3935.py", line 182, 
>> in __init__GPIO.setup(self.pin, GPIO.IN (see log below)
>>
>> pi@raspberrypi:~ $ sudo i2cdetect -y 1
>>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
>> 00:                         -- -- -- -- -- -- -- -- 
>> 10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- -- 
>> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
>> 60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
>> 70: -- -- -- -- -- -- -- --                         
>> pi@raspberrypi:~ $
>>
>> Clearly, the AS3935 is not identified because the 0x03 to 0x07 address 
>> range is not active. This AS3935 module works on the Rpi4-1
>>
>> Any idea on where this problem of misconfiguration could come from, 
>> firmware, kernel ?
>> Is there a way to reset the I2c address map ? 
>>
>> Thanks,
>>
>> Pierre-Yves
>>
>

-- 
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/97354093-f04c-4f9c-915b-4990b0634d2bn%40googlegroups.com.

Reply via email to