driver
- class timeflux_plux.nodes.driver.Plux(address=None, rate=None)
Bases:
timeflux.core.node.Node
This node connects to a BiosignalsPlux device and streams data at a provided rate.
Two output streams are provided. The default output is the data read from the analog and digital channels, converted to meaningful units according to the sensor types. The
o_raw
output provides the data directly returned from the device.- Parameters
port (string|None) – Path to the Plux device. e.g. xx:xx:xx:xx:xx:xx (Bluetooth Mac Address), COMx (serial port on Windows), /dev/cu.biosignalsplux-Bluetoot (serial port on macOS). If not specified, the node will connect to the first detected device.
rate (int|None) – The device rate in Hz. Maximum value for one channel: 8000. Maximum value for eight channels: 2000. If not specified, the rate will be set to the maximum value allowed for the number of detected sensors.
- Variables
i (Port) – Default input, expects DataFrame.
o (Port) – Signal converted to meaningful units, provides DataFrame.
o_raw (Port) – Raw signal, provides DataFrame.
Example
graphs: - id: acquisition nodes: - id: plux module: timeflux_plux.nodes.driver class: Plux params: address: /dev/cu.biosignalsplux-Bluetoot rate: 1000 - id: pub_raw module: timeflux.nodes.zmq class: Pub params: topic: raw - id: pub_converted module: timeflux.nodes.zmq class: Pub params: topic: converted edges: - source: plux:raw target: pub_raw - source: plux target: pub_converted rate: 1 - id: display nodes: - id: subscribe module: timeflux.nodes.zmq class: Sub params: topics: [ converted ] - id: debug module: timeflux.nodes.debug class: Display edges: - source: subscribe:converted target: debug rate: 1 - id: broker nodes: - id: broker module: timeflux.nodes.zmq class: Broker
Attention
On macOS, device autodetection and MAC addresses seem to work, but data is not actually streamed. Use the serial port instead.
Multiple sensors of the same type are currenly not supported.
For sensors that return multiple channels (accelerator for example), only the first channel is available.
See also
Instantiate the node.
- update(self)
Update outputs
- terminate(self)
Cleanup
- info(self)
Get some info about the connected device
- convert(self, samples)
Convert signal to meaningful units