This is the server part of BLE Coin, which allows you to run a script when a user authenticates. Using this service, you will never have to manually use the central's serial interface, everything in that regard will be handled by the service.
- Take a look at the project page for more info.
- A Raspberry Pi is also recommended.
- Download nRF Connect for Desktop and install the Programmer App.
- Download the newest release of the firmware files.
- Flash the
central.hex
onto your NRF52840 dongle.
- Look here for more advice.
- Install Ansible.
- Set up a playbook and inventory
- Make sure you have set the
door_open_command
andble_keykeeper_dir
variables to appropriate values. - Run your playbook
- Make sure the NRF52840 dongle is connected to the server.
- Navigate to your
ble_keykeeper_dir
and create a new coin with./ble_gen_coin.py winnie
. You can changewinnie
to any name you like (no spaces). - Flash the newly created
coin_xxxxxxxxxxxx.hex
onto you coin. You can delete the file after. - Restart the service using
systemctl restart ble-keykeeper.service
- Press the button on your coin. Does it blink? If yes, it found the central.
- Check the service logs with
journalctl -u ble-keykeeper.service
. Scroll to the bottom - do you see something like [INFO:root:winnies's coin (100%🔋) authenticated]?
- The service uses a very simple database to save all the required names and keys. It is saved in the
central.txt
,coins.txt
andnames.txt
files. - Every line in
coins.txt
represents a coin as a space-separated tuple of (address, irk, ltk, spacekey). If you remove a line and restart the service, the respective coin will no longer be able to connect. - Each line in
names.txt
represents an optional name for a coin's address as a space-separated tuple of (address, name). Edit as you like - it will not affect authentication - but don't break the format. Changes will only be applied on service restart.