Skip to main content

Reference: memfaultd Configuration

Useful links:

/etc/memfaultd.conf

A full configuration example can be found in the source directory of memfaultd. Here's a copy:

{
"queue_size_kib": 1024,
"refresh_interval_seconds": 3600,
"enable_data_collection": false,
"software_version": "<YOUR_SOFTWARE_VERSION>",
"software_type": "<YOUR_SOFTWARE_TYPE>",
"project_key": "<YOUR_PROJECT_KEY>",
"base_url": "https://device.memfault.com",
"data_dir": "/media/memfaultd",
"swupdate_plugin": {
"input_file": "/etc/swupdate.cfg",
"output_file": "/tmp/swupdate.cfg"
},
"reboot_plugin": {
"uboot_fw_env_file": "/etc/fw_env.config"
},
"collectd_plugin": {
"output_file": "/tmp/collectd.conf"
},
"collectd": {
"non_memfaultd_chain": "",
"write_http_buffer_size_kib": 64,
"interval_seconds": 3600
}
}

The settings you add in /etc/memfaultd.conf extend the built-in configuration file.

Top-level /etc/memfaultd.conf configuration

FieldDescriptionRecommended value
queue_size_kibSize of $data_dir/queue in kibibytes.1024
refresh_interval_secondsThe frequency (in seconds) with which memfaultd will attempt to flush its queue and post it to Memfault. Note that a recovery system with exponential back-off is in place for network failures.3600
enable_data_collectionWhether memfaultd should collect and post data to Memfault by default. Read more here.false (ask for user consent first)
base_urlThe base URL to Memfault's device API.https://device.memfault.com
software_versionThe current version of your software. Read more here.Project-specific
software_typeThe current version of your software. Read more here.Project-specific
project_keyA write-only key for your Project. Find yours in Project -> Settings in the app.Project-specific
data_dirA directory where memfaultd can store application data persistently (needs to survive firmware upgrades). Read more here.Project-specific
swupdate_pluginConfiguration values for plugin_swupdate if enabled in memfaultd (default). Read more.See swupdate_plugin
reboot_pluginConfiguration values for plugin_reboots if enabled in memfaultd (default). Read more.See reboot_plugin
collectd_pluginConfiguration values for plugin_collectd if enabled in memfaultd (default). Read more.See reboot_plugin
collectdValues used to configure CollectD.See collectd

swupdate_plugin

{
"swupdate_plugin": {
"input_file": "/etc/swupdate.cfg",
"output_file": "/tmp/swupdate.cfg"
}
}
FieldDescriptionRecommended value
input_fileWill be used as the base SWUpdate configuration when generating $output_file. May specify a suricatta section (gets merged with generated parameters). If an identify section exists it will get replaced. See upstream SWUpdate docs./etc/swupdate.cfg
output_fileGenerated by memfaultd using $input_file as a base. Needs to be passed to SWUpdate as its config file. See an example here./tmp/swupdate.cfg

reboot_plugin

{
"reboot_plugin": {
"uboot_fw_env_file": "/etc/fw_env.config"
}
}
FieldDescriptionRecommended value
uboot_fw_env_filePath to a valid fw_env.config file. Needed for memfaultd's reboot reason tracking plugin. Read about libubootenv and see an example./etc/fw_env.config

collectd_plugin

{
"collectd_plugin": {
"output_file": "/tmp/collectd.conf"
}
}
FieldDescriptionRecommended value
output_fileGenerated by memfaultd. Needs to be Included in the main collectd.conf./tmp/collectd.conf

collectd

{
"collectd": {
"non_memfaultd_chain": "",
"write_http_buffer_size_kib": 64,
"interval_seconds": 3600
}
}
FieldDescriptionRecommended value
non_memfaultd_chainAn optional CollectD chain to jump to after the Memfault-generated chain. Read more here.Project-specific
write_http_buffer_size_kibSize of the CollectD in-memory write buffer. Read more here.64
interval_secondsGoverns CollectD's Interval and the FlushInterval setting of the write_http plugin. Read more here.3600