Sensor daemon for ADS1115 4-channel ADC.

external links



The ads1115 daemon can be installed using the following package managers:



The ads1115 daemon is composed of the following traits:

uses-serial (from uses-i2c)


fsr (number) default: 2.048

rate (number) default: 128

channels ([string,...]) default: ['0', '1', '2', '3']
List of strings containing one or two characters. Each string represents a particular conversion involving one or two ADC input pins. If there are two characters 'AB', the converted returned voltage will be A-B. If the is one character 'A', the returned voltage will be A-GND. Conversions are accomplished for each of the listed channels, in order, for each measurement. Valid strings: '01', '03', '13', '23', '0', '1', '2', '3'.

i2c_addr (integer)
I2C bus address.
from uses-i2c

port (integer)
TCP port for daemon to occupy.
from is-daemon

serial (string) default: NULL
Serial number for the particular device represented by the daemon
from is-daemon

make (String) default: NULL
from is-daemon

model (String) default: NULL
from is-daemon


Daemons with the ads1115 trait expose the following public methods:

measure ➜ number
Initiate a measurement. Returns integer, measurement ID.
from is-sensor

loop, {'type': 'boolean'}

get_measured ➜ dictionary name: value
Get most recent measured value. Additional key of measurement ID.
from is-sensor

Stop looping measurement.
from is-sensor

get_channel_names ➜ list of string
Get current channel names.
from is-sensor

get_channel_shapes ➜ dictionary name: list of int
Get current channel shapes. If list is empty, channel is scalar.
from is-sensor

get_channel_units ➜ dictionary name: units
Get current channel units.
from is-sensor

Expose direct access to the serial port to clients. This should not be encouraged for normal use, but may be very important for debugging. If a device is expected to return data, it should be logged at the INFO level, not returned to the client. This is done to allow long tasks to be run asynchronously, and to explicitly discourage use of this method except when debugging. Setting `busy` to true is encouraged, but individual daemon writers should consider their own use case.
from uses-i2cuses-serial

message, {'type': 'string'}

busy ➜ boolean
Returns true if daemon is currently busy.
from is-daemon

id ➜ dictionary
JSON object with information to identify the daemon, including name, kind, make, model, serial.
from is-daemon

get_config_filepath ➜ string
String representing the absolute filepath of the configuration file on the host machine.
from is-daemon

get_config ➜ dictionary
Full configuration for the individual daemon as defined in the TOML file. This includes defaults and shared settings not directly specified in the daemon-specific TOML table.
from is-daemon

get_traits ➜ [string]
Get a full list of the daemon traits.
from is-daemon

get_state ➜ dictionary
Get daemon state, as saved in the state.toml file.
from is-daemon

Set daemon state. Accepts any subset of the state dictionary, dynamically.
from is-daemon

list_methods ➜ [string]
Get an array of all known public method names.
from is-daemon

Cleanly shutdown daemon.
from is-daemon

help ➜ string
If method not given, return a human-readable string with information about the daemon as a whole. If method is given, return a human-readable string with the signature of the method on the first line and a description of the method on subsequent lines. The signature is not specified to be in any particular language. It is intended for usage by humans ONLY.
from is-daemon

method, {'type': 'string'}