Geolux HydroCam topic
- Introduction
- Sensor Datasheet
- Sensor Constructor
- Example Code
- Reference
- Detailed Descriptions
Classes for the Geolux HydroCam cameras.
Introduction
The Geolux HydroCam is a monitoring camera specifically designed for remote visual observation of the hydrological monitoring site. Versatile communication interfaces (RS-232, RS-485, CAN, SDI-12, Ethernet) enable easy integration with Geolux or third-party dataloggers. Integrated switchable day/night filters and a high-quality motorized zoom/focus lens enable the Geolux HydroCam to withstand wide temperature ranges and operation in almost any environmental monitoring application.
The Geolux HydroCam is supported using RS232 communication. You must have an RS232-to-TTL adapter to be able to communicate with the HydroCam. The only possible speed for communication is 115200. This is too fast for an 8MHz board like the EnviroDIY Mayfly.
Please see the section "[Notes on Arduino Streams and Software Serial](@ref page_arduino_streams)" for more information about what streams can be used along with this library.
This library currently only supports using the same SD card for saving images as is used for writing data files.
Keep in mind when using the HydroCam that transferring images from the camera to the SD card is a slow process. For the smallest images (160x120) the transfer time can be as little as 850ms, but the largest images (2592x1944) can take 70 seconds (over a minute) to transfer.
If you choose to autofocus on every image, the autofocus takes 25-30s on firmware prior to version 2, and about 7s on version 2.0.5.
Changing settings takes up to 7s.
Taking an image (but not transferring the data) takes ~6.2s for the smallest images and over 16s for the largest.
Sensor Datasheet
Sensor Constructor
GeoluxHydroCam:: GeoluxHydroCam(Stream* stream,
int8_t powerPin,
Logger& baseLogger,
int8_t powerPin2,
const char* imageResolution = "1600x1200",
const char* filePrefix = nullptr,
bool alwaysAutoFocus = false)
Construct a new Geolux HydroCam object.
Parameters | |
---|---|
stream | An Arduino data stream for RS232 communication. See notes for more information on what streams can be used. |
powerPin | The pin on the mcu controlling power to the Geolux HydroCam. Use -1 if it is continuously powered.
|
baseLogger | The logger instance with an attached SD card. |
powerPin2 | The pin on the mcu controlling power to the RS232 adapter, if it is different from that used to power the sensor. Use -1 or omit if not applicable. |
imageResolution | The image resolution to use. Optional with a default value of "1600x1200". |
filePrefix | The start of the file name for saved files. An underscore and then the date and time will be appended to the prefix to create the filename. The extension will always be #HYDROCAM_FILE_EXTENSION (.jpg). Optional with a default value of nullptr. If you want only the date/time as the file name specify "" as the filename prefix. If you do not specify any file prefix, the logger ID will be used |
alwaysAutoFocus | True to autofocus before every image. This may be necessary if the camera is power cycled between images. If you are not power cycling or moving the camera, I recommend not autofocusing often because the autofocus takes about 30s. Default false. |
The RESOLUTION parameter must be one of the following:
- "160x120" (4:3, 0.019 megapixel, Quarter-QVGA, QQVGA)
- "320x240" (4:3, 0.077 megapixel, Quarter VGA , QVGA)
- "640x480" (4:3, 0.307 megapixel, VGA)
- "800x600" (4:3, 0.48 megapixel, Super VGA, SVGA)
- "1024x768" (4:3, 0.79 megapixel, XGA)
- "1280x960" (4:3, 1.23 megapixel, QuadVGA)
- "1600x1200" (4:3, 1.92 megapixel, Ultra-XGA, UXGA)
- "1920x1080" (16:9, 2.07 megapixel, 1080p, Full HD, FHD)
- "2048x1536" (4:3, 3.15 megapixel, Quad-XGA, QXGA)
- "2592x1944" (4:3, 5.04 megapixel, 1944p)
Example Code
The Geolux HydroCam is used in the menu a la carte example.
Classes
- class GeoluxHydroCam
- The Sensor sub-class for the Geolux HydroCam cameras.
- class GeoluxHydroCam_ImageSize
- The Variable sub-class used for the image size output from a Geolux HydroCam camera.
- class GeoluxHydroCam_ByteError
- The Variable sub-class used for the byte error output from a Geolux HydroCam camera.
Defines
- #define HYDROCAM_FILE_EXTENSION = ".jpg"
- The file extension for images from the Geolux HydroCam: ".jpg".
- #define HYDROCAM_MINIMUM_STATUS_SPACING = 250
- The minimum spacing between requesting status messages from the HydroCam.
Sensor Variable Counts
The number of variables that can be returned by Geolux HydroCam
- #define HYDROCAM_NUM_VARIABLES = 2
- Sensor::
_numReturnedValues; the HydroCam can report 2 values. - #define HYDROCAM_INC_CALC_VARIABLES = 0
- Sensor::
_incCalcValues; we don't calculate any additional values.
Sensor Timing
The sensor timing for a Geolux HydroCam
- #define HYDROCAM_WARM_UP_TIME_MS = 350
- Sensor::
_warmUpTime_ms; warm up time from power on until boot message finishes is nearly exactly 340ms on firmware 1.3.6 and about 490ms on firmware 2.0.5. - #define HYDROCAM_STABILIZATION_TIME_MS = 11
- Sensor::
_stabilizationTime_ms; the HydroCam is ready after a minimum of about 11ms after the end of the boot up message. Changing settings takes up to 7s. Running an autofocus takes about 25-30s. - #define HYDROCAM_STABILIZATION_TIME_MAX = 16000L
- The maximum time to wait for boot + settings.
- #define HYDROCAM_AUTOFOCUS_TIME_MS = 7250L
- Minimum time to wait for an autofocus. Running an autofocus takes about 25-30s on firmwares <2.0.1, but only ~7.5s on firmwares >=2.0.1.
- #define HYDROCAM_AUTOFOCUS_TIME_MAX = 35000L
- The maximum time to wait for autofocus. This is combined with the stabilization time.
- #define HYDROCAM_MEASUREMENT_TIME_MS = 3800L
- Sensor::
_measurementTime_ms; the HydroCam imaging time is variable depending on the image size, but the typical minimum I've seen for the smallest image (160x120) is ~3.8s on firmware >2.0.1. The largest image takes over 16s on firmwares <2.0.1. - #define HYDROCAM_MEASUREMENT_TIME_MAX = 18000L
- The maximum time to wait for an image.
Image Size
The image size variable from a Geolux HydroCam
This variable represents the number of bytes transferred to the SD card, not necessarily (but hopefully) the size of the image as reported by the camera
GeoluxHydroCam_ ImageSize:: GeoluxHydroCam_ImageSize(GeoluxHydroCam* parentSense,
const char* uuid = "",
const char* varCode = "HydroCamImageSize") explicit
Construct a new GeoluxHydroCam_
Parameters | |
---|---|
parentSense | The parent GeoluxHydroCam providing the result values. |
uuid | A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string. |
varCode | A short code to help identify the variable in files; optional with a default value of "HydroCamImageSize". |
- #define HYDROCAM_SIZE_RESOLUTION = 0
- Decimals places in string representation; image size should have 0 - resolution is 1 byte.
- #define HYDROCAM_SIZE_VAR_NUM = 0
- Sensor variable number; image size is stored in sensorValues[0].
- #define HYDROCAM_SIZE_VAR_NAME = "imageSize"
- Variable name in ODM2 controlled vocabulary; "imageSize".
- #define HYDROCAM_SIZE_UNIT_NAME = "byte"
- Variable unit name in ODM2 controlled vocabulary; "byte".
- #define HYDROCAM_SIZE_DEFAULT_CODE = "HydroCamImageSize"
- Default variable short code; "HydroCamImageSize".
Byte Error
The byte error variable from a Geolux HydroCam
GeoluxHydroCam_ ByteError:: GeoluxHydroCam_ByteError(GeoluxHydroCam* parentSense,
const char* uuid = "",
const char* varCode = "HydroCamByteError") explicit
Construct a new GeoluxHydroCam_
Parameters | |
---|---|
parentSense | The parent GeoluxHydroCam providing the result values. |
uuid | A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string. |
varCode | A short code to help identify the variable in files; optional with a default value of "HydroCamByteError". |
- #define HYDROCAM_ERROR_RESOLUTION = 0
- Decimals places in string representation; byte error should have 0 - resolution is 1 byte.
- #define HYDROCAM_ERROR_VAR_NUM = 1
- Sensor variable number; byte error is stored in sensorValues[1].
- #define HYDROCAM_ERROR_VAR_NAME = "flashMemoryErrorCount"
- Variable name in ODM2 controlled vocabulary; "flashMemoryErrorCount".
- #define HYDROCAM_ERROR_UNIT_NAME = "byte"
- Variable unit name in ODM2 controlled vocabulary; "byte".
- #define HYDROCAM_ERROR_DEFAULT_CODE = "HydroCamByteError"
- Default variable short code; "HydroCamByteError".
Define documentation
#define HYDROCAM_FILE_EXTENSION = ".jpg"
#include <src/sensors/GeoluxHydroCam.h>
The file extension for images from the Geolux HydroCam: ".jpg".
#define HYDROCAM_MINIMUM_STATUS_SPACING = 250
#include <src/sensors/GeoluxHydroCam.h>
The minimum spacing between requesting status messages from the HydroCam.
#define HYDROCAM_NUM_VARIABLES = 2
#include <src/sensors/GeoluxHydroCam.h>
Sensor::
#define HYDROCAM_INC_CALC_VARIABLES = 0
#include <src/sensors/GeoluxHydroCam.h>
Sensor::
#define HYDROCAM_WARM_UP_TIME_MS = 350
#include <src/sensors/GeoluxHydroCam.h>
Sensor::
#define HYDROCAM_STABILIZATION_TIME_MS = 11
#include <src/sensors/GeoluxHydroCam.h>
Sensor::
#define HYDROCAM_STABILIZATION_TIME_MAX = 16000L
#include <src/sensors/GeoluxHydroCam.h>
The maximum time to wait for boot + settings.
#define HYDROCAM_AUTOFOCUS_TIME_MS = 7250L
#include <src/sensors/GeoluxHydroCam.h>
Minimum time to wait for an autofocus. Running an autofocus takes about 25-30s on firmwares <2.0.1, but only ~7.5s on firmwares >=2.0.1.
#define HYDROCAM_AUTOFOCUS_TIME_MAX = 35000L
#include <src/sensors/GeoluxHydroCam.h>
The maximum time to wait for autofocus. This is combined with the stabilization time.
#define HYDROCAM_MEASUREMENT_TIME_MS = 3800L
#include <src/sensors/GeoluxHydroCam.h>
Sensor::
#define HYDROCAM_MEASUREMENT_TIME_MAX = 18000L
#include <src/sensors/GeoluxHydroCam.h>
The maximum time to wait for an image.
#define HYDROCAM_SIZE_RESOLUTION = 0
#include <src/sensors/GeoluxHydroCam.h>
Decimals places in string representation; image size should have 0 - resolution is 1 byte.
#define HYDROCAM_SIZE_VAR_NUM = 0
#include <src/sensors/GeoluxHydroCam.h>
Sensor variable number; image size is stored in sensorValues[0].
#define HYDROCAM_SIZE_VAR_NAME = "imageSize"
#include <src/sensors/GeoluxHydroCam.h>
Variable name in ODM2 controlled vocabulary; "imageSize".
#define HYDROCAM_SIZE_UNIT_NAME = "byte"
#include <src/sensors/GeoluxHydroCam.h>
Variable unit name in ODM2 controlled vocabulary; "byte".
#define HYDROCAM_SIZE_DEFAULT_CODE = "HydroCamImageSize"
#include <src/sensors/GeoluxHydroCam.h>
Default variable short code; "HydroCamImageSize".
#define HYDROCAM_ERROR_RESOLUTION = 0
#include <src/sensors/GeoluxHydroCam.h>
Decimals places in string representation; byte error should have 0 - resolution is 1 byte.
#define HYDROCAM_ERROR_VAR_NUM = 1
#include <src/sensors/GeoluxHydroCam.h>
Sensor variable number; byte error is stored in sensorValues[1].
#define HYDROCAM_ERROR_VAR_NAME = "flashMemoryErrorCount"
#include <src/sensors/GeoluxHydroCam.h>
Variable name in ODM2 controlled vocabulary; "flashMemoryErrorCount".
#define HYDROCAM_ERROR_UNIT_NAME = "byte"
#include <src/sensors/GeoluxHydroCam.h>
Variable unit name in ODM2 controlled vocabulary; "byte".
#define HYDROCAM_ERROR_DEFAULT_CODE = "HydroCamByteError"
#include <src/sensors/GeoluxHydroCam.h>
Default variable short code; "HydroCamByteError".