upgrade from 3.9.1 to 4 failed

123 views
Skip to first unread message

Neville Davis

unread,
May 21, 2020, 12:51:39 AM5/21/20
to weewx-user
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

gjr80

unread,
May 21, 2020, 1:04:50 AM5/21/20
to weewx-user
Hi,

Looks like you need to install the python module configobj. How you do that will depend on whether you are running WeeWX under python2 or python3.

I suspect you will be running under python 3 so use:

$ sudo apt install python3-configobj

if not under python2 use:

$ sudo apt install python-configobj

Once configobj is installed re-run the WeeWX installation.

Gary

Neville Davis

unread,
May 21, 2020, 1:07:36 AM5/21/20
to weewx-user
Thanks will look at it straight away

Nev

Neville Davis

unread,
May 21, 2020, 1:24:44 AM5/21/20
to weewx-user
Well that was it for that problem weewx installed but now I have a lot of red on status report.

My station is a home brew using i2C and other sensors this is reporting a hardware naming error ??

st login: Thu May 21 14:42:32 2020 from 192.168.0.54

pi@raspberrypi:~ $ sudo systemctl status weewx

weewx.service - LSB: weewx weather system

   Loaded: loaded (/etc/init.d/weewx)

   Active: active (exited) since Thu 2020-05-21 15:18:36 AEST; 54s ago

  Process: 419 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)


May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 72, in __init__

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****      self.preLoadServices(config_dict)

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 112, in preLoadServices

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****      self.stn_info = weewx.station.StationInfo(self.console, **conf...tation'])

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/station.py", line 41, in __init__

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****      if console and hasattr(console, 'hardware_name'):

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/drivers/__init__.py", line 17, in hardware_name

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****      raise NotImplementedError("Property 'hardware_name' not implemented")

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****  NotImplementedError: Property 'hardware_name' not implemented

May 21 15:18:36 raspberrypi weewxd[557]: weewx[557] CRITICAL __main__:     ****  Exiting.

Hint: Some lines were ellipsized, use -l to show in full.

pi@raspberrypi:~ $ 


Any ideas ?

Nev

On Thursday, May 21, 2020 at 2:51:39 PM UTC+10, Neville Davis wrote:

gjr80

unread,
May 21, 2020, 1:40:12 AM5/21/20
to weewx-user
Yes, the problem is that your driver has not implemented the hardware_name property. You will find it mentioned in the Implement the driver section of the Customization Guide. I cannot explain why the same driver worked under 3.9.1 (if it in fact did), as far as I am aware implementing the hardware_name property has always been mandatory.

Gary

Neville Davis

unread,
May 21, 2020, 1:45:37 AM5/21/20
to weewx-user
Ok I will look into it I have had the system running for a few years the last software update was to 3.9.1 when it came out...Its been some time since I visited my software about time i did it again.

Thanks for the info.

Nev

On Thursday, May 21, 2020 at 2:51:39 PM UTC+10, Neville Davis wrote:

gjr80

unread,
May 21, 2020, 1:48:19 AM5/21/20
to weewx-user
It doesn't need to be anything flash, just needs to implemented and return a string. You will find heaps of examples in the drivers in the weewx/drivers directory.

Gary

Neville Davis

unread,
May 21, 2020, 2:01:11 AM5/21/20
to weewx-user
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:

gjr80

unread,
May 21, 2020, 2:37:38 AM5/21/20
to weewx-user
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 is a good simple example.

Gary

Neville Davis

unread,
May 21, 2020, 3:35:55 AM5/21/20
to weewx-user
Well done those edits that problem with my driver cleared others have happened. I then tried to run on simulator and I get

weewx.service - LSB: weewx weather system

   Loaded: loaded (/etc/init.d/weewx)

   Active: active (exited) since Thu 2020-05-21 16:20:37 AEST; 1h 9min ago

  Process: 426 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)


May 21 16:20:37 raspberrypi weewxd[558]: weewx[558] CRITICAL __main__:     ****      if console and hasattr(console, 'hardware_name'):

