If you do the innocent thing and simply install with easy_install or pip, you'll get the latest version of pyserial which, unfortunately, is V3.4, which does not support Python 2.6.
Easy mistake to make. I added a note to the User's Guide <https://github.com/weewx/weewx/commit/eb2760f9c7e6226838205d02b68eb1f51433582f> . -tk On Sun, Aug 13, 2017 at 11:14 AM, Andrew Pounds <[email protected]> wrote: > That fixed it! > > Not sure where the version of pyserial came from, it was the one that > loaded when I did the easy_install. I installed python-pip and used pip > to uninstall the pyserial version 3. I then followed your link to get the > source to V2.7 of pyserial and installed it. I went back to the RPM > version of weewx and reinstalled it, used the configuration file I > previously generated, and everything worked perfectly. Am now sending > data to weather servers. > > Many thanks for the quick response. > > > On Sunday, August 13, 2017 at 10:29:01 AM UTC-4, Tom Keffer wrote: >> >> Unfortunately, pyserial v3.x does not support Python v2.6. Only Python >> V2.7 <https://pythonhosted.org/pyserial/pyserial.html#requirements>. >> >> You will have to install pyserial v2.7. You can get it on SourceForge >> <https://sourceforge.net/projects/pyserial/files/pyserial/2.7/>. >> >> Do you know where your version of pyserial came from? You should >> uninstall it with whatever method is appropriate for your install method. >> Then install pyserial v2.7. >> >> -tk >> >> >> >> On Sun, Aug 13, 2017 at 6:10 AM, Andrew Pounds <[email protected]> >> wrote: >> >>> I'm having the same problem. I tried installing from both the rpm as >>> well as the setup.py method. Here is what went into /var/log/messages >>> >>> Aug 13 08:21:21 localhost weewx[12706]: engine: Initializing weewx >>> version 3.7.1 >>> Aug 13 08:21:21 localhost weewx[12706]: engine: Using Python 2.6.6 >>> (r266:84292, Aug 18 2016, 15:13:37) #012[GCC 4.4.7 20120313 (Red Hat >>> 4.4.7-17)] >>> Aug 13 08:21:21 localhost weewx[12706]: engine: Platform >>> Linux-2.6.32-696.6.3.el6.x86_64-x86_64-with-centos-6.9-Final >>> Aug 13 08:21:21 localhost weewx[12706]: engine: Locale is 'en_US.UTF-8' >>> Aug 13 08:21:21 localhost weewx[12706]: engine: Using configuration file >>> /home/weewx/weewx.conf >>> Aug 13 08:21:21 localhost weewx[12706]: engine: Loading station type >>> Vantage (weewx.drivers.vantage) >>> Aug 13 08:21:21 localhost weewx[12706]: import of driver failed: zero >>> length field name in format (<type 'exceptions.ValueError'>) >>> Aug 13 08:21:21 localhost weewx[12706]: engine: Unable to load driver: >>> zero length field name in format >>> Aug 13 08:21:21 localhost weewx[12706]: **** Exiting... >>> >>> If I use wee_device to try and look at the Davis station I get something >>> similar... >>> [root@localhost bin]# ./wee_device ../weewx.conf --info >>> Using configuration file ../weewx.conf >>> Using Vantage driver version 3.0.10 (weewx.drivers.vantage) >>> Traceback (most recent call last): >>> File "./wee_device", line 54, in <module> >>> main() >>> File "./wee_device", line 51, in main >>> device.configure(config_dict) >>> File "/home/weewx/bin/weewx/drivers/__init__.py", line 69, in >>> configure >>> self.do_options(options, parser, config_dict, prompt) >>> File "/home/weewx/bin/weewx/drivers/vantage.py", line 1834, in >>> do_options >>> station = Vantage(**config_dict[DRIVER_NAME]) >>> File "/home/weewx/bin/weewx/drivers/vantage.py", line 476, in __init__ >>> self.port.openPort() >>> File "/home/weewx/bin/weewx/drivers/vantage.py", line 283, in openPort >>> self.serial_port = serial.Serial(self.port, self.baudrate, >>> timeout=self.timeout) >>> File >>> "/usr/lib/python2.6/site-packages/pyserial-3.4-py2.6.egg/serial/serialutil.py", >>> line 240, in __init__ >>> self.open() >>> File >>> "/usr/lib/python2.6/site-packages/pyserial-3.4-py2.6.egg/serial/serialposix.py", >>> line 272, in open >>> self._reconfigure_port(force_update=True) >>> File >>> "/usr/lib/python2.6/site-packages/pyserial-3.4-py2.6.egg/serial/serialposix.py", >>> line 345, in _reconfigure_port >>> ispeed = ospeed = getattr(termios, 'B{}'.format(self._baudrate)) >>> ValueError: zero length field name in format >>> >>> >>> Hope that helps. I need to get this solved too as I would love to >>> port my weather stations over to weewx. >>> >>> >>> On Friday, March 17, 2017 at 7:14:14 PM UTC-4, Tom Keffer wrote: >>>> >>>> Not a lot to go on here. >>>> >>>> Nothing in weewx uses the function str.format(), so I'm not sure what >>>> is creating this exception. >>>> >>>> Weewx should run on Python v2.5, v2.6, or v2.7. >>>> >>>> Could you please try running weewxd directly from the command line >>>> <http://weewx.com/docs/usersguide.htm#Running_directly>? It should >>>> show you the stack trace. >>>> >>>> -tk >>>> >>>> >>>> On Fri, Mar 17, 2017 at 1:50 PM, gearoid <[email protected]> wrote: >>>> >>>>> engine: Loading station type Vantage >>>>> (weewx.drivers.vantage) >>>>> >>>>> Mar 17 19:53:57 weewx[1915]: import of driver failed: zero length >>>>> field name in format (<type 'exceptions.ValueError'>) >>>>> >>>>> Mar 17 19:53:57 weewx[1915]: engine: Unable to load driver: zero >>>>> length field name in format >>>>> >>>>> Mar 17 19:53:57 weewx[1915]: **** Exiting... >>>>> >>>>> Is there a 2.7 requirement ? >>>>> >>>>> >>>>> Also, To get this far I had to install the backport of >>>>> python-importlib from the EPEL, which resolved the following: >>>>> >>>>> import of driver failed: No module named importlib (<type >>>>> 'exceptions.ImportError'>) >>>>> >>>>> >>>>> -- >>>>> 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]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> 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]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > 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]. > For more options, visit https://groups.google.com/d/optout. > -- 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]. For more options, visit https://groups.google.com/d/optout.
