Matt, Now loop is: LOOP: 2016-08-13 10:33:26 EDT (1471098806) altimeter: 29.8635077701, appTemp: 94.7688259312, avg_distance: None, barometer: 29.8360662872, cloudbase: 4003.54271204, dateTime: 1471098806, dewpoint: 71.542312067, extraTemp1: 87.4625, extraTemp2: 87.63116, extraTemp3: 86.9, heatindex: 92.3451290203, humidex: 103.061576293, inDewpoint: None, inTemp: 86.675, lightning: 0.0, lightning_strikes: 0, maxSolarRad: 696.962395133, outHumidity: 61.565803, outTemp: 86.3375, pressure: 29.1865367986, rain: 0.0, rainRate: 0, usUnits: 1, windchill: 86.3375, windDir: None, windSpeed: 0.0
Which shows that ii is working. I have enabled the lightning archive, now to wait for lightning. The hobbyboards unit showed 6 strikes this morning, but you never know if they are real. Steve On Saturday, September 20, 2014 at 12:54:13 PM UTC-4, WH3080 wrote: > > Hi, > > I purchased and installed the MOD1016 lightning sensor module from > embedded adventures ( > http://www.embeddedadventures.com/datasheets/MOD-1016_hw_v4_doc_v2.pdf > <http://www.google.com/url?q=http%3A%2F%2Fwww.embeddedadventures.com%2Fdatasheets%2FMOD-1016_hw_v4_doc_v2.pdf&sa=D&sntz=1&usg=AFQjCNFoa03dO7Q5AMK35TBgpuPJt9NiDA> > ). > > The module is based on the AS3935, a programmable fully integrated > Lightning Sensor IC that detects the presence and approach of potentially > hazardous lightning activity in the vicinity and provides an estimation on > the distance to the head of the storm. The embedded lightning algorithm > checks the incoming signal pattern to reject the potential man-made > disturbers ( > http://media.digikey.com/pdf/Data%20Sheets/Austriamicrosystems%20PDFs/AS3935.pdf > > <http://www.google.com/url?q=http%3A%2F%2Fmedia.digikey.com%2Fpdf%2FData%2520Sheets%2FAustriamicrosystems%2520PDFs%2FAS3935.pdf&sa=D&sntz=1&usg=AFQjCNFwuUEInVZELwzaV0znhI2LHEf1Rg> > ). > > I hooked the board up to my Raspberry Pi B+ through I2C. My Raspberry is > generally running headless, i.e. without a monitor or keyboard, except for > maintenance. Phil Fenstermacher published a python library ( > https://github.com/pcfens/RaspberryPi-AS3935), which I used for the > installation. The demo.py script is now running and actually detecting > lighning (which I verified with www.lightningmaps.org). > > The installation files are located in /home/pi/RaspberryPi-AS3935/ > > The demo script (below) is printing the results to the screen. I would of > course like to "reroute" this output into weewx and show it on exfoliation. > I searched the internet for an adaptable python script to accomplish that > goal, but failed. My own python knowledge is close to zero. > > Could you please help me to integrate the sensor output into weewex with > exfoliation? > > Minimal goal: > > Create an "automatic start script" that loads demo.py at the raspberry > startup automatically (like weewx). Print the output into a file (txt or > html) located in the the exfoliation folder containing all FTP upload data, > so it's automatically uploaded with all the orher exfoliation files. > > Maximum goal: > > True integration into weewx and exfoliation. Use the distance coding (0 - > 40 km) to create "perimeter" circles on a Google map within exfoliation, > load a "red alam banner" to display within exfoliation and have speex > exclaim the detected ligthning and distance on the homepage of the > exfoliation skin. > > I'm sorry to bother all of you with this probably very basic stuff, but > lightning detection is really exciting :-) > > Thanks, > > WH3080 > > --- > > This is the current demo.py code from Phil Fenstermacher: > > #!/usr/bin/env python > from RPi_AS3935 import RPi_AS3935 > import RPi.GPIO as GPIO > import time > from datetime import datetime > GPIO.setmode(GPIO.BCM) > # Rev. 1 Raspberry Pis should leave bus set at 0, while rev. 2 Pis should > set > # bus equal to 1. The address should be changed to match the address of the > # sensor. (Common implementations are in README.md) > sensor = RPi_AS3935(address=0x00, bus=0) > sensor.calibrate(tun_cap=0x0F) > sensor.set_indoors(True) > sensor.set_noise_floor(0) > def handle_interrupt(channel): > time.sleep(0.003) > global sensor > reason = sensor.get_interrupt() > if reason == 0x01: > print "Noise level too high - adjusting" > sensor.raise_noise_floor() > elif reason == 0x04: > print "Disturber detected - masking" > sensor.set_mask_disturber(True) > elif reason == 0x08: > now = datetime.now().strftime('%H:%M:%S - %Y/%m/%d') > distance = sensor.get_distance() > print "We sensed lightning!" > print "It was " + str(distance) + "km away. (%s)" % now > print "" > pin = 17 > GPIO.setup(pin, GPIO.IN) > GPIO.add_event_detect(pin, GPIO.RISING, callback=handle_interrupt) > print "Waiting for lightning - or at least something that looks like it" > while True: > time.sleep(1.0) >