May 21 16:20:37 raspberrypi weewxd[558]: weewx[558] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/drivers/__init__.py", line 17, in hardware_name

May 21 16:20:37 raspberrypi weewxd[558]: weewx[558] CRITICAL __main__:     ****      raise NotImplementedError("Property 'hardware_name' not implemented")

May 21 16:20:37 raspberrypi weewxd[558]: weewx[558] CRITICAL __main__:     ****  NotImplementedError: Property 'hardware_name' not implemented

May 21 16:20:37 raspberrypi weewxd[558]: weewx[558] CRITICAL __main__:     ****  Exiting.

May 21 16:39:53 raspberrypi systemd[1]: Started LSB: weewx weather system.

May 21 16:48:24 raspberrypi systemd[1]: Started LSB: weewx weather system.

May 21 16:58:44 raspberrypi systemd[1]: Started LSB: weewx weather system.

May 21 17:25:32 raspberrypi systemd[1]: Started LSB: weewx weather system.

May 21 17:30:24 raspberrypi systemd[1]: Started LSB: weewx weather system.

pi@raspberrypi:/home/weewx/bin/weewx/drivers $ 

 So now I have a bit of work to do.
I have another system I have started to build up so will proceed with that get the basic system working then find out why I am having issues with my driver.

Don' suppose there is a quick revert to version 3.9.1 ?? in the interim

Nev

On Thursday, May 21, 2020 at 2:51:39 PM UTC+10, Neville Davis wrote:

gjr80

unread,
May 21, 2020, 3:45:16 AM5/21/20
to weewx-user
You did a setup.py install so just install 3.9.1 over the top. The user directory won't be touched and of course backup your data. Might be worthwhile looking at the log rather than the abbreviated systemctl view, the last part of the systemctl output tells me nothing, there almost certainly will be more in the log.

A tip for posting logs too, rather than using systemctl status weewx run another terminal and tail the WeeWX log file (nominally /var/log/syslog) in that terminal with something like tail -f -n50 /var/log/syslog and take copies as required or edit and copy from the log file. that way you can get a longer log extract not the 'looking through a straw' view that systemctl gives you.

Gary

Neville Davis

unread,
May 21, 2020, 4:32:25 AM5/21/20
to weewx-user
Thanks very much Gary,,,,

Nev

Neville Davis

unread,
May 24, 2020, 9:37:59 PM5/24/20
to weewx-user
I have almost everything working in version 4, all my i2C modules are detected wind sensors air-conditioning data etc all except my 1wire rain system.
Everything is setup for python 3 so I understand from other posts of the issue with python-ow.
I installed ow-server and pyownet and I get this from the command prompt

pi@raspberrypi:/home/sensorreadings $ python getrain.py //localhost:4304/1D.E3AB0D000000/counter.B

       16570

pi@raspberrypi:/home/sensorreadings $ 

which is great and does show correct bucket tip info.

What I am now attempting to do (with very little success , i am blaming my age(75) :) is how to get the command line arguments required with the owget.py script and call that script from my main sensordata.py script (this collects all data from i2C network and wind.

What I want to end up with e.g 16570 returned to my main script and I process it further from there.

I have been looking at subprocess but I am way over my head and any guidance would be appreciated.


Neville

Neville Davis

unread,
May 25, 2020, 1:58:17 AM5/25/20
to weewx-user
I have managed to hack owget.py to output directly to a csv file I create in a ramdisk...and I get this by not entering any arguments..so a simple call to to owget.py.

Using this csv I will pull the data into my main sensor reading file.. 

The csv holds the correct data but I get some extra characters I will have to mask...so getting there :)

Neville

Neville Davis

unread,
May 25, 2020, 2:00:08 AM5/25/20
to weewx-user
Actually I will run my getrain.py as a service so all I will need to do is access the ramdisk.

Nev
Reply all
Reply to author
Forward
0 new messages