Preferences library – max key name length

According to the Preferences Example StartCounter.ino the namespace is limited to 15 chars!

This is valid not only for the preferences name, but as well for the preferences keys. For example a key name bluetooth_status will fail while the key name bluetooth_stat works fine.

Example and debug output:

Key name with 16 characters length:

will fail to write the key value with the following error:

Changing the length of the key name to 14 characters works fine:

Debug output after first boot (preference key bluetooth_stat does not exist yet, therefor the first error message):

After a reboot the preferences key is available and true as expected ( no more error message regarding missing key):

And after another reboot the key has the value false:





Leave a Reply

Your email address will not be published. Required fields are marked *

Free Link Directory