public class WSI603A extends SensorTask
To calibrate the anemometer, values above 100 increase the sensitivity; values less than 100 decrease the sensitivity. Calibration values can range from 1 to 199. Values of 0 or 200 and greater will use the factory default.
Note: the calibration value does not seem to have any effect with my eval WSI-603A.# Anemometer calibration value. 100 is standard; 0 uses factory default. WSI603A.task.calibration.anemometer=100To calibrate the windvane, observe the indicator error, and enter (360 - error) into windvane.task.device.offset. For example, if wind from due north registers 10 degrees, enter 360 - 10 = 350, as shown here:
# Windvane offset from true north (+0 degrees). windvane.task.device.offset=350The solar sensor is calibrated using the polynomial coefficients to provide the desired output characteristic, units and range. The coefficients are based on the equation y = C2 * x^2 + C1 * x + C0. For simple slope intercept behavior, set C2 = 0. Then, C1 is the slope, and C0 is the y-intercept.
#Solar intensity calibration coefficients C0;C1. hygrometer.task.calibration.solar=0.0;1.0;The AAG WSI603A has an internal microprocessor. Once per second, the microprocessor reads and updates the on-board 1-Wire devices. During this brief time, the WSI603A is offline, and not accessible to the 1-Wire host computer, so our attempts to read the device will fail. We need to read the results after each update. So we detect 1-Wire read back errors and checksum errors, and retry the operation until it is successful, which gets us past the update. The host computer and the microprocessor are both scheduled nominally for one second updates, but they are not locked to a common time base, so they will slowly drift in and out of phase. If you set the logging level to FINER, you will see clusters of these errors, as the host computer re-synchronizes with the on-board microprocessor. These errors are expected, and benign, which is why they are logged at the FINER logging level, and not the WARNING or SEVERE logging level.
Modifier and Type | Class and Description |
---|---|
private class |
WSI603A.TemperatureTask
Samples the temperature on the configured schedule.
|
private class |
WSI603A.WindTask
Samples the wind speed on the configured schedule.
|
Modifier and Type | Field and Description |
---|---|
private static int |
ANEMOMETER_CAL_CHECKSUM_INDEX
Wind speed calibration checksum index.
|
private static byte |
ANEMOMETER_CAL_COMMAND
Wind speed calibration command.
|
private static int |
ANEMOMETER_CAL_COMMAND_INDEX
Wind speed calibration command index.
|
private static int |
ANEMOMETER_CAL_COMMAND_LENGTH
Anemometer calibration command buffer length.
|
private static byte |
ANEMOMETER_CAL_EOM
Wind speed calibration end of message.
|
private static int |
ANEMOMETER_CAL_EOM_INDEX
Wind speed calibration end of message.
|
private static int |
ANEMOMETER_CAL_VALUE_INDEX
Wind speed calibration value index.
|
private byte[] |
anemometerCalCommandStream
Initialize anemometer command.
|
private long |
anemometerInterval
Anemometer sampling interval.
|
private java.lang.String |
anemometerTaskName
Name of anemometer task for posting data.
|
private static java.lang.String |
COMMAND_ERROR
Message format for command errors.
|
private com.dalsemi.onewire.container.OneWireContainer30 |
container
DS2760 memory sensor.
|
private static byte[] |
FAMILY
DS2760 High Precision Li-ion Battery Monitor family code.
|
private static int |
LED_CHECKSUM_INDEX
LED checksum byte index.
|
private static byte |
LED_COMMAND
LED command byte.
|
private static int |
LED_COMMAND_INDEX
LED command byte index.
|
private static int |
LED_COMMAND_LENGTH
LED command buffer length.
|
private static byte |
LED_EOM
LED end of message byte.
|
private static int |
LED_EOM_INDEX
LED end of message byte index.
|
private static int |
LED_LEVEL_INDEX
LED level byte index.
|
private static int |
LED_MODE_INDEX
LED mode byte index.
|
private static int |
LED_SET_STATUS_INDEX
LED status byte index.
|
private static int |
LED_THRESHOLD_INDEX
LED threshold byte index.
|
private byte[] |
ledControlCommandStream
Initialize LED command.
|
private static byte |
READ_DATA_COMMAND
Read data command byte.
|
private static byte |
READ_DATA_EOM
Read data end of message byte.
|
private double[] |
sCoeffs
Solar calibration coefficients.
|
private long |
solarInterval
Solar sampling interval.
|
private java.lang.String |
solarTaskName
Name of solar task for posting data.
|
private static long |
TASK_INTERVAL
WSI603A internal sampling interval.
|
private double[] |
tCoeffs
Temperature calibration coefficients.
|
private long |
temperatureInterval
Thermometer sampling interval.
|
private java.lang.String |
temperatureTaskName
Name of thermometer task for posting data.
|
private static java.lang.String |
TIMEOUT_ERROR
Message format for timeout errors.
|
private static java.lang.String |
VALIDATION_FAILED
Message format for validation (e.g., checksum) errors.
|
private static java.lang.String |
VALIDATION_ZERO
Message format for no data received.
|
private java.lang.String |
VALUE_ERROR_1
Value error message format for out of range exceptions.
|
private static byte |
WINDVANE_CAL_CHECKSUM
Wind direction calibration checksum.
|
private static byte |
WINDVANE_CAL_COMMAND
Wind direction calibration command.
|
private static byte |
WINDVANE_CAL_EOM
Wind direction calibration end of message.
|
private static byte |
WINDVANE_CAL_VALUE
Wind direction calibration value.
|
private long |
windvaneInterval
Windvane sampling interval.
|
private java.lang.String |
windvaneTaskName
Name of windvane task for posting data.
|
private static byte |
WSI603A_ERROR_COMMAND
Error response command.
|
adapter, address, cancel, CFG_DEVICE_ADDRESS_KEY, CFG_DEVICE_CHANNEL_KEY, CFG_DEVICE_OFFSET_KEY, CFG_DEVICE_SCALE_KEY, CFG_SAMPLING_INTERVAL_KEY, config, dataExchange, LOGGER, name, ONE_WIRE_TIMEOUT, population, SENSOR_TIMEOUT
Constructor and Description |
---|
WSI603A(java.lang.String name,
com.dalsemi.onewire.adapter.DSPortAdapter adapter,
java.util.Properties config,
IDataExchange dataExchange,
IServiceControl serviceControl)
Creates a new instance of WSI603A
|
beginExclusive, curveFit, doADConvertEFT, doADConvertEFT, doTemperatureConvertEFT, endExclusive, findContainerEFT, findContainerEFT, findContainerEFT, getADVoltageEFT, getADVoltageEFT, getTemperatureEFT, readBytesEFT, readCounterEFT, readDeviceEFT, readFileEFT, setMaxTemperatureResolutionEFT, stdDev, toHexString, toString, writeByteEFT, writeDeviceEFT
private static final java.lang.String VALIDATION_FAILED
private static final java.lang.String VALIDATION_ZERO
private static final java.lang.String TIMEOUT_ERROR
private static final java.lang.String COMMAND_ERROR
private final java.lang.String VALUE_ERROR_1
private static final byte READ_DATA_COMMAND
private static final byte READ_DATA_EOM
private static final byte LED_COMMAND
private static final byte LED_EOM
private static final int LED_COMMAND_INDEX
private static final int LED_MODE_INDEX
private static final int LED_SET_STATUS_INDEX
private static final int LED_LEVEL_INDEX
private static final int LED_THRESHOLD_INDEX
private static final int LED_CHECKSUM_INDEX
private static final int LED_EOM_INDEX
private static final int LED_COMMAND_LENGTH
private static final byte ANEMOMETER_CAL_COMMAND
private static final int ANEMOMETER_CAL_COMMAND_INDEX
private static final int ANEMOMETER_CAL_VALUE_INDEX
private static final int ANEMOMETER_CAL_CHECKSUM_INDEX
private static final byte ANEMOMETER_CAL_EOM
private static final int ANEMOMETER_CAL_EOM_INDEX
private static final int ANEMOMETER_CAL_COMMAND_LENGTH
private static final byte WINDVANE_CAL_COMMAND
private static final byte WINDVANE_CAL_VALUE
private static final byte WINDVANE_CAL_CHECKSUM
private static final byte WINDVANE_CAL_EOM
private static final byte WSI603A_ERROR_COMMAND
private static final byte[] FAMILY
private static final long TASK_INTERVAL
private java.lang.String anemometerTaskName
private java.lang.String solarTaskName
private java.lang.String temperatureTaskName
private java.lang.String windvaneTaskName
private long anemometerInterval
private long solarInterval
private long temperatureInterval
private long windvaneInterval
private double[] sCoeffs
private double[] tCoeffs
private final byte[] ledControlCommandStream
private final byte[] anemometerCalCommandStream
private com.dalsemi.onewire.container.OneWireContainer30 container
public WSI603A(java.lang.String name, com.dalsemi.onewire.adapter.DSPortAdapter adapter, java.util.Properties config, IDataExchange dataExchange, IServiceControl serviceControl)
name
- of this sensor task.adapter
- 1-Wire adapter.config
- configuration properties.dataExchange
- to notify with new data.serviceControl
- to schedule the task.