diff --git a/TODO.txt b/TODO.txt index 804b49d2..c91e7382 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,10 @@ TODO: items for the next release; complete list is at github ------------------------------------------------------------------------------- +Uninstalling a non-existent extension gives a useless error. + +The option BIN_ROOT is getting accidentally injected into the config file. + Running wee_config without a command, for example, wee_config --driver=something should either return an error, or indicate that it did nothing. diff --git a/docs/customizing.htm b/docs/customizing.htm index 5e2cc762..319abc76 100644 --- a/docs/customizing.htm +++ b/docs/customizing.htm @@ -4224,8 +4224,127 @@ mv weewx.sdb_new weewx.sdb high-level description. If you're game, give it a try — I'm happy to help you out!
-Now that you have made some customizations, you might want to share +
+ A key feature of weewx is its ability to be + extended by installing 3rd party extensions, using a simple + tool. Take a look at the weewx + wiki for a sampling of some of the extensions that are available. +
+ ++ The utility wee_extension is used to add an + extension. It's worth running with the --help + option to see how it is used: +
+ ++cd /home/weewx +./bin/wee_extension --help+ +
This results in:
+ ++Usage: wee_extension --help + wee_extension --list + [CONFIG_FILE|--config=CONFIG_FILE] + wee_extension --install=(filename|directory) + [CONFIG_FILE|--config=CONFIG_FILE] + [--tmpdir==DIR] [--dry-run] [--verbosity=N] + wee_extension --uninstall=EXTENSION + [CONFIG_FILE|--config=CONFIG_FILE] + [--verbosity=N] + +Install, list, and uninstall extensions to weewx. + +Commands: + +--list: Show installed extensions. +--install: Install the specified extension. +--uninstall: Uninstall the specified extension. + +Options: + -h, --help show this help message and exit + --list Show installed extensions. + --install=FILENAME|DIRECTORY + Install the extension contained in FILENAME or + DIRECTORY. FILENAME must be an archive that contains a + packaged extension such as pmon.tar.gz. DIRECTORY + must be a packaged extension. + --uninstall=EXTENSION + Uninstall the extension with name EXTENSION. + --config=CONFIG_FILE Use configuration file CONFIG_FILE. + --tmpdir=DIR Use temporary directory DIR. + --bin-root=BIN_ROOT Look in BIN_ROOT for weewx executables. + --dry-run Print what would happen but do not do it. + --verbosity=N How much status to display, 0-3+ +
+ Let's try installing a simple extension, cmon, + used to monitor your computer. +
++ First download it. You can either do this from the link given in the + wiki, or by using wget (which you may have + to install): +
++wget -P /var/tmp http://lancet.mit.edu/mwall/projects/weather/releases/weewx-cmon-0.7.tgz+ +
+ This will put the tarfile weewx-cmon-0.7.tgz + in the directory /var/tmp. +
+Now install the extension:
++cd /home/weewx +./bin/wee_extension --install=/var/tmp/weewx-cmon-0.7.tgz +Request to install '/var/tmp/weewx-cmon-0.7.tgz' +Extracting from tarball /var/tmp/weewx-cmon-0.7.tgz +Added new service user.cmon.ComputerMonitor to process_services +Saving installer file to /home/weewx/bin/weecfg/user/installer/cmon +Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20150430130322 +Finished installing extension '/var/tmp/weewx-cmon-0.7.tgz'+
The installer has done a number of things for you:
+The utility wee_extension can tell you which extensions + you have installed:
+./bin/wee_extension --list +cmon+
You can see it lists the extension we just installed, cmon.
+ +Finally, you can remove an extension using the same tool:
+./bin/wee_extension --uninstall=cmon +./bin/wee_extension --list +No extensions installed+ +
Now that you have made some customizations, you might want to share those changes with other weewx users. Put your customizations into an extension to make installation, removal, and distribution easier.
diff --git a/docs/usersguide.htm b/docs/usersguide.htm index c32fc06c..f82a052c 100644 --- a/docs/usersguide.htm +++ b/docs/usersguide.htm @@ -1066,22 +1066,27 @@ Version: 3.1.0 setup.py instructions. -- When you install weewx for the first time, - the installation process will prompt you for the most essential - options, such as the type of hardware you are using, latitude, - longitude, or altitude. But, what if you want to change these later? You - could go into the definitive configuration file, weewx.conf, - which is described in detail in the next - section, but it's a big file with lots of nuances. Alternatively, if - you're just changing something simple, you may be able to - use the utility wee_config. -
-Before starting, it's worth running the utility with the --help option to see how - it is used:
-wee_config --help-
This results in:
++ When you install weewx for the first time, + the installation process will prompt you for the most essential + options, such as the type of hardware you are using, latitude, + longitude, or altitude. But, what if you want to change these later? + In particular, what if you want to change device drivers? You could + edit the definitive configuration file, weewx.conf, + by hand — described in detail in the next section + — but it's a big file with lots of nuances. Alternatively, if + you're just changing something simple, you may be able to use the + utility wee_config. +
+ ++ Before starting, it's worth running it with the --help option to see how it is used: +
+wee_config --help+
This results in:
Usage: wee_config --help
wee_config --version
@@ -1150,22 +1155,37 @@ Options:
--no-backup Do not save a backup of any existing files.
--debug Show diagnostic information while running.
- The utility is pretty good about "guessing" where your configuration - file weewx.conf is, but if you've done an - unusual install, you may have to tell it explicitly. You can either put - the location directly in the command line like this:
-wee_config /home/weewx/weewx.conf-
or use option --config:
-wee_config --config=/home/weewx/weewx.conf-
The most common use for wee_config is to - change device drivers. Say that you originally installed weewx - with the Simulator. Now you've bought a Davis Vantage and you want to switch - to that. Here's how you do it. First, if you don't know the name of the - driver, you can list what is available:
-wee_config --list-drivers-
This will result in something like this:
-++ The utility is pretty good about "guessing" where your configuration + file weewx.conf is, but if you've done an + unusual install, you may have to tell it explicitly. You can do this by + either putting the location directly in the command line: +
+ +wee_config /home/weewx/weewx.conf+ ++ or by using option --config: +
+ +wee_config --config=/home/weewx/weewx.conf+ +Changing device drivers
+ ++ The most common use for wee_config is to + change device drivers. Say that you originally installed + weewx with the Simulator. Now you've bought a + Davis Vantage and you want to switch to that. Here's how you do it. + First, if you don't know the name of the driver, you can list all the + drivers available in your weewx install: +
+ +wee_config --list-drivers+ +This will result in something like this:
+ +weewx.drivers.acurite AcuRite 0.16 weewx.drivers.cc3000 CC3000 0.8 weewx.drivers.fousb FineOffsetUSB 1.7 @@ -1180,30 +1200,75 @@ weewx.drivers.ws1 WS1 0.19 weewx.drivers.ws23xx WS23xx 0.22 weewx.drivers.ws28xx WS28xx 0.34-- From this, we can see that the name of the driver is weewx.drivers.vantage. Now run wee_config, with the --modify - command, specifying that driver: -
-wee_config --modify --driver=weewx.drivers.vantage++ From this list, we can see that the name of the driver is weewx.drivers.vantage. Now run wee_config, with the --modify + command, specifying that driver: +
+wee_config --modify --driver=weewx.drivers.vantage-- The utility will go through your previously selected options, such as - station description, latitude, longitude, altitude, etc.. Your - previously selected values, including the device driver, - will all be the defaults. So, all you have to do is keep hitting - enter. -
-- If this is too much trouble, you can specify the --no-prompt - option: -
++ The utility will go through your previously selected options, such as + station description, latitude, longitude, altitude, etc.. Your + previously selected values, including the specified device driver, + will all be the defaults. So, all you have to do is keep hitting + enter. This is what it looked like when I switched from the simulator + to the Vantage driver: +
++$ cd /home/weewx +$ ./bin/wee_config --modify --driver=weewx.drivers.vantage +Using configuration file /home/weewx/weewx.conf +Enter a brief description of the station, such as its location. For example: +Santa's Workshop, North Pole +description [Hood River, Oregon]: +Specify altitude, with units 'foot' or 'meter'. For example: +35, foot +12, meter +altitude [700, foot]: +Specify latitude in decimal degrees, negative for south. +latitude [45]: +Specify longitude in decimal degrees, negative for west. +longitude [-125]: +Indicate the preferred units for display: 'metric' or 'us' +units [metricwx]: +Installed drivers include: + 0) AcuRite (weewx.drivers.acurite) + 1) CC3000 (weewx.drivers.cc3000) + 2) FineOffsetUSB (weewx.drivers.fousb) + 3) Simulator (weewx.drivers.simulator) + 4) TE923 (weewx.drivers.te923) + 5) Ultimeter (weewx.drivers.ultimeter) + 6) Vantage (weewx.drivers.vantage) + 7) WMR100 (weewx.drivers.wmr100) + 8) WMR200 (weewx.drivers.wmr200) + 9) WMR9x8 (weewx.drivers.wmr9x8) + 10) WS1 (weewx.drivers.ws1) + 11) WS23xx (weewx.drivers.ws23xx) + 12) WS28xx (weewx.drivers.ws28xx) +choose a driver [6]: +Specify the hardware interface, either 'serial' or 'ethernet'. +If the station is connected by serial, USB, or serial-to-USB +adapter, specify serial. Specify ethernet for stations with +WeatherLinkIP interface. +type [serial]: +Specify a port for stations with a serial interface, for +example /dev/ttyUSB0 or /dev/ttyS0. +port [/dev/ttyUSB0]: +Saved backup to /home/weewx/weewx.conf.20150430084525 +Saved configuration to /home/weewx/weewx.conf +-wee_config --modify --driver=weewx.drivers.vantage --no-prompt++ If this is too much trouble, you can specify the --no-prompt + option: +
-This will accept all the defaults, including your new device - driver, without asking for any input.
+wee_config --modify --driver=weewx.drivers.vantage --no-prompt+ +This will accept all the defaults, including your new device + driver, without asking for any input.
Configuring weewx