• Anyway so far that was all without bonding. I tried 'pairing' the device in linux in Bluetooth devices panel and this seem to create bond.

    Here is the interesting part stored in the page below bootloader. I dump everything via
    for (i=0;i<8192;i+=256) print(btoa(require("Flash").read(256,0xf5000+i))). Before any pairing the second page started as

    3sCt3v4BHvH//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w==
    

    The first page is very similar and does not change.
    Then I did pairing from linux side and the second page changed into

    3sCt3v4BHvEHwBQAAMAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAZrqpYvGRPZthHF+yDRG8k87z/U1JjQABagnjvAQDN7I+xxRW4Bvy4O/wo7gT5+57B+UAA9GT7P0A1vgYD2gbAAQAAwAAAAgAAAAEAAAAIwAQAAMAAAAMAAAADAAAACAAQAAIAAQDNygAA/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w==
    

    Also I noticed security status shows

    NRF.getSecurityStatus()
    ={ advertising: false, connected: true, encrypted: true, mitm_protected: false,
      bonded: true,
      connected_addr: "64:bc:58:aa:ae:19 public"
     }
    

    so there is encrypted true, bonded true. Then I rebooted device and reconnected and it changed into

    3sCt3v4BHvEHwBQAAMAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAZrqpYvGRPZthHF+yDRG8k87z/U1JjQABagnjvAQDN7I+xxRW4Bvy4O/wo7gT5+57B+UAA9GT7P0A1vgYD2gbAAQAAwAAAAgAAAAEAAAAAAAQAAMAAAAMAAAADAAAACAAQAAIAAQDNygAAAAAEAADAAAAEAAAAAwAAAAgAEAACAAEAzcoAAAjABAAAwAAABQAAAAMAAAAIABAAAgABAM3KAAD//////////////////////////////////////////////////////////////////////////w==
    

    I still get bonded, encrypted connection but there is another short record added.
    Then I noticed that each time I disconnect Bangle from linux side (so that blue icon on bangle turns into grey) there is another such record added after each next connection, otherwise everything works. here are few lines with added records

    3sCt3v4BHvEHwBQAAMAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAZrqpYvGRPZthHF+yDRG8k87z/U1JjQABagnjvAQDN7I+xxRW4Bvy4O/wo7gT5+57B+UAA9GT7P0A1vgYD2gbAAQAAwAAAAgAAAAEAAAAAAAQAAMAAAAMAAAADAAAACAAQAAIAAQDNygAAAAAEAADAAAAEAAAAAwAAAAgAEAACAAEAzcoAAAAABAAAwAAABQAAAAMAAAAIABAAAgABAM3KAAAIwAQAAMAAAAYAAAADAAAACAAQAAIAAQDNygAA/////////////////////////////////////w==
    3sCt3v4BHvEHwBQAAMAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAZrqpYvGRPZthHF+yDRG8k87z/U1JjQABagnjvAQDN7I+xxRW4Bvy4O/wo7gT5+57B+UAA9GT7P0A1vgYD2gbAAQAAwAAAAgAAAAEAAAAAAAQAAMAAAAMAAAADAAAACAAQAAIAAQDNygAAAAAEAADAAAAEAAAAAwAAAAgAEAACAAEAzcoAAAAABAAAwAAABQAAAAMAAAAIABAAAgABAM3KAAAAAAQAAMAAAAYAAAADAAAACAAQAAIAAQDNygAACMAEAADAAAAHAAAAAwAAAAgAEAACAAEAzcoAAA==
    3sCt3v4BHvEHwBQAAMAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAZrqpYvGRPZthHF+yDRG8k87z/U1JjQABagnjvAQDN7I+xxRW4Bvy4O/wo7gT5+57B+UAA9GT7P0A1vgYD2gbAAQAAwAAAAgAAAAEAAAAAAAQAAMAAAAMAAAADAAAACAAQAAIAAQDNygAAAAAEAADAAAAEAAAAAwAAAAgAEAACAAEAzcoAAAAABAAAwAAABQAAAAMAAAAIABAAAgABAM3KAAAAAAQAAMAAAAYAAAADAAAACAAQAAIAAQDNygAAAAAEAADAAAAHAAAAAwAAAAgAEAACAAEAzcoAAA==
    CMAEAADAAAAIAAAAAwAAAAgAEAACAAEAzcoAAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w==
    

    Then I removed device on linux side so the bonding got lost on linux side and after reconnection the stored data were still the same however the encryption was turned off

    NRF.getSecurityStatus()
    ={ advertising: false, connected: true, encrypted: false, mitm_protected: false,
      bonded: true,
      connected_addr: "64:bc:58:aa:ae:19 public"
     }
    

    no record was added on this new connection. It still says bonded.
    Then I did the pairing from linux side again and it added another long bonding record and turned encryption to true so it looks like this

    3sCt3v4BHvEAABQAAMAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAZrqpYvGRPZthHF+yDRG8k87z/U1JjQABagnjvAQDN7I+xxRW4Bvy4O/wo7gT5+57B+UAA9GT7P0A1vgYD2gbAAQAAwAAAAgAAAAEAAAAAAAQAAMAAAAMAAAADAAAACAAQAAIAAQDNygAAAAAEAADAAAAEAAAAAwAAAAgAEAACAAEAzcoAAAAABAAAwAAABQAAAAMAAAAIABAAAgABAM3KAAAAAAQAAMAAAAYAAAADAAAACAAQAAIAAQDNygAAAAAEAADAAAAHAAAAAwAAAAgAEAACAAEAzcoAAA==
    AAAEAADAAAAIAAAAAwAAAAgAEAACAAEAzcoAAAfAFAAAwAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAABmuqli8ZBhGCfWMrObG4It5lSB38yJAANI2qOvqjzATvQ8Furn7uxrS8kakk1e6b5EtQADt6Vtdj5PQBlvLCMAEAADAAAAKAAAAAwAAAAgAEAACAAEAzcoAAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w==
    

    So for me reboot does not clear anything, only every new connection add some extra record there (maybe connection encryption keys?). Also clearing bonding from linux side does not change bonding info in Bangle at all. New bonding invalidates previous - it can be seen previous records are modified when next is written so new bonding clears something in the first one.

    When it works the connection is encrypted and rebooting watch does not break this, reconnecting after reboot keeps it still encrypted.

About

Avatar for fanoush @fanoush started