Skip to content
Colin edited this page May 3, 2019 · 14 revisions

AS3935 Service

This is a service for weewx that collects lightning strike data (time of strike, distance to strike) using the AS3935 sensor attached to a Raspberry Pi. The service augments the standard weewx archive record and optionally saves per-strike data to a separate lightning strike database.

Download

http://lancet.mit.edu/mwall/projects/weather/releases/weewx-as3935-0.6.tgz

How to Install

  1. Run the extension installer:
wee_extension --install weewx-as3935-x.y.tgz
  1. Modify weewx.conf:
    [AS3935]
        address = 3
        bus = 1
  1. Restart weewx
sudo /etc/init.d/weewx stop
sudo /etc/init.d/weewx start

Configuration

The default configuration will add the fields lightning_strikes and avg_distance to each archive record.

To save these in the weewx database (so that they can be used in reports and plots), extend the database schema as explained in the weewx customization guide. You must add two columns, lightning_strikes and avg_distance.

Connecting the AS3935

  • AS3935 Pin --- Raspberry Pi Pin
  • (GND) --- 25 (Ground)
  • (VDD) --- 1 (3v3 Power)
  • (IRQ) --- 11 (GPIO 17)
  • (I2CL) --- 5 (SCL)
  • (I2CD) --- 3 (SDA)

Options

binding - Specify either loop or archive. Default is archive.

data_binding - To save the per-strike data to a separate, lightning database, use the data_binding option. For example,

[AS3935]
    ...
    data_binding = lightning_binding

[DataBindings]                             
    ...                                     
    [[lightning_binding]]                                                       
        database = lightning_sqlite                                             
        table_name = archive                                                    
        manager = weewx.manager.DaySummaryManager                               
        schema = user.as3935.schema                                             

[Databases]
    ...
    [[lightning_sqlite]]                                                        
        database_name = lightning.sdb                                           
        database_type = SQLite                                                  

will save data to a sqlite database in the same directory as the other weewx databases. The lightning database schema is a format that works with the weewx reporting and plotting utilities, so you can extract lightning data and use it in standard weewx reports and plots.

Clone this wiki locally
You can’t perform that action at this time.