Code Monkey home page Code Monkey logo

openhaystack-firmware's Introduction

OpenHaystack - (ultra low power) alternative firmware

This is an alternative OpenHaystack firmware based on https://github.com/seemoo-lab/openhaystack/tree/main/Firmware/Microbit_v1/offline-finding but using the Softdevice from Nordic Semi. This way it will use a lot less power than the original one. It seems that a CR2032 may last almost 3 years! seemoo-lab/openhaystack#57 (comment)

Setting up

Get submodules

git submodule init
git submodule update

Install required dependencies

  • nRF command line tools brew tap homebrew/cask-drivers; brew install --cask nordic-nrf-command-line-tools

  • binutils brew install binutils

  • gcc-arm-none-eabi brew install --cask gcc-arm-embedded

Compile the firmware

Follow instructions on the apps folder

openhaystack-firmware's People

Contributors

acalatrava avatar fauconspartiate avatar mowtschan avatar rkreutz avatar supaeasy avatar zakyum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openhaystack-firmware's Issues

nRF51822 with/without oscillator build process and energy consumption

I installed your openhaystack firmware alternative on an AliExpress beacon and it works great! Thank you.

I also ordered a YJ-15013-NRF51822 module and it is equipped with an oscillator.
Q: Is there a build parameter to specify the use of an oscillator when building the nRF51822 firmware (or should I create a new board definition)?

In the product description it is written: "Oscillator, in Bluetooth low-power applications, does not require an external 32kHz crystal, can be sectioned"
Q: Do you think having no oscillator consumes less energy indeed?
Q: Do you think I have to remove physically the oscillator from the board or using the firmware with no oscillator should prevent the microcontroller from powering the oscillator?

Build firmware fails

I tried to build the firmaware, but got the error, so can I build the firmware on macos?

NRF_MODEL=nrf51 make
BUILD OPTIONS:
  SoftDevice  s130
  SDK         11
  nRF         nrf51822
  RAM         16 kB
  FLASH       256 kB
  Board       BOARD_CUSTOM

  CC        ../../nrf5x-base/make/../sdk/nrf51_sdk_11.0.0/components/toolchain/system_nrf51.c
  CC        ble_stack.c
/var/folders/zs/rw8wlnrx6kq39jhksv6bt2lw0000gn/T//ccTJhp9G.s: Assembler messages:
/var/folders/zs/rw8wlnrx6kq39jhksv6bt2lw0000gn/T//ccTJhp9G.s:27: Error: SVC is not permitted on this architecture
/var/folders/zs/rw8wlnrx6kq39jhksv6bt2lw0000gn/T//ccTJhp9G.s:46: Error: SVC is not permitted on this architecture
/var/folders/zs/rw8wlnrx6kq39jhksv6bt2lw0000gn/T//ccTJhp9G.s:65: Error: SVC is not permitted on this architecture
/var/folders/zs/rw8wlnrx6kq39jhksv6bt2lw0000gn/T//ccTJhp9G.s:84: Error: SVC is not permitted on this architecture
make: *** [_build/ble_stack.o] Error 1

No Makefile

I'm trying to flash the nRF52 chip but I'm having a hard time. I'm new to all this, especially github, I tried running the "make build" command and I got this error message.
Screen Shot 2021-05-13 at 3 20 22 PM

Any tips on how to physically connect to suggested beacons?

(This is not an issue with the code, just asking since you might know the answer)
Hey,

Thanks for this work, seems very cool!

I'm just getting into BLE as a hobby and don't have much experience with hardware, so this is probably a silly question, but what tools do I need to program the hardware you suggested such as:

"AliExpress beacon" which can be purchased here https://www.aliexpress.com/item/32826502025.html

I have to solder the power supply and data pins for programming, right?
I have access to a soldering station, but I think that this might be too small to solder, no?

I have a similar beacon by Raytac:
https://www.amazon.com/dp/B081GYNM2G?ref_=cm_sw_r_cp_ud_dp_RFBYEBARPW5J6KK9CCJV
But its too small for me to solder and seems like it requires some more professional gear.

Thanks for the help!
Edan

Nrf81522 128kb aliexpress

with the base command

NRF_MODEL=nrf51 BOARD=BOARD_ALIEXPRESS ADV_KEY_BASE64=YOUR_ADVERTISEMENT_KEY FLASH_KB=128 make patch

thanks for your work

Cusk drivers deprecated

Installing cask-drivers gives this error message:
homebrew/cask-drivers was deprecated. This tap is now empty and all its contents were either deleted or migrated.

Batch creation of firmware

is it possible to batch create patch files?
ie. pull down the plist from haystack and then create the bins files by a scripts rather than copying and pasteing each key one by one.

Handy for people wanting to create tags in bulk

Trying to add a new board into the project

Hey there @acalatrava,

I'm trying to add the board PCA10059 from the latest sdk.
This is for a nrf52840 dongle.

I've added pca10059.h in the root dir and linked it into boards.h, compiled everything with a base64 key from UI but it does not want to show up ๐Ÿ˜ž

I had to modify pca10059.h and add NRF_CLOCK_LFCLKSRC part from another board.

I've checked the BLE advertisements and they are showing up every 5 sec just like in the code. Is there a way I can double check the actual key from the advertisement using an Android phone?

  • Decoding the address with xxd -P turns back:
base64 -D <<< uVXys0qVPiqsqVzZhb+IoLGZSWA9ToGCa1tDaA== | xxd -p 
b955f2b34a953e2aaca95cd985bf88a0b19949603d4e81826b5b4368
  • The advertisement from BLE Scanner Android app:

image

  • Dongle Address: CF:46:46:4C:49:4E

