ImportError: No module named serial

2,248 views
Skip to first unread message

vigilancewx

unread,
Nov 13, 2013, 2:59:00 PM11/13/13
to weewx...@googlegroups.com
Hi
I can run the Weewx software in simulator mode and it appears to be running ok
 
when I select vantage and plug the vantage in to the raspberry pi  USB socket  the syslog generates the following
 
 

Nov 13 19:15:41 raspberrypi weewx[2322]:     ****  Exiting.

Nov 13 19:29:54 raspberrypi weewx[2355]: wxengine: Initializing weewx version 2.5.0

Nov 13 19:29:54 raspberrypi weewx[2355]: wxengine: Using Python 2.7.3 (default, Jan 13 2013, 11:20:46) #012[GCC 4.6.3]

Nov 13 19:29:54 raspberrypi weewx[2355]: wxengine: Using configuration file /home/weewx/weewx.conf

Nov 13 19:29:54 raspberrypi weewx[2355]: wxengine: Loading station type Vantage (weewx.drivers.vantage)

Nov 13 19:29:54 raspberrypi weewx[2355]: wxengine: Unable to open WX station hardware: No module named serial

Nov 13 19:29:54 raspberrypi weewx[2355]: wxengine: Caught unrecoverable exception in wxengine:

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****  No module named serial

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****  Traceback (most recent call last):

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****    File "/home/weewx/bin/weewx/wxengine.py", line 886, in main

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****      engine = EngineClass(config_dict)

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****    File "/home/weewx/bin/weewx/wxengine.py", line 64, in __init__

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****      self.setupStation(config_dict)

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****    File "/home/weewx/bin/weewx/wxengine.py", line 96, in setupStation

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****      self.console = loader_function(config_dict, self)

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", line 31, in loader

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****      service = VantageService(engine, config_dict)

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", line 1413, in __init__

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****      Vantage.__init__(self, **config_dict['Vantage'])

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", line 390, in __init__

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****      self.port.openPort()

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", line 217, in openPort

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****      import serial

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****  ImportError: No module named serial

Nov 13 19:29:54 raspberrypi weewx[2355]:     ****  Exiting.

 

 

If I remove the usb cable and replace it the syslog generates and error on ttyUSB0

Nov 13 19:43:26 rasberrypi kernel: [2095.065466] usb 1-1,2: FTDI USB Serial Device converter now attached to ttyUSB0
 
 
and I have ttyUSB0 selected under the weewx confg file and "Vantage" selected
 
any ideas
 
thanks for any help
 

Thomas Keffer

unread,
Nov 13, 2013, 6:05:07 PM11/13/13
to weewx-user
From the log, it looks like you used the setup.py install method. Take a second look at the instructions: did you install python-serial?

-tk

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

vigilancewx

unread,
Nov 13, 2013, 6:20:35 PM11/13/13
to weewx...@googlegroups.com
Hi Tom
 
Thanks for the quick reply
 
I used sudo apt-get install python-usb
 
the install guide says
required if hardware is serial or USB
sudo apt-get install python-serial
sudo apt-get install python-usb
 
as I am only using a usb connection I only installed the usb option
 
do I need to install both
sudo apt-get install python-serial
and
sudo apt-get install python-usb
 
I did try the serial install after I failed to get a comms between weewx and the vantage but still no joy. Maybe I need to do a clean installation using both usb and serial
 
Rgds
 
David

Thomas Keffer

unread,
Nov 13, 2013, 6:26:12 PM11/13/13
to weewx-user
I know it's not obvious, but for the Vantage series it does not matter whether you have a serial or USB connector, they both use the serial package. The usb package is not needed. See the table http://weewx.com/docs/usersguide.htm#hardware

You say you installed python-serial? Let's test it. Try

$ python
>>> import serial

If it raises an exception, it's not on the system. Try installing again.

If that still doesn't work, there's something mighty unusual with your RPi and we'll take it from there.

-tk


--

vigilancewx

unread,
Nov 13, 2013, 6:49:41 PM11/13/13
to weewx...@googlegroups.com
just tried that and no problems found with
 
$ python
>>> import serial

no exceptions
 
this live fixing just rebooting it now
 
 
 
 
Hi Tom
 
Thanks for the quick reply
 
I used sudo apt-get install python-usb
 
the install guide says
required if hardware is serial or USB
sudo apt-get install python-serial
sudo apt-get install python-usb
 
as I am only using a usb connection I only installed the usb option
 
do I need to install both
sudo apt-get install python-serial
and
sudo apt-get install python-usb
 
I did try the serial install after I failed to get a comms between weewx and the vantage but still no joy. Maybe I need to do a clean installation using both usb and serial
 
Rgds
 
David
 
 
 
 
 
 

On Wednesday, November 13, 2013 7:59:00 PM UTC, vigilancewx wrote:

vigilancewx

unread,
Nov 13, 2013, 7:02:27 PM11/13/13
to weewx...@googlegroups.com
YES
 
Thanks for that
 
ok in now says my underground password is invalid ok we soon sort that out and its off download a lot of history from the vantage
 
wow big learn curve here
 
thanks again
 
I did try before to install the serial and usb but I think I had also changed it from ttyUSB0 to ttyusb1 kind of made my own mess. too many changes at once
 
 

On Wednesday, November 13, 2013 7:59:00 PM UTC, vigilancewx wrote:
Reply all
Reply to author
Forward
0 new messages