Like I said I can't explain why this error would not come up with the same
driver under 3.9.1,I just checked the 3.9.1 documentation/code and
hardware_name was mandatory. In any case easy fixed, you just need
something like this in your driver class:
@property
def hardware_name(self):
return "MyDriverName"
Fileparse driver
<https://github.com/weewx/weewx/blob/master/examples/fileparse/bin/user/fileparse.py#L111>
is a good simple example.
Gary
On Thursday, 21 May 2020 16:01:11 UTC+10, Neville Davis wrote:
>
> This is my driver file, had no problems before.. but always a first time
> :)
>
> #
> # $Revision: 1 $
> # $Author: Nickolas McColl $
> # $Date: 2014-08-16 $
> # Initial information from above author further edits by Nev Davis
> # Latest edit 20 June 2017 by Nev Davis
>
> """Raspberry Pi driver for the weewx weather system"""
>
> from __future__ import with_statement
> import math
> import time
> import weewx.units
> import weedb
> import weeutil.weeutil
> import weewx.drivers
> import weewx.wxformulas
>
> DRIVER_NAME = 'PiWeather'
> DRIVER_VERSION = "1.9"
>
> def loader(config_dict, engine):
> return PiWeatherDriver(**config_dict[DRIVER_NAME])
>
> def confeditor_loader():
> return PiWeatherConfEditor()
>
> class PiWeatherDriver(weewx.drivers.AbstractDevice):
>
> def __init__(self, **stn_dict):
> self.loop_interval = float(stn_dict.get('loop_interval',2.5))
>
> def genLoopPackets(self):
> while True:
> start_time = time.time()
>
> # Create Loop packet
> f = open('/var/ramdisk/wxdata.csv')
> input = f.readline()
> f.close()
>
> data = input.split(',')
> if len(data) == 13: # data line is complete, process
> # if len(data) == 11:
> for i in range(1, (len(data))):
> try:
> data[i] = float(data[i])
> except ValueError:
> data[i] = None
>
> raw_time =time.strptime(data[0], "%Y-%m-%d %H:%M:%S")
>
> _packet = {'dateTime': int(time.mktime(raw_time)),
> 'usUnits' : weewx.METRIC,
> 'outTemp' : data[1],
> 'outHumidity' : data[2],
> 'windSpeed' : data[3], #use 3 second average
> 'windGust' : data[4], #use 3 second average
> 'windDir' : data[5],
> 'pressure' : data[6],
> 'extraTemp1' : data[7],
> 'inTemp' : data[8],
> 'inHumidity' : data[9],
> 'UV' : data[10],
> 'radiation' :data[11],
> 'farsSpeed' : data[12]
> }
> _packet['dewpoint'] =
> weewx.wxformulas.dewpointC(_packet['outTemp'], _packet['outHumidity'])
> #_packet['barometer'] =
> weewx.wxformulas.sealevel_pressure_Metric(_packet['pressure'], self.altitude,
> _packet['outTemp'])
> #_packet['altimeter'] =
> weewx.wxformulas.altimeter_pressure_Metric(_packet['pressure'], self.altitude)
> _packet['heatdeg'] =
> weewx.wxformulas.heating_degrees(_packet['outTemp'], 18.333)
> _packet['cooldeg'] =
> weewx.wxformulas.cooling_degrees(_packet['outTemp'], 18.333)
> _packet['heatindex'] =
> weewx.wxformulas.heatindexC(_packet['outTemp'], _packet['outHumidity'])
>
> yield _packet
>
> sleep_time = (start_time - time.time()) + self.loop_interval
> #sleep_time = self.loop_interval
> if sleep_time > 0:
> time.sleep(sleep_time)
>
> class PiWeatherConfEditor(weewx.drivers.AbstractConfEditor):
> @property
> def default_stanza(self):
> return
>
>
>
> On Thursday, May 21, 2020 at 2:51:39 PM UTC+10, Neville Davis wrote:
>>
>> the following from setup and status
>>
>> copying util/import/cumulus-example.conf -> /home/weewx/util/import
>>
>> copying util/launchd/com.weewx.weewxd.plist -> /home/weewx/util/launchd
>>
>> creating /home/weewx/util/default
>>
>> copying util/default/weewx -> /home/weewx/util/default
>>
>> running install_egg_info
>>
>> Writing /home/weewx/bin/weewx-4.0.0.egg-info
>>
>> Traceback (most recent call last):
>>
>> File "/home/weewx/bin/wee_config", line 12, in <module>
>>
>> import weeutil.logger
>>
>> File "/home/weewx/bin/weeutil/logger.py", line 14, in <module>
>>
>> import configobj
>>
>> ImportError: No module named 'configobj'
>>
>> *pi@raspberrypi*:*~ $* sudo systemctl status weewx
>>
>> *●* weewx.service - LSB: weewx weather system
>>
>> Loaded: loaded (/etc/init.d/weewx)
>>
>> Active: *failed* (Result: exit-code) since Thu 2020-05-21 14:41:54
>> AEST; 50s ago
>>
>> Process: 422 ExecStart=/etc/init.d/weewx start *(code=exited,
>> status=1/FAILURE)*
>>
>>
>> May 21 14:41:54 raspberrypi weewx[422]: Starting weewx weather system:
>> weewxTraceback (most recent call last):
>>
>> May 21 14:41:54 raspberrypi weewx[422]: File "/home/weewx/bin/weewxd",
>> line 21, in <module>
>>
>> May 21 14:41:54 raspberrypi weewx[422]: import weecfg
>>
>> May 21 14:41:54 raspberrypi weewx[422]: File
>> "/home/weewx/bin/weecfg/__init__.py", line 22, in <module>
>>
>> May 21 14:41:54 raspberrypi weewx[422]: import configobj
>>
>> May 21 14:41:54 raspberrypi weewx[422]: ImportError: No module named
>> 'configobj'
>>
>> May 21 14:41:54 raspberrypi weewx[422]: failed!
>>
>> May 21 14:41:54 raspberrypi systemd[1]: *weewx.service: control process
>> exited, code=exited status=1*
>>
>> May 21 14:41:54 raspberrypi systemd[1]: *Failed to start LSB: weewx
>> weather system.*
>>
>> May 21 14:41:54 raspberrypi systemd[1]: *Unit weewx.service entered
>> failed state.*
>>
>>
>> *What have I forgotten to do ???*
>>
>> *Nev*
>>
>
--
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/f76fdc4d-cb6c-4b1b-a0c8-daed1e455da0%40googlegroups.com.