-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path16-ws-indicate.Rmd
32 lines (20 loc) · 1.88 KB
/
16-ws-indicate.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Indicators and heartbeats
The script `ws-indicate` is used to indicate the device's status using the LED(s) on board the Raspberry Pi. The script `ws-heartbeat` can be used to transmit the device's status to a user-defined script that could provide logging, or submit the status to an online dashboard.
## Installation of `ws-indcate` and `ws-heartbeat`
These tools are installed as part of the node installation process.
## Indicators
Internally `ws-inidicate` makes repeated calls to `pi-pwr` to control the LED(s). There are three indicator routines, heartbeat (quick flash of LEDs in order to show device is functioning), countdown (flashes power LED), and record (power LED on, action LED off).
````{bash eval=FALSE}
sudo ws-indicate
sudo ws-indicate countdown 5 # counts down from 5
sudo ws-indicate record action # record light is on while action is executed
````
### A note on `sudo`
Raspberry Pi OS (and previously Raspbian) allows the default user to run sudo without a password. This is not true for other Linux distributions, such as Ubuntu. This could lead to a password prompt when using `ws-indicate`. As nodes are designed to run autonomously, the installation process for `ws-node` will configure `ws-indicate` to not require a `sudo` password.
## Heartbeat
The script `ws-heartbeat` is used to send a heartbeat signal to the devices.wildlife.systems server to indicate that the node is alive and connected, as well as to provide some information to assist problem diagnosis. The data sent comes from the onboard sensor readings (`sr onboard`) and the server stores the node ID, timestamp, CPU and GPU temperatures, and the amount of memory and storage used. The node must be registered with WildlifeSystems for this data to be stored.
The script may be run for debugging purposes at any time as follows.
````{bash, eval=FALSE}
ws-heartbeat
````
The script will exit silently on success.