button mode in the nymea-networkmanager allows you to start the Bluetooth server advertisement by pressing (long-pressing) a physical button connected to a GPIO. FOr this you need the hardware button, a resistor and you have to know the sysfs GPIO number from the pin where the button is connected to.
Here you can find an example how to connect a button to a GPIO.
Once you have wired the button, you can configure the nymea-networkmanager with the button mode. This can be done by updating the nymea-networkmanager configuration file in
/etc/nymea-nymea-networkmanager.conf. The default file looks like this:
Set your GPIO sysfs number of the button i.e.
Restart the nymea-networkmanager
systemctl restart nymea-networkmanager.service
Now the bluetooth server will only advertise, if you press this button for a few seconds. If you don’t connect within the configured timeout, the server will shut down again.
If you connect and drop the connection, the server will not automatically restart advertisment, you need to press the button again for having the service.
Hope this hepls