koenvervloesem / openhaystack-zephyr

Zephyr-based OpenHaystack firmware to track your personal Bluetooth devices via Apple's Find My network
MIT License
49 stars 6 forks source link

is this able to run on the nrf51822? #3

Closed beckmx closed 1 year ago

beckmx commented 1 year ago

Hello there, I was checking your repo and noticed that you focused more on the nrf52? I was wondering if this can be targetted to the nrf51 as well

koenvervloesem commented 1 year ago

As far as I know, I've used nothing specific to the nRF52 SoC in the code, it's just that these are the only ones I had available for testing. Have a look at Zephyr's supported boards, there are a couple of nRF51 devices there (for instance the nRF51 Dongle is using an nRF51822). With a supported board, it should just be a case of using the right $BOARD in the build command west build -p auto -b $BOARD -s app.

beckmx commented 1 year ago

I added this board:

[env:nrf51822]
platform = nordicnrf51
board = nrf51_dk
framework = zephyr
upload_protocol = stlink
debug_tool = stlink

I am not an advanced user for nordic devices but after flashing the device I am not seeing it sends data, at least not in the openhaystack mac app, could it be the softdevice?

koenvervloesem commented 1 year ago

Can you check with a Bluetooth scanner what the device is sending? For example with HumBLE Explorer or with nRF Connect for Mobile.

beckmx commented 1 year ago

I checked on humble, very nice interface, I think the bt address should be a good add-on, there are tons of devices around me, let me go to a less noisy place

koenvervloesem commented 1 year ago

If you're using HumBLE Explorer on macOS, you can get the actual Bluetooth addresses of scanned devices with the -m option. However, this is relying on an unsupported internal API and doesn't work on all macOS versions (that's why it isn't enabled by default).

With the default public key "OFFLINEFINDINGPUBLICKEYHERE!" in the firmware you flashed, you should clearly see part of this string in the advertising data in the Bluetooth scanner.

beckmx commented 1 year ago

I managed to understand more of humble, so basically the advertising key is what I look for, right? I changed the code like this:

static char public_key[28] = {0xb9, 0xa5, 0x97, 0x50, 0x6, xyz.... };

according to the code my address should start with 0xF9... but it doesnt show up, one important thing is I am manually uploading the file called zephyr to the nrf51822, i tried with both zephyr.bin and zephyr.hex but no luck yet :(

koenvervloesem commented 1 year ago

Maybe try to flash the Blinky example from Zephyr first to verify whether the firmware is really running on the device. This should blink the default user LED.