-
Notifications
You must be signed in to change notification settings - Fork 13
Simulator mode
Note, this function was intoduced in MQTTSubscribe version 3.0.
This runs MQTTSubscribe in an environment that is very close to running MQTTSubscribe with WeeWX. This serves the following purposes.
- The MQTTSubscribe configuration can be tested prior to updating the configuration (weewx.conf) being used by WeeWX.
- The MQTTSubscribe configuration can be debugged without having to update the configuration (weewx.conf) being used by WeeWX.
If running as a driver,
RUN_MODE=driver
If running as a service,
RUN_MODE=service
source ~/weewx-venv/bin/activate
WEEWX_ROOT=~/weewx-data
export USER_ROOT=$WEEWX_ROOT/bin/user
CONFIG_FILE=$WEEWX_ROOT/weewx.conf
WEECTL=weectl
WEEWX_ROOT=/etc/weewx/
export BIN_ROOT=/usr/share/weewx/
export USER_ROOT=$WEEWX_ROOT/bin/user
CONFIG_FILE=$WEEWX_ROOT/weewx.conf
WEECTL=weectl
WEEWX_REPO=~/weewx
WEEWX_ROOT=~/weewx-data
export BIN_ROOT=$WEEWX_REPO/src
export USER_ROOT=$WEEWX_ROOT/bin/user
CONFIG_FILE=$WEEWX_ROOT/weewx.conf
WEECTL=$WEEWX_REPO/bin/weectl
python3 $USER_ROOT/MQTTSubscribe.py simulate $RUN_MODE --help
The simulated archive delay in seconds.
The simulated archive interval in seconds.
The type of binding.
The WeeWX configuration file. Typicall weewx.conf.
Log to console in addition to syslog.
Log to specified file.
Specify the level of logging. Valid values are, DEBUG, INFO, TRACE.
The number of archive records to create.
The type of binding.
The WeeWX configuration file. Typically weewx.conf.
Log to console in addition to syslog.
The frequency that the simulated loop packets/archive records arrive.
Log to specified file.
Specify the level of logging. Valid values are, DEBUG, INFO, TRACE.
The number of archive records to create.
The default units if not in MQTT payload.
Getting Help
Feel free to open an issue, start a discussion in github, or post on WeeWX google group. When doing so, see Help! Posting to weewx user for information on capturing the log.
Getting Started
Prerequisites
Required MQTT information
Required WeeWX information
Installing MQTTSubscribe
Configuring MQTTSubscribe
Running MQTTSubscribe with WeeWX
Debugging
Common Options
Main section
The [[topics]]
section
The [[[message]]]
section
The [[[topic-name]]]
section
The [[[[field-name]]]]
section
Additional Options
Main section
The [[tls]]
section
The [[topics]]
section
The [[[topic-name]]]
section
The [[[[field-name]]]]
section
Example individual Configuration
Example Configuration with multiple types