Restoring espresense Apple pairings with Mosquitto mqtt

We are experimenting with espresense to determine whether anyone is at home or not. So far, it seems to be working pretty well. A feature that sets espresense apart is the ability to detect Apple devices, specifically iPhones. It does this by pairing with the device and saving the remote IRK (identity resolving key). This is stored as a retained message on the esprense/settings mqtt topic.

On occassion (likely a docker start), these retained messages have been cleared from the mqtt topic. Luckily we can add them again with:

docker exec mosquitto mosquitto_pub -h -t 'espresense/settings/irk:AddSavedIrkHere/config' -m '{"id":"AddIosPhoneIdHere"}' -p 1883 -r

Bingo, the phone will be detected again.