ModuleNotFoundError: No module named 'ecowitt'

160 views
Skip to first unread message

Invisible Man

unread,
Oct 13, 2022, 3:30:12 PM10/13/22
to weewx-user
Hi,
When I start Weewx, I encounter this error:
```
  File "/usr/share/weewx/weewx/wxservices.py", line 105, in __init__
    initialize=True)
  File "/usr/share/weewx/weewx/manager.py", line 597, in get_manager
    self.manager_cache[data_binding] = open_manager(manager_dict, initialize)
  File "/usr/share/weewx/weewx/manager.py", line 747, in open_manager
    manager_dict['schema'])
  File "/usr/share/weewx/weewx/manager.py", line 151, in open_with_create
    connection = weedb.connect(database_dict)
  File "/usr/share/weewx/weedb/__init__.py", line 86, in connect
    __import__(db_dict['driver'])
ModuleNotFoundError: No module named 'ecowitt'
```

I am not sure whether this means that my configuration file is wrong, or if I am starting the service in an incorrect way.

My configuration is quite special : I have two weather stations currently (an old one which I will remove in a couple of weeks, and a new one). The new one is an Ecowitt station, and I want to use the Weewx Interceptor for that.

As I have 2 weather stations, I need to start 2 weewx daemons. I tried https://github.com/weewx/weewx/wiki/weewx-multi which did not exactly work in my case. So, basically, I copied the /etc/init.d/weewx script, modified it to read another config (/etc/weewx/ecowitt.conf) + use another pid file.