(I have 4 other original AirTags near the devboard and they show up constantly on Find My. The reciever is my Macbook 2019 on bigSur 11.5 and a couple of neighbouring iPhones)

Transmit interval in precompiled firmware? /

Rather questions than issues:

  • What is the set advertisement interval for the precompiled firmwares in this repo? And if I want to change it - how do I do so?
  • How do I specify a set of key for the rolling key feature as described here (and how many are reasonable?) i.e. in what format/order do I have to have to make them available?

Flash firmware with openocd works but there is no advertisement so far

I flashed nrf51 device with the firmware apps/openhaystack-alternative/compiled/nrf51_firmware.bin (without any modifications), I used openocd and stlink adapter. Flashing process worked without any issues but there is no advertisement so far, am I missing something?

Open On-Chip Debugger
> halt
target halted due to debug-request, current mode: Handler SVCall
xPSR: 0x6100000b pc: 0x000091f4 msp: 0x20003f48
> nrf51 mass_erase
nRF51822-QFAA(build code: H0) 256kB Flash, 16kB RAM
Mass erase completed.
A reset or power cycle is required if the flash was protected before.
> program /openhaystack-firmware/apps/openhaystack-alternative/compiled/nrf51_firmware.bin
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Adding extra erase range, 0x0001cc70 .. 0x0001cfff
** Programming Finished **
> resume
> exit

will the firmware binary will work on this ?

hi there ,
i am pretty new to all of this . ( i dont know how to compile , flash or have the requirement tools for it but i will learn as i go , if i am missing or need to buy anything else please share thanks in advance .)

will this work on this ? (note there is 2/4 options.)
i dont know which one i should get

2 with water proof case and 2 without i think they are the same except the water proof, but i still doesnt know the differences between the locate RSSI and the BEACON .

1, Beacon
2, RSSI
3, Beacon broadcast
4, Locate RSSI

which one do i get ? (and what are the differences)

https://www.aliexpress.com/item/32885909449.html?dp=cbk2pzevg8aqg8evooplmnr&cv=gooteis&aff_fcid=55daec68a7d14e90b1b548a2ed971e3f-1640358188177-03637-Ybe6y3B&aff_fsk=Ybe6y3B&aff_platform=aaf&sk=Ybe6y3B&aff_trace_key=55daec68a7d14e90b1b548a2ed971e3f-1640358188177-03637-Ybe6y3B&terminal_id=0847d94e233b4c4b95dc7362de6a809a

or this one

https://www.aliexpress.com/item/1005002808176962.html?dp=cbk3pzevg5aqg8djwweljzb&cv=gooteis&aff_fcid=8d841974062c40529a54d7678b66bba9-1640358461294-09480-Ybe6y3B&aff_fsk=Ybe6y3B&aff_platform=aaf&sk=Ybe6y3B&aff_trace_key=8d841974062c40529a54d7678b66bba9-1640358461294-09480-Ybe6y3B&terminal_id=0847d94e233b4c4b95dc7362de6a809a

thanks alot !

Increasing Bluetooth energy

Not sure if this is a silly question or not so excuse my ignorance. I have flashed both an ESP32 and the NRF51 with the same or close-to-the-same beaconing intervals. I notice that my ESP32 tags have a lot more fixes and I suspect that the BLE radio on the ESP32 is using a bit more energy to project that beacon further which is giving more opportunities for the beacons to be discovered.

Is this something that can be easily modified with the NRF51s? I would love to play a bit with beaconing intervals and energy levels and guageing the power draw to balance battery and precision with a bit more favor to precision.

Aliexpress Beacon OTA update

According to the Datasheet of the nrf51822 aliexpress beacons, which are made by holyiot, they support nrf OTA dfu by default

I haven't been able to build an ota package yet, most documentation seems to focus on the nrf52 family

It would be pretty useful not to have to solder swd to every tag

for ota to keep working after flashing, the sdk version needs to be updated to at least 12.1

NRF51822 Firmware not working

So I have 4 NRF51822 Bluetooth modules and flashed 2 of them with the original openhaystack firmware which worked fine and flashed 2 with this firmare, with 2 different builds with the following command:

NRF_MODEL=nrf51 BOARD=BOARD_ALIEXPRESS ADV_KEY_BASE64=*MYBASE64ADVKEY* make build

When reading: #2 I figured lets test with the other board config with the following command:
NRF_MODEL=nrf51 BOARD=BOARD=BOARD_SIMPLE ADV_KEY_BASE64=*MYBASE64ADVKEY* make build

But both of them fail to show up in OHS:
afbeelding

Running on a macbook 13 inch 2020
v13.5

Benefits of this alternative firmware?

Hi. Sorry if this is obvious or answered elsewhere, but I'm wondering if you could explain the benefits of this fork? I suspect this is the firmware I want, as it seems to be easier to flash via openOCD/SWD. I also see you're using the Nordic Softdevice, which implies that the original doesn't. I'm curious about the benefits of this?
Also if I were to flash this via SWD, would I flash it at address 0x0?
Thanks,
Dan.

micro:bit v2

Hola Antonio,

Any chance your firmware works with the micro:bit v2? If so how?

Thanks,
Anthony

Getting Beacon into OpenHaystack.app โ€“ right procedure?

I'm trying to get some Aliexpress beacons into OpenHaystack.app, and was wondering if I'm doing it right.
Here's my procedure as of now:

  1. Deploy a new NRF-accessory in OpenHaystack.app
  2. Right click on the new accessory, Copy Advertising Key -> Byte Array
  3. Edit main.c, swap out the string for {byte array}
  4. NRF_MODEL=nrf51 BOARD=BOARD_ALIEXPRESS make build
  5. Flash the beacon using openocd

There are no errors in this process, but I'm still not getting any location pings in OpenHaystack.app.

Any tips?

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.