Well, as I'm rather new to this I don't feel really confident writing a 
description, but I'll try the best I can!

1. First I got the CJMCU as3935 chip soldered and hooked up to my RPi3B+, 
connections as follows:
        VCC -> 3.3V
        GND -> GND
        SCL -> PIN 5
        MOSI -> PIN 3
        SI -> 3.3V
        A0 -> 3.3V
        A1 -> 3.3V
Connected with a breadborad.

2. In terminal, run "sudo i2cdetect -y 1" to see if the chip is connected, it 
should show 0x03.

3.Now install 
http://lancet.mit.edu/mwall/projects/weather/releases/weewx-as3935-0.6.tgz 
following the instructions.
 (I did install another one also but I assume this one is the right one)

4. Open /usr/share/weewx/user/extensions.py in a text editor and add these 
lines at the bottom of the file:
  
  import schemas.wview
  schema_with_lightning_strikes = schemas.wview.schema + [('avg_distance', 
'REAL'), ('lightning_strikes', 'REAL')]
  import weewx.units
  weewx.units.obs_group_dict['avg_distance'] = 'group_distance'
  weewx.units.obs_group_dict['lightning_strikes'] = 'group_count'
  weewx.units.default_unit_format_dict['count'] = '%.0f'
  weewx.units.default_unit_label_dict['count'] = ''


5. My settings in weewx.conf: 

[AS3935]
    bus = 1
    indoors = false # set to True if indoors
    noise_floor = 0
    calibration = 6
    pin = 17
    address = 3
    binding = archive

Under [Databindings]
        [[wx_binding]]

Add this:   schema = user.extensions.schema_with_lightning_strikes
And put a # in front of schema = schemas.wview.schema (guess this replace the 
schema to use the new one.)

6. Stop WeeWX.
7. Make a backup of the weewx database file. Located under: /var/lib/weewx
8.Run sudo wee_database weewx.conf --reconfigure - You will need to specify the 
full path to weewx.conf (e.g. /home/weewx/weewx.conf or /etc/weewx/weewx.conf)
9. Replace the old database file with the new one.
10. Run sudo wee_database --rebuild-daily
11. Restart WeeWX.

(To add the new observation type I followed: 
https://github.com/poblabs/weewx-belchertown/wiki/Adding-a-new-observation-type-to-the-WeeWX-database)

I think this is how I got running, with alot of help from Gary(gjr80)
And maybe this isn't the correct way to make a description, but now it's done!

Please feel free to make any corrections to my descriptions, I'm might have got 
somethings wrong and maybe forgot some step :)
And remember to backup your database file and maybe your weewx setup before 
doing any changes!

Let me know if there are some questions and I'll see if I remember something 
leftout!

//Mikael

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/51a2815a-c7c8-41c9-8134-ae8c3c5a6048%40googlegroups.com.

Reply via email to