Documentation menu

Tables

Asense data is stored in seven tables. Each holds one kind of record, keyed by device ID and time.

View as Markdown

Every record belongs to one device and one moment. You read a table by passing its name as table_name, together with the device id and a time window. The API converts the raw values the sensor sends into physical units before it answers, so the numbers you get are in g, degrees, millivolts and so on.

TableWhat it holdsTypical rate
accRaw three-axis acceleration, plus temperature and wind at each packetHigh rate, in packets of samples
gyrRaw three-axis angular rateHigh rate, in packets of samples
ainTwo analog input channels, in millivoltsHigh rate, in packets of samples
fftAcceleration spectra worked out on the sensor, one axis per recordPer measurement window
dataSummary of each measurement window: averages, extremes, tilt, main frequencies, locationUsually one record per hour
envEnvironmental readings and power status: dust, noise, temperature, battery, solarUsually one record every 10 minutes
connectedA log of the device connecting and disconnectingWhen the connection changes

Which tables a device fills depends on its type. A tilt and vibration sensor fills acc, gyr, fft and data. An environmental sensor fills env. An amplifier for external sensors fills ain.

Fields every item has

FieldTypeDescription
idstringDevice ID, such as ASENSE00000005.
datetimestringTime of the item in ISO 8601, UTC, ending in Z.
timeintegerSame time in Unix milliseconds. Not present on acc, gyr and ain items, whose samples carry their own times.

Where a record's time comes from

Times are set on the device when the data is measured, not when it reaches the cloud. On the high-rate tables the time of a packet is the time of its last sample. Timing and accuracy explains how the times of the other samples are worked out.