As for my ecowitt.conf, I am not totally sure it is correct either.
At the end I have specified this, I think this is okay (+I'll configure the customized ecowitt to use port 8090)?

[Interceptor]
    driver = user.interceptor
    device_type = ecowitt-client
    port = 8090

I am unsure of the beginning of the configuration: I have said to use "simulator". Is that the correct way to do it?

[station]
...
station_type = Simulator

[Simulator]
    loop_interval = 2.5
    mode = simulator
    driver = weewx.drivers.simulator

Thanks for your help.
PS. This is Weewx 4.3.0 on a RPi4. I have installed the weewx-interceptor.

-- Axelle

vince

unread,
Oct 13, 2022, 3:40:37 PM10/13/22
to weewx-user
On Thursday, October 13, 2022 at 12:30:12 PM UTC-7 axelle....@gmail.com wrote:
The new one is an Ecowitt station, and I want to use the Weewx Interceptor for that.


It's always puzzling to me why users seem to frequently want to run the relatively complicated Interceptor driver when the much simpler and more stable Ecowitt driver is available....

 

Rainer Lang

unread,
Oct 13, 2022, 3:52:24 PM10/13/22
to weewx...@googlegroups.com

No, this is not correct.

The Simulator is only for Simulation as the name suggests - to show that weewx is - in principle - properly configured

You have to put station_type = Interceptor in the [Station] stanza in weewx.conf
and install the interceptor driver, which creates an [Interceptor] stanza in weewx.conf

the Interceptor stanza should look like:

[Interceptor]

    driver = user.interceptor
    device_type = ecowitt-client
    port = 8090

    iface = eth0   #or wlan0 depending on the network interface you/your server use/s

You will need to program the customized section of your weather service section of your control either inside the console or via the WS View (Plus) app
which has to match the Interceptor settings in weewx.conf

e.g.

protocol Ecowitt enabled
server - IP address of your weewx server
path - "/" without ""
port 8090
interval 16 seconds

Depending on your Ecowitt station, not all sensors might be shown as the Interceptor driver on GitHub only deals with the basic sensors rain, wind, solar, rain, temperature/humidity and air pressure.
You might need an extended version if you have more and different sensors, or - if you have a console/gateway with the GW1000/Ecowitt Gateway interface/API - use the weewx Ecowitt Gateway driver aka GW1000 API driver

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/065f4932-4280-4cd2-ba8f-6b29240fffacn%40googlegroups.com.

Rainer Lang

unread,
Oct 13, 2022, 3:57:27 PM10/13/22
to weewx-user
@vince - only consoles/gateways with the Ecowitt Gateway API can use the weewx Ecowitt Gateway driver. (GW1000, GW1100, GW2000, WH2650, WN19x0)

The others need to use the Interceptor driver for e.g. the WS2320E, WH2910, HP2551, HP2560, HP350x consoles.
So it depends on which Ecowitt (clone) console the user has.

Am 13.10.2022 um 21:40 schrieb vince:
On Thursday, October 13, 2022 at 12:30:12 PM UTC-7 axelle....@gmail.com wrote:
The new one is an Ecowitt station, and I want to use the Weewx Interceptor for that.


It's always puzzling to me why users seem to frequently want to run the relatively complicated Interceptor driver when the much simpler and more stable Ecowitt driver is available....

 
--
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 weewx-user+...@googlegroups.com.

Invisible Man

unread,
Oct 13, 2022, 4:05:42 PM10/13/22
to weewx-user
I have an Ecowitt HP2551 weather station, I don't have any Ecowitt GW1000 gateway with it, so to my understanding, I cannot use the Ecowitt driver. Or can I? ...
-- Axelle

Invisible Man

unread,
Oct 13, 2022, 4:19:43 PM10/13/22
to weewx-user
Ok, I fixed the station_type to Interceptor (of course, it makes sense !). But I still have the same error.

 File "/usr/share/weewx/weedb/__init__.py", line 86, in connect
    __import__(db_dict['driver'])
ModuleNotFoundError: No module named 'ecowitt'

  • FYI, in my case, it will be `iface = eth0`
  • "You will need to program the customized section of your weather service section of your control either inside the console" --> yes I have done that + I have verified manually that the interceptor receives the packets of the weather station (in my case: `sudo PYTHONPATH=. python3 ./user/interceptor.py --device=ecowitt-client --mode=listen --port=8090`)
  • "Depending on your Ecowitt station, not all sensors[..]" : it will be fine in my case because I only have basic sensors.

So there's an error somewhere else. I'm trying to manually start the weewx driver this way:

root@vegan:/home/axelle# /usr/bin/weewxd --pidfile=/var/run/ecowitt.pid /etc/weewx/ecowitt.conf

I attach my ecowitt.conf.

-- Axelle.
ecowitt.conf

Rainer Lang

unread,
Oct 13, 2022, 4:41:52 PM10/13/22
to weewx-user
Hi Axelle

I think I found your error - in weewx conf
while it is correct to change the database name to distinguish it from your second instance database, you shouldn't change the database driver
(unless you have an extra one - which you most likely don't have).

[DatabaseTypes]
    
    # Defaults for SQLite databases
    [[SQLite]]
        driver = ecowitt.sqlite
        # Directory in which the database files are located
        SQLITE_ROOT = /home/weewx/archive

should be replaced by

[DatabaseTypes]
    
    # Defaults for SQLite databases
    [[SQLite]]
        driver = weedb.sqlite
        # Directory in which the database files are located
        SQLITE_ROOT = /home/weewx/archive

tant pis ! Ca devrait marcher maintenant 😉

Tom Keffer

unread,
Oct 13, 2022, 4:45:41 PM10/13/22
to weewx...@googlegroups.com
In your [DatabaseTypes] section you have the driver listed as "ecowitt.sqlite", when what you want is "weedb.sqlite". Same with the mysql driver.

[DatabaseTypes]
   
    # Defaults for SQLite databases
    [[SQLite]]
        driver = ecowitt.sqlite
        # Directory in which the database files are located
        SQLITE_ROOT = /home/weewx/archive

gjr80

unread,
Oct 13, 2022, 7:09:35 PM10/13/22
to weewx-user
And you might want to replace your Twitter credentials, you should always check WeeWX config files for sensitive information (and obfuscate such information) before posting config files.

Gary

vince

unread,
Oct 13, 2022, 7:39:36 PM10/13/22
to weewx-user
On Thursday, October 13, 2022 at 12:57:27 PM UTC-7 lang....@googlemail.com wrote:
@vince - only consoles/gateways with the Ecowitt Gateway API can use the weewx Ecowitt Gateway driver. (GW1000, GW1100, GW2000, WH2650, WN19x0)

The others need to use the Interceptor driver for e.g. the WS2320E, WH2910, HP2551, HP2560, HP350x consoles.
So it depends on which Ecowitt (clone) console the user has.


Thanks.  The original poster didn't say which model station they had so I wrongly guessed there. 

Invisible Man

unread,
Oct 14, 2022, 3:23:10 AM10/14/22
to weewx-user
Thanks for spotting this Rainer and Tom. I fixed the database driver name, and it works just fine :) Weewx has started processing packets for the weather station :) Thanks !
Reply all
Reply to author
Forward
0 new messages