How can I start data acquisition using the GraphQL APIs?

Home > Resources > Knowledge Base > How can I start data acquisition using the GraphQL APIs?

How can I start data acquisition using the GraphQL APIs?

Data acquisition can be started using the GraphQL APIs. These GraphQL APIs can be accessed via http://xxx.xxx.xxx.xxx:8000/graphql where xxx.xxx.xxx.xxx is the IP address of your iQunet Server. You can open the GraphQL interface in your web browser or access the APIs using a client library in Python, Matlab, etc.

 

With the GraphQL APIs, you can manually start a recording, or you can enable automatic periodic measurements.

 

Manually recorded measurements

Each sensor type has a different command to start a recording.

 

a) Proximity Sensor

mutation {hallRunSetup(sensitivity: 128, macId: “20:ba:bd:9f”) {ok}}

 

Required arguments:

  • numSamples,
  • sensitivity, a unitless number between 0 (off) and 255 (highest sensitivity).

 

b) Inclination Sensor

mutation {tiltRunSetup(threshold: 0.0, numSamples: 255, guardRoll: 50, macId: “44:44:44:44”) {ok}}

 

Required arguments:

  • tiltGuardRoll,
  • tiltNumSamples,
  • tiltThreshold.

 

c) Proximity Switch Sensor

mutation {reedRunSetup(numSamples: 31, macId: “f2:8e:cc:78”) {ok}}

 

Required arguments:

  • numSamples, the number of transmissions before the sensor returns to sleep mode.

 

d) Vibration Sensor

mutation {vibrationRunSetup(sampleRate: 3200, formatRange: 16, threshold: 0.01, axis: “XYZ”, numSamples: 2048, macId: “e7:f9:6e:36”) {ok}}

 

Required arguments:

  • sampleRate,
  • formatRange,
  • numSamples,
  • axis,
  • rms threshold.

 

Automatic measurements

The setQueueEnabled method enables the user to enable or disable automatic measurements on the specified sensor device.

mutation {setQueueEnabled(enabled: true, macId: “e7:f9:6e:36”) {ok}}

 

Required arguments:

  • enabled: true to enable automatic measurements, false to disable automatic measurements.

 

The setQueueInterval method sets the auto-measurement interval of the specified sensor device.

mutation {setQueueInterval(interval: 120, macId: “e7:f9:6e:36”) {ok}}

 

Required arguments:

  • interval, units [s].