Since these were split out from the grove lib, they need to load their
own library, ie Light now comes from upm_light.so.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added the C source for the flex sensor with necessary changes to cmake,
examples, and docs.
* Renamed all files with groveslide to slide
* Replaced all instances of groveslide with slide
* Added C source for slide sensor
* Updated all cmake files
* Added C example for slide sensor
* Split out slide sensor from grove library
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added the C source for the light sensor with necessary changes to cmake,
examples, docs.
* Renamed all files with grovelight to light
* Replaced all instances of grovelight with light
* Added C source for light sensor
* Updated all cmake files
* Added C example for light sensor
* Split out light sensor from grove library
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added the C source for the gsr sensor with necessary changes to cmake,
examples, docs.
* Renamed all files with grovegsr to gsr
* Replaced all instances of grovegsr with gsr
* Added C source for gsr sensor
* Updated all cmake files
* Added C example for gsr sensor
* Fixed C++ threshold method from throwing on a successfull aio read
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added the C source for the emg sensor with necessary changes to cmake,
examples, docs.
* Renamed all files with groveemg to emg
* Replaced all instances of groveemg with emg
* Added C source for emg sensor
* Updated all cmake files
* Added C example for emg sensor
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added the C source for the O2 sensor with necessary changes to cmake,
examples, docs.
* Renamed all files with groveo2 to o2
* Replaced all instances of groveo2 with o2
* Added C source for o2 sensor
* Updated all cmake files
* Added C example for o2 sensor
Signed-off-by: Noel Eck <noel.eck@intel.com>
Implement a single source file for the following:
* mq2: H2/LPG/CH4/CO/alcohol/smoke/propane/etc
* mq3: Alcohol/benzine/CH4/hexane/LPG/CO
* mq4: CNG (mostly methane)
* mq5: H2/LPG/CH4/CO/alcohol
* mq6: LPG (mostly propane/butane)
* mq7: CO
* mq8: H
* mq9: CO/CH4/LPG
The documentation for these sensors notes that they do not read an exact
gas concentration. Some of the sensors have examples for how to
calibrate with a 'clean air environment' for outputing ppm, but this is
not the case for all mqx sensors. Because of this, the output can be
read as a normalized output (0.0->1.0), raw volts (normalized * aRef),
or a scaled/offset voltage.
Signed-off-by: Noel Eck <noel.eck@intel.com>
* Removed unessesary spaces.
* Changed INFO to STATUS since INFO is not a cmake message
keyword.
* Changed a few messages from status/info to warning.
* Fixed trailing carriage return on yuidoc execute_process.
* Removed my debug messages for CXX vs C.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Multiple changes related to building the vdiv c source w/c example.
* Renamed GroveVdiv to vdiv (all cases) throughout source, examples,
directory names, and documentation.
* Added C source.
* Tested C sensor code on edison
* Updated CMakeLists.txt for examples-c to build from
<sensorname>-c. This was a small change to get c examples to build
for sensors in which the C++ does NOT wrap the C.
* Added C example for vdiv.
Signed-off-by: Noel Eck <noel.eck@intel.com>
This module implements support for the DFRobot Analog ORP
(Oxidation/Reduction Potential) Meter.
It requires 5.0 volts, but the more accurate the voltage specified (to
the constructor), the more accurate the meter (paraphrased from the
wiki).
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This module implements support for the DFRobot Laser PM2.5 Sensor. It
connects to a UART at 9600 baud. This is the only baud rate
supported. It optionally supports Reset and Set/Sleep gpios as well.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
These changes allow NMEA data to be read via I2C on UBLOX compliant
devices that support this capability, such as the LEA-6H based GPS
shield from DFRobot.
It adds a new init() function to the C code, and a new constructor to
the C++ code. It also adds 5 new examples for C, C++, Javascript,
Python, and Java.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This driver will serve as a generic module for grabbing NMEA data from
various GPS devices via a serial interface. ublox6 will also be
removed in favor of using this driver going forward.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This driver was developed with the DFRobot Light Sensor based on the
BH1750. It has a sensitivity of .5 to 65535 Lux. It supports
voltages from 3-5vdc and is connected via I2C.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This driver implements support for the DFRobot MMA7361 analog
accelerometer. It supports 3 axes with a selectable 1.5G and 6G
sensitivity. It is not really meant for navigation, but rather for
uses such as orientation and freefall detection.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This module provides support for the VK2828U7 (ublox based) GPS module
from DFRobot. It is connected via a UART, and emits NMEA data.
Ideally this data could be fed to an external library like TinyGPS to
parse the NMEA data and provide an easier method of extracting GPS
information.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Test commit for building C UPM modules.
* Added C include directory
* Added C utilities directory
* Rename C++ upm.h -> upm.hpp to make room for C upm.h
* Added upm_mixed_module_init function to src/CMakeLists.txt. This
function takes filesnames similar to upm_module_init and does a
bit of processing before calling upm_module_init.
* Added c example directory. Changed c++ example names.
* Added dfrph implemention for testing (C++ wraps C). Added mraa
to .pc requires for dfrph. Tested against stand-alone project.
Added dfrph c example.
* Update implemention of pkg-config file generation.
* Added two cmake cache variables: BUILDCPP and BUILDFTI
* Removed src from swig_add_module calls, added libname to
swig_link_libraries calls. Shrinks swig'ed binaries by ~13%.
* Added install target in upm/CMakeLists.txt to install C header,
directory. Is this where we want this?
* C FTI header directory is include/fti
Signed-off-by: Noel Eck <noel.eck@intel.com>
There are some issues using this device on the 101 with Firmata:
1. You cannot use any other ADC resolution than 1024. By default the
driver would try to set 12b resolution for improved accuracy. Doing
this on the 101 yielded nonsensical readings causing the driver to
fail. Using 10b resolution will yield less accuracy, but at least the
driver will function.
2. After the first ADC read, and for some time period after, the MRAA
aio_read() calls will always return 0. This would cause an exception
to be thrown by the driver since this is an invalid reading. Now, we
do an analog read on each channel and sleep for .5 seconds in the ctor
to get around this problem. It is a hack and should be properly fixed
somewhere else (firmata? MRAA?).
Some code was reworked/renamed to make it more clear what is actually
going on. In addition a setDebug() method was added to enable some
debugging output.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
The existing driver only supported IIO. This change adds support for
controlling the device via an I2C connection. In addition, there is a
new C++ example for it (l3gd20-i2c.cxx).
Note: Only basic functionality is supported, though a full register
map and access functions are available to fill in any desired
functionality.
Note, that some methods are only usable with specific connection
types. See the documentation.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Changes in library:
- enableProximity() function is to enable or disable proximity sensor
- enableIlluminance() function is to enable or disable illuminance sensor
- run clang-format
Changes in example:
- proximity and illuminance kernel IIO-based driver init state is power off,
require enable before read out sensor data. Sleep time is needed after
enable, the sleep time may vary on different platform.
- run clang-format
Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit reworks ozw somewhat and adds some device specific drivers
with examples. All of these drivers are kept in the UPM ozw library.
The OZW class has been reworked to make it a proper singleton, since
the OpenZWave::Manager() it depends on is already a singleton. This
avoids issues such as opening and initializing OpenZWave multiple
times.
A new, relatively thin base class, ozwInterface is also now present.
This class wraps some basic functionality, and handles initialization
of the OZW base class. It is intended to be inherited by device
driver classes. It operates on a node id for a device. Each OZW
device is referenced by a node id, which does not change unless the
device is removed (and possibly re-added) to a Z-Wave network.
Finally, a series of device specific drivers have been implemented.
These provide basic functionality to monitor and in some cases control
the operation of a Z-Wave device. They are the following:
ozwdump - This is a fake 'device' driver that initializes an OZW
network and dumps information on all of the nodes (devices) present.
Along with each node, available information on each valueid associated
with that node is also printed. This fake device and it's examples
replace the original ozw example.
aeotecss6 - Aeotec Smart Switch 6. This device allows control of the
switch, as well as reporting of information the switch makes
available, such as current consumption, volts, watts, and accumulated
energy use (kWh).
aeotecsdg2 - Aeotec Smart Dimmer Gen 2. This device is similar to the
Smart Switch 6, but also provides dimming functionality. It also
provides information on energy use.
aeotecdw2e - Aeotec Door/Window Sensor 2nd Edition. This device is a
magnetic switch with an embedded tamper switch used to detect the
opening/closing of windows and doors. This is a battery powered
device.
aeotecdsb09104 - Aeotec Home Energy Monitor. This device is intended
to be installed at the MAINS or Breaker box. It reports current and
cumulative energy consumption.
tzemt400 - Trane TZEMT400 Thermostat. This device is a thermostat
with Z-Wave functionality. The variant tested was the
TZEMT400BB32MAA. The driver reports various information on the status
of the thermostat, as well as the current measured temperature.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This module implements support for the Honeywell TB7300 Communicating
Fan Coil Thermostat. It may also support the TB7200, though only the
TB7300 was available for development of this driver.
The TB7200 Series PI thermostats are designed for zoning applications,
and the TB7300 Series PI thermostats are designed for fan coil
control. Both Series are communicating thermostats with models
available in BACnet® MS/TP protocol and can be easily integrated into
a WEBs-AX building automation system based on the NiagaraAX® platform.
TB7200 and TB7300 Series thermostats are compatible with the Honeywell
Occupancy Sensor Cover. Thermostats equipped with an occupancy sensor
cover provide advanced active occupancy logic, which will
automatically switch occupancy levels from Occupied to Stand-By and
Unoccupied as required by local activity being present or not. This
advanced occupancy functionality provides advantageous energy savings
during occupied hours without sacrificing occupant comfort. All
thermostats can be ordered with or without a factory installed PIR
cover.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This module implements support for the Amphenol Telaire Ventostat
T8100 Ventilation Controller with BACnet interface. It may also
support the T8200 and T8300 models, but they have not been tested.
The Telaire Ventostat T8100 reports Temperature, Humidity and CO2
concentrations. It supports an optional relay with a settable trigger
point. The unit this driver was tested under did not support the
optional relay. The temperature range supported is 0-50C, humidity is
0-100% non-condensing, and CO2 range is appoximately 0-2000 PPM for
the T8100. Other sensors in this family support wider ranges.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit removes functionality that is now present in the
bacnetutil class. This simplifies the driver considerably. The
examples were modified to reflect the renaming of some utility
functions in bacnetutil.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This module (bmx055) implements support for the following core Bosch
chipsets:
bma250e - accelerometer, 3 variants (chip id's 0x03, 0xf9, and 0xfa)
bmm150 - magnetometer
bmg160 - gyroscope
The other 3 devices are combinations of the above:
bmx055 - accel/gyro/mag
bmc160 - accel/mag
bmi055 - accel/gyro
...for 6 devices total.
For the combination devices, all of the sub-devices appear as
individual independent devices on the I2C/SPI bus.
The combination drivers provide basic configuration and data output.
For more detailed control as well as interrupt support, you should use
the core device drivers (accel/gyro/mag) directly.
These devices support both I2C and SPI communications. They must be
powered at 3.3vdc.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
L3GD20 is tri-axis gyroscope from STMicroelectronics.
This sensor can measure angular velocity in degree per second.
The library provided is libupm-l3gd20.so.0.4.0.
The example provided is l3gd20-example where it will print x,y,z axis when
trigger buffer data is ready.
This sensor requires calibration to be done for 2 seconds. Please place the
sensor on level surface.
As the sensor data is noisy, we have implemented denoise algorithm within the
sensor library.
Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This driver implements support for the Bosch BNO055 Absolute
Orientation 9DOF Fusion Hub. It was implemented on the Adafruit
variant at https://www.adafruit.com/products/2472.
The BNO055 is a System in Package (SiP), integrating a triaxial 14-bit
accelerometer, a triaxial 16-bit gyroscope with a range of ±2000
degrees per second, a triaxial geomagnetic sensor and a 32-bit cortex
M0+ microcontroller running Bosch Sensortec sensor fusion software, in
a single package.
This sensor handles the hard problem of combining various sensor
information into a reliable measurement of sensor orientation (refered
to as 'sensor fusion'). The onboard MCU runs this software and can
provide fusion output in the form of Euler Angles, Quaternions, Linear
Acceleration, and Gravity Vectors in 3 axes.
The focus on this driver has been on supporting the fusion components.
Less support is available for use of this device as a generic
accelerometer, gyroscope and magnetometer, however enough
infrastructure is available to add any missing functionality.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This library adds support for both the BMP280 and BME280 sesnors from
Bosch. The BME is virtually identical to the BMP280 aside from some
slight register changes and adding support for a humidity sensor.
The BMP280 is an absolute barometric pressure sensor especially
designed for mobile applications. The sensor module is housed in an
extremely compact 8-pin metal-lid LGA package with a footprint of only
2.0 × 2.5 mm2 and 0.95 mm package height. Its small dimensions and its
low power consumption of 2.7 μA @1Hz allow the implementation in
battery driven devices such as mobile phones, GPS modules or watches.
The BME280 is as combined digital humidity, pressure and temperature
sensor based on proven sensing principles. The sensor module is housed
in an extremely compact metal-lid LGA package with a footprint of only
2.5 × 2.5 mm2 with a height of 0.93 mm. Its small dimensions and its
low power consumption allow the implementation in battery driven
devices such as handsets, GPS modules or watches. The BME280 is
register and performance compatible to the Bosch Sensortec BMP280
digital pressure sensor
These drivers support both I2C and SPI operation.
When using SPI on an Edison with the arduino breakout board, you
must specify a CS of -1 to the constructor, and connect the chip's
CS pin to arduino pin 10.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This driver, based on bosch code is being removed in favor of a new
driver to be added soon that is more fully functional and includes SPI
support.
The new driver will be included along with a BMP280 implementation in
a new bmp280 library.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit removes the old bmp180 driver that was erroneously
re-added when the interface examples and headers were introduced.
It then switches the users of bmp180 to the existing bmpx8x driver,
which already supports the bmp180.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
Code cleanup and proper close iio device in destructor.
KXCJK-1013 is tri-axis accelerometer from Kionix.
This sensor can measure acceleration in metre per second squared or in
G-forces.
The library provided is libupm-kxcjk1013.so.0.4.0.
The example provided is kxcjk1013-example where it will print x,y,z axis when
trigger buffer data is ready.
Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This driver supports, and was tested with, a DS18B20 1-wire
Temperature Sensor using external power.
This device requires the use of a UART to provide access to a Dallas
1-wire bus, via a new facility supported by MRAA (once the relevant PR
is accepted), using the UartOW access class. It is important to
realize that the UART is only being used to access and control a
Dallas 1-wire compliant bus, it is not actually a UART device.
Multiple DS18B20 devices can be connected to this bus. This module
will identify all such devices connected, and allow you to access them
using an index starting at 0.
Parasitic power is not currently supported due to the very tight 10us
limit on switching a GPIO properly to supply power during certain
operations. For this reason, you should use external power for your
sensors.
Setting the alarm values (Tl, Th) is also not supported, since this is
only useful when doing a 1-wire device search looking for devices in
an alarm state, a capability not yet supported in MRAA. In reality,
this is trivial to handle yourself in your application.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This adds initial support for the DS2413 Dual Channel Addressable
Switch. This is a Dallas Semiconductor 1-wire compliant device
providing access to 2 open-drain GPIOs.
https://learn.adafruit.com/adafruit-1-wire-gpio-breakout-ds2413/overview
This driver requires One-Wire over UART support in MRAA (PR #415)
which is not yet merged.
Signed-off-by: Jon Trulson <jtrulson@ics.com>