Im using python2 so as to get a lightning detector to work to that Just had several lightning strikes overhead but it only recorded 1 strike 10km away and nothing else Can anybody recommend a lightning detector that does work connected to a raspberry pi via weewx The mod 1016 from EMBEDDED ADVENTURES has been mentioned but they dont seem to be in business anymore Thanks Phil
On Sunday, August 8, 2021 at 8:08:59 AM UTC+1 [email protected] wrote: > I think I have found the remaining Python 2 issue - 2to3 didnt find it > when I tried > > In as3935.py on line 73 change from: > > from RPi_AS3935 import RPi_AS3935 > > to: > > from RPi_AS3935.RPi_AS3935 import RPi_AS3935 > > Seems to be related to the situation discussed here > > https://stackoverflow.com/questions/4534438/typeerror-module-object-is-not-callable > On Saturday, 7 August 2021 at 02:06:07 UTC+12 [email protected] wrote: > >> Lightning all round today but the only log entries were when the >> lightning was over head 7 in total >> as3935: strike at 1.0 km >> Calibration = 6 , changed to 2 didn't seem to make any difference >> Storms now gone and still not sure if the dfrobot works that well >> >> >> >> On Saturday, July 31, 2021 at 1:06:06 PM UTC+1 [email protected] >> wrote: >> >>> In the as3935.py I noticed for LOOP working I have to put that in the >>> weewx.conf file which then showed lightning_strikes = 0 >>> When checking the weewx.sdb it didnt have a lightning_strikes field its >>> called lightning_strikes_count >>> When I added lighnting_strikes it now has a zero (0) in. >>> So has the field names changed ?? >>> The test will be when I get any lightning I shall keep you posted. >>> >>> >>> On Saturday, July 31, 2021 at 12:59:38 PM UTC+1 [email protected] >>> wrote: >>> >>>> In the as3935.py >>>> >>>> On Saturday, July 31, 2021 at 10:45:17 AM UTC+1 [email protected] >>>> wrote: >>>> >>>>> Thanks Doug but it didnt make any difference >>>>> As Im trying to use a DFRobot AS3935 I started again but this time on >>>>> Python2 >>>>> The i2cdetect -y 1 shows 03 show it appears the Raspberry Pi can see >>>>> the AS3935 >>>>> Using the simulator driver weewx now starts >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Initializing weewx >>>>> version 3.9.2 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Using Python 2.7.16 >>>>> (default, Oct 10 2019, 22:02:15) #012[GCC 8.3.0] >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Platform >>>>> Linux-5.10.52-v7+-armv7l-with-debian-10.10 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Locale is >>>>> 'en_GB.UTF-8' >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Using configuration >>>>> file /home/weewx/weewx.conf >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Loading station type >>>>> Simulator (weewx.drivers.simulator) >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: StdConvert target >>>>> unit is 0x1 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: wxcalculate: The following >>>>> values will be calculated: barometer=prefer_hardware, >>>>> windchill=prefer_hardware, dewpoint=prefer_hardware, >>>>> appTemp=prefer_hardware, rainRate=prefer_hardware, >>>>> windrun=prefer_hardware, >>>>> heatindex=prefer_hardware, maxSolarRad=prefer_hardware, >>>>> humidex=prefer_hardware, pressure=prefer_hardware, >>>>> inDewpoint=prefer_hardware, ET=prefer_hardware, >>>>> altimeter=prefer_hardware, >>>>> cloudbase=prefer_hardware >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: wxcalculate: The following >>>>> algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: service version is 0.6 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: address=0x03 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: bus=1 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: indoors=True >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: noise_floor=0 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: calibration=0x06 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: pin=17 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: data_binding=None >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: binding=archive >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Archive will use data >>>>> binding wx_binding >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Record generation >>>>> will be attempted in 'hardware' >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Using archive >>>>> interval of 300 seconds (specified in weewx configuration) >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Using binding >>>>> 'wx_binding' to database 'weewx.sdb' >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: manager: Starting backfill of >>>>> daily summaries >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: restx: StationRegistry: >>>>> Registration not requested. >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: restx: Wunderground: Posting >>>>> not enabled. >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: restx: PWSweather: Posting >>>>> not enabled. >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: restx: CWOP: Posting not >>>>> enabled. >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: restx: WOW: Posting not >>>>> enabled. >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: restx: AWEKAS: Posting not >>>>> enabled. >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Starting up weewx >>>>> version 3.9.2 >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Clock error is -0.20 >>>>> seconds (positive is fast) >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: engine: Starting main packet >>>>> loop. >>>>> Jul 31 10:17:47 raspberrypi weewx[2241]: as3935: noise level too high >>>>> - adjusting >>>>> Jul 31 10:20:14 raspberrypi weewx[2241]: manager: Added record >>>>> 2021-07-31 10:20:00 BST (1627723200) to database 'weewx.sdb' >>>>> Jul 31 10:20:14 raspberrypi weewx[2241]: manager: Added record >>>>> 2021-07-31 10:20:00 BST (1627723200) to daily summary in 'weewx.sdb' >>>>> Jul 31 10:20:20 raspberrypi weewx[2241]: cheetahgenerator: Generated 8 >>>>> files for report SeasonsReport in 3.38 seconds >>>>> Jul 31 10:20:21 raspberrypi weewx[2241]: imagegenerator: Generated 14 >>>>> images for SeasonsReport in 1.03 seconds >>>>> Jul 31 10:20:21 raspberrypi weewx[2241]: copygenerator: copied 5 files >>>>> to /home/weewx/public_html >>>>> Im using the zip file from as3935 · weewx/weewx Wiki · GitHub >>>>> <https://github.com/weewx/weewx/wiki/as3935> >>>>> Have loaded sudo pip install RPi_AS3935 and sudo pip install GPIO >>>>> In each 300second cycle I just get the last 5 lines from above with >>>>> nothing regarding the lightning detector >>>>> >>>>> The database has the lightning fields in but always shows NULL >>>>> There isn't any lightning about at present but just wondered if thats >>>>> correct >>>>> Using weewxd the loop string I don't see anything to do with lightning >>>>> . >>>>> Thanks for any help Phil >>>>> >>>>> >>>>> On Tuesday, July 27, 2021 at 1:50:36 PM UTC+1 [email protected] >>>>> wrote: >>>>> >>>>>> Phil: >>>>>> >>>>>> In looking at your weewx.conf, you may want to switch the process >>>>>> service to be before the comma. I think the error is because you are >>>>>> passing [None] as the first object in the process_services dictionary. >>>>>> >>>>>> [Engine] >>>>>> [[Services]] >>>>>> process_services = user.as3935.AS3935, >>>>>> >>>>>> After that, it maybe prudent to go through and covert the AS3935 code >>>>>> to python3 syntax. >>>>>> >>>>>> Doug >>>>>> >>>>>> On Tuesday, July 27, 2021 at 6:48:37 AM UTC-4 gjr80 wrote: >>>>>> >>>>>>> > Think I will try weewx 3.9.2, as I think that was the last python2 >>>>>>> version >>>>>>> >>>>>>> All WeeWX releases to date have been python 2 compatible, including >>>>>>> any 4.x releases. Python 4.0.0 and later are also python 3 compatible. >>>>>>> It >>>>>>> all comes down to what dependencies you have installed and what version >>>>>>> of >>>>>>> python WeeWX is run under. >>>>>>> >>>>>>> Gary >>>>>>> >>>>>>> On Tuesday, 27 July 2021 at 19:51:04 UTC+10 [email protected] >>>>>>> wrote: >>>>>>> >>>>>>>> Thanks Vince >>>>>>>> Changed Line 233 to except Exception as e: >>>>>>>> It then moved to Line 73 === no such module but sudo pip3 install >>>>>>>> RPi_AS3935 seems to have cured that (Installed ver 0.2.0 OK) >>>>>>>> Now it stuck on Line 153 'object not callable. (address=addr, >>>>>>>> bus=bus) >>>>>>>> In weewx.conf I have >>>>>>>> [AS3935] >>>>>>>> address = 3 >>>>>>>> bus = 1 >>>>>>>> Pin 17 >>>>>>>> calibration = 6 >>>>>>>> >>>>>>>> Think I will try weewx 3.9.2, as I think that was the last python2 >>>>>>>> version , just to see if my lighnting sensor does work. >>>>>>>> Phil >>>>>>>> >>>>>>>> On Monday, July 26, 2021 at 9:42:19 PM UTC+1 vince wrote: >>>>>>>> >>>>>>>>> See https://github.com/weewx/weewx/wiki/faq-python-error >>>>>>>>> >>>>>>>>> You have a variety of options: >>>>>>>>> >>>>>>>>> - find a later version of the driver/extension that supports >>>>>>>>> python3 >>>>>>>>> - patch your copy to be python3 compliant using 2to3 >>>>>>>>> - use python2 for your installation >>>>>>>>> >>>>>>>>> In your particular case it looks like the second option is pretty >>>>>>>>> trivial. >>>>>>>>> >>>>>>>>> Change the offending line to be >>>>>>>>> except Exception as e: >>>>>>>>> >>>>>>>>> And see if that works ok... >>>>>>>>> >>>>>>>>> -- 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/d57ae096-f92c-40a1-a953-4b20e519721bn%40googlegroups.com.
