exred_node_rpiphoto v0.2.0 Exred.Node.Rpiphoto
Takes a photo using the Raspberry PI’s camera module
Incoming message format
msg = %{
payload :: any,
filename :: String.t,
width :: String.t,
height :: String.t,
horizontal_flip :: String.t,
vertical_flip :: String.t,
metering :: String.t
}
All of the above are optional. Payload is ignored. The other keys override the corresponding node config values.
Outgoing message format
msg = %{
payload :: number
}
Payload is the exit status of the shell command.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
daemon_child_specs/1 needs to return a list of child specs. These child processes will be started under the DaemonNodeSupervisor
fire/1 is called when the user clicks on the play button on a node in the UI (and with that triggers a ‘fire’ event). It should return a new_state
node_init/1 initializes the node process. This is called as the last step of the node’s init function. Needs to return a new state or a {state, timeout} tuple. (see GenServer documentation)
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
daemon_child_specs/1 needs to return a list of child specs. These child processes will be started under the DaemonNodeSupervisor.
Callback implementation for Exred.NodePrototype.daemon_child_specs/1
.
fire/1 is called when the user clicks on the play button on a node in the UI (and with that triggers a ‘fire’ event). It should return a new_state.
Since this has access to the node’s state it can be used to implement user triggered actions like logging the state, sending messages from the node or creating debug events that are displayed in the debug tab in the UI.
For an example of how to use it see the Trigger node.
Callback implementation for Exred.NodePrototype.fire/1
.
node_init/1 initializes the node process. This is called as the last step of the node’s init function. Needs to return a new state or a {state, timeout} tuple. (see GenServer documentation)
Callback implementation for Exred.NodePrototype.node_init/1
.