Code Monkey home page Code Monkey logo

Comments (9)

craig-coburn avatar craig-coburn commented on May 27, 2024 1

Works perfectly. Thank you for your time and patience!

from openhaystack-zephyr.

koenvervloesem avatar koenvervloesem commented on May 27, 2024

So one way is:

  • Change the hardcoded key in src/main.c
  • Build the code with west build
  • Flash the code with nrfutil to your nRF52840 Dongle

This only works with the raw string, not with the Base64 encoded key.

If you have the Base64 advertisement key, for instance from the OpenHaystack app, you should run the openhaypatch.sh script as follows, after building your code with west build:

./openhaypatch.sh build/zephyr/zephyr.bin <base64 key>

This patches the file in build/zephyr/zephyr.bin.

from openhaystack-zephyr.

craig-coburn avatar craig-coburn commented on May 27, 2024

Thank you for your reply. Could I also please ask how long after you initially flashed your nRF dongle you started seeing the location data on OpenHaystack and what version of OpenHaystack you were using?

from openhaystack-zephyr.

koenvervloesem avatar koenvervloesem commented on May 27, 2024

Well, if you're lucky you should see your location in the OpenHaystack software on your Mac after a few minutes, but it can also easily take an hour or so, depending on the number of Apple devices in your neighborhood and when they relay the Find My data to Apple.

I don't remember the exact release I used last time I tried this firmware with OpenHaystack. This was in July 2021 :-)

from openhaystack-zephyr.

craig-coburn avatar craig-coburn commented on May 27, 2024

I am able to build and flash the firmware with no issues whatsoever and can find it on the airguard application but cannot get it to appear on OpenHaystack. Do you have any suggestions going forward? I am building and flashing the firmware on a Mac OS Big Sur operating system. To my understanding, the nRF SDK is not on MAC OS so I cannot load a soft device hex file onto the dongle. Did you need to upload a soft device to receive these advertisements on openhaystack or is there something else I can try? The picture shows the advertisements from an ESP32 (second FindMy device). using another repository and the dongle. Only the ESP shows on OpenHaystack

from openhaystack-zephyr.

koenvervloesem avatar koenvervloesem commented on May 27, 2024

No I didn't need the SoftDevice BLE controller, as Zephyr has a complete BLE stack.

I'm puzzled that it doesn't work, as my code is doing the same as the OpenHaystack ESP32 code.

Maybe try to build the firmware with the USB UART overlay and look at the logs with screen?

from openhaystack-zephyr.

craig-coburn avatar craig-coburn commented on May 27, 2024

Apologies, I'm a bit unfamiliar with how I can view the UART logs - to update on progress, I have installed and built the firmware on Ubuntu 20.04 and this was much easier than using MacOS. However, still having the same issue. Another warning I am noticing is that the array of char for the public advertisement key may be too long. As input, I have tried the byte array and escaped string versions of the public key that are taken directly from the latest version of OpenHaystack, but I believe that I may have the incorrect format. I was uncertain whether patching the .bin file after running the make command updated the .hex file that was flashed onto the dongle so I have been updating the public key directly in the main.c file. Many thanks again.
Screenshot from 2022-02-13 22-26-03
Here's another error I get when using the second build option:
Screenshot from 2022-02-13 22-46-52

from openhaystack-zephyr.

koenvervloesem avatar koenvervloesem commented on May 27, 2024

For the UART logs: run ls /dev/tty* (Linux) or ls /dev/cu.* (macOS) in a terminal window, connect your board and run the command again to check which port appears. On Linux, this will probably be /dev/ttyACM0. Then run screen /dev/ttyACM0 115200 to connect to port /dev/ttyACM0 with a speed of 115200 bits per second.

The warnings about the default values for the USB vendor and product ID are harmless, this doesn't affect the functionality.

The error about the char array is important, though. You have to initialize it like this:

static char public_key[28] = {0x61, 0xc4, 0xc2, 0x55, ...}

Just fill in all bytes of the key instead of the ellipsis. Note that it doesn't have double or single quotes in this case, as you're creating an array of bytes now, while the example key is created as a string for easier identification.

from openhaystack-zephyr.

koenvervloesem avatar koenvervloesem commented on May 27, 2024

Thank you for your questions, they made me clarify some topics that weren't fleshed out enough in the README: 857b2c5

from openhaystack-zephyr.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.