-
Notifications
You must be signed in to change notification settings - Fork 12
The Config File
The configuration file is a simple textual file that begins with a header line denoting its purpose:
[attinydaemon]
Following this are the option. If an option is missing at startup, the daemon determines the value that is currently set in the ATTiny Daemon and copies it to the config file. An example config file can be found in the daemon subdirectory.
If you change a value of an existing option in the configuration file, then the daemon writes to new value to the ATTiny Daemon after a restart of the daemon. You can either reboot the system or execute the following command (assuming you used the service file for the installation of the daemon):
sudo systemctl restart attiny_daemon.service
This simply stops and restarts the daemon.
By default the configuration file is assumed to be in the same directory as the daemon itself. By using the command line option
--cfgfile <file>
another file with an arbitrary path can be provided as a config file.
| Option Name | Default | Comment |
|---|---|---|
| primed | true | This option arms the ATTiny Daemon. As long as this option is set to falseyou can experiment and read all values of the ATTiny Daemon without it influencing your system in any way (apart from showing up as an I2C device) |
| loglevel | DEBUG | This is the log level for all messages in the system log file. Available levels are DEBUG, INFO, WARNING, ERROR, CRITICAL |
| button function | shutdown | The possible options are shutdown, reboot and nothing |
| timeout | 60 | This is the time in seconds until the ATTiny decides that the RPi has shut down and has to be restarted by resetting it |
| sleeptime | 20 | This is the sleep time in seconds for the daemon until it checks the ATTiny Daemon for the next time |
| force shutdown | True | |
| shutdown voltage | 3200 | This is the voltage at which the ATTiny Daemon executes a hard shutdown |
| warn voltage | 3400 | This is the voltage at which the ATTiny Daemon warns the RPi to shut down |
| restart voltage | 3900 | At this voltage the ATTiny tries to restart the RPi if it is not running |
| battery voltage coefficient | 1000 | |
| battery voltage constant | 0 | |
| external voltage constant | 0 | |
| external voltage coefficient | 1818 | |
| temperature constant | -270 | |
| temperature coefficient | 1000 | |
| i2c address | 0x37 | This is the I2C address of the ATTiny, shouldn't have to be changed normally |
NB: The difference between timeout and sleeptime (in the default configuration 40 seconds) should allow the RPi to fully reboot. If the time is not sufficient, then the ATTiny Daemon might reset the system just before it comes online again.