Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create our own tracker for $1! #74

Open
biemster opened this issue Dec 7, 2024 · 118 comments
Open

Create our own tracker for $1! #74

biemster opened this issue Dec 7, 2024 · 118 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@biemster
Copy link
Owner

biemster commented Dec 7, 2024

While it's fun to search the online mall for cheap bluetooth trackers, wait for a month for them to arrive and hope that they contain a flashable chip, let's instead make our own!

The target is very tight: $1 in quantity 100+

I've found a couple candidates already, but definitely would love to see some more suggestions in the comments.

Ideas so far:

  1. InPlay NanoBeacon IN100 as suggested by @Cyl0nius in Tracker running on single 1.5V coin battery #26
    https://inplay-tech.com/in100
  2. AK1595 beacon tx only IC
    https://www.akm.com/us/en/products/bluetooth-low-energy-beacon/
  3. Holtec Beacon transmitter BC7161 (likely needs a support mcu)
    by far the cheapest (~$0.2) if we can figure out how to omit the support mcu
    also might be difficult to source
    https://www.holtek.com/page/vg/BC7161
  4. WCH CH592 / 582, CH32V208 or similar
    These are very cost effective (~0.5) and already have a findmy firmware here
    https://oshwlab.com/biemster/ch592tag
  5. Telink tlsr825x
    Have very good support by @atc1441 and @pvvx for example
    but seem difficult to source
  6. Ci24R1 + CH32v003
    Another broadcast only chip + mcu, readily available on LCSC

In conclusion I think the CH592 is the prime candidate due to it's availability at jlcpcb for example, and low price and passives count. However I would really like to experiment with the TX only AK1595 and BC7161 for example, since they would do only the bare minimum.

Any ideas or suggestions are definitely very welcome, as are suggestions for a good fab house since this will be my first such project!

@biemster biemster added the help wanted Extra attention is needed label Dec 7, 2024
@biemster biemster self-assigned this Dec 7, 2024
@atc1441
Copy link

atc1441 commented Dec 7, 2024

https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_JieLi-Tech-AC6329C4_C5440081.html

@biemster
Copy link
Owner Author

biemster commented Dec 7, 2024

https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_JieLi-Tech-AC6329C4_C5440081.html

That one looks awesome, $0.35 even quantity 1! Have you ever programmed one of those?

@atc1441
Copy link

atc1441 commented Dec 7, 2024

Its flashable, but its has a very bad deep sleep :( So not good for a tracker

@biemster
Copy link
Owner Author

biemster commented Dec 7, 2024

aww that's a pity, I could not find that in the datasheet indeed

@pvvx
Copy link

pvvx commented Dec 7, 2024

Cheap keys on ST17H66B are fully mastered (https://pvvx.github.io/iSearching/)
The THB2 project uses SDK for GCC, modified by me and froloffw7, does not contain blobs. Has all sources in C for assembly. Full reverse engineering has been done.
The "KEY2" firmware contains an example of a ready-made BLE button for working in Home Assistant using the BTHome protocol.
image

BLE OTA is supported in PHY62x2BTHome.html.


Dependence of average consumption of a device of type "KEY2" on the BLE advertising interval:

image
Vcc 3.0V. RF TX Power up +0 dBm (10..13+ mA).

"KEY2" Power:
Sleep + RTC: 1.67 uA at 3.0V
Deep-Sleep + KEY (GPIO Int): 0.48 uA at 3.0V
Sleep + RAM + RTC + KEY (GPIO Int) - 3.1..3.3 uA at 1.8..3.3V
Active cycle of work with transmission of BLE advertising with BTHome data - 5 ms, average 7.2 mA (peak up to 18 mA).

Using Deep-sleep is inconvenient - loading the code and initialization takes up to 100 ms with an average current of 7.15 mA.
Similar to normal operation in sleep+RAM mode, average consumption will be obtained when operating in deep sleep mode with a BLE transmission period of 240 seconds.
image

@atc1441
Copy link

atc1441 commented Dec 7, 2024

Also while 1,50$ and not 1$ this is quite unbeatable in a DIY solution, cheap plug of my FindMy Video :D
https://youtu.be/RPGuPyxdHVw

@biemster
Copy link
Owner Author

biemster commented Dec 7, 2024

The ST17H66B is what started this project a couple years ago indeed :) Do you know any online pcb factories that still have them @pvvx ?

@pvvx
Copy link

pvvx commented Dec 7, 2024

https://aliexpress.ru/item/1005004397030802.html
image
$1

And similar...
There are more than 5 types of cases on Aliexpress.
The one in the picture is the cheapest.


Support for ST17H66B/PHY62xx operation in "LE Long Range" mode (this is BLE at a range of 500+ meters) has not yet been published in my SDK, but it has been implemented and tested for a long time. If I have time, I will publish such options as well.
I'm not very interested in Zigbee. Zigbee has too short a range compared to "LE Long Range" and high power consumption.


https://aliexpress.com/wholesale?SearchText=ST17H66
image


The cheapest chips that can be ordered in our country from official suppliers are chips from WCH.
There is no need to publish projects - all SDK variants from WCH are available in the public domain.
Some WCH chips have been used in my production for a long time (in industrial production). But these are not public projects.
(In industrial production, the price of electronic components is the last thing to be considered. There, other criteria are more important, which are far from being used for household purposes...)

@pvvx
Copy link

pvvx commented Dec 7, 2024

The cheapest CH582M.
Broadcaster is the default test case from the WCH SDK. (Tested in 2022)
Broadcaster - BLE advertising only, no ability to connect or respond to scanning.
image
RF TX 0 dbm. In the example from the SDK changed: HAL_SLEEP=1, DEBUG - disabled, #define DEFAULT_ADVERTISING_INTERVAL 4800 (3 sec), DC-DC enabled.

On TSLR825x with similar parameters (3 sec, 0 dB) the average current is less than 5 µA, sleep is less than 1.8 µA (32 KB RAM is constantly active), the maximum peak during transmission is about 7 mA.

@pvvx
Copy link

pvvx commented Dec 7, 2024

It is worth remembering that for beacons like iSearching and similar, the BLE advertising period should be 1 second. But there is not a single SoC that can last 1 year on CR2032 in this mode.
With pulse consumption (pulses up to 8 mA), the capacity of the average CR2032 is only up to 100 mAh. CR2032 batteries costing more than the key fob itself have a slightly higher capacity.

CR2450 will work more than 2 years, only due to lower internal resistance (lower voltage drop under 8 mA load).

As a result, the price of the chip is completely unimportant if CRxxxx batteries are used. It will cost less than the price of the battery.
Cheap alternative only 2xAAA.

Another solution is to install a large capacitor in the power supply chain (more than 100 uf). But for a capacitor with a large capacity and low leakage, the price is already equal to or higher than the SoC price :)

The target is very tight: $1 in quantity 100+

When shipped with battery and 1 year of operating time = Impossible goal at the current technological stage of manufacturing cheap SoCs (if you are not in China) :)

@pvvx
Copy link

pvvx commented Dec 8, 2024

https://www.lcsc.com/product-detail/RF-Transceiver-ICs_PHYPLUS-PHY6222AAQC_C2836482.html

Qty. Unit Price Ext. Price
1+ $ 1.7501 $ 1.75
200+ $ 0.6788 $ 135.76
500+ $ 0.6538 $ 326.90
1000+ $ 0.6428 $ 642.80

:) :) :)

THB2, BTH01 - They can be less than $1.5 each on Aliexpress.


In WCH SDK, working with "LE Long Range", "PAwR" (new Bluetooth standards v5.4) is only available for CH32V208.
"LE Long Range", "PAwR" and standard encryption of BLE advertising in BT5.4 completely kills Zigbee.

Previously, several WCH LinkW (CH32V208) were purchased on AliExpress for $1.5, including shipping.
image
image

@pvvx
Copy link

pvvx commented Dec 8, 2024

@pvvx
Copy link

pvvx commented Dec 9, 2024

pvvx/THB2#94

@biemster
Copy link
Owner Author

biemster commented Dec 9, 2024

That looks awesome @pvvx ! Very interested in the st17h66 BLE Long Range mode.

@pvvx
Copy link

pvvx commented Dec 9, 2024

In the "Coded PHY" mode, the PHY chips have problems - the RF part slows down. The delays do not fit the specification. This affects the switching speed of the RF part TX-RX... But FindMy does not use reception.

(In the chip, the IRQ from the radio frequency part (mode PHY Coded) arrives with a delay - another error in the PHY62x2/ST17H66 chips. This affects the processing of the BLE connection request. The CPU does not have time to process the request in time, since the IRQ arrives with a delay. But this seems to have been cured...)


And where can I find a full description of the format of the data transferred for FindMy?
The available descriptions and the provided sources are more like a game of kindergarten.

@biemster
Copy link
Owner Author

biemster commented Dec 9, 2024

Do iDevices still register those broadcasts? I remember reading somewhere that even if an iPhone/iMac is able to do coded phy, it will not report findmy broadcasts sent in this mode.

@biemster
Copy link
Owner Author

biemster commented Dec 9, 2024

And where can I find a full description of the format of the data transferred for FindMy? The available descriptions and the provided sources are more like a game of kindergarten.

I actually do not know of any official documentation of this, although oems can get "Works with Apple FindMy" for their tags so it must be somewhere?

@pvvx
Copy link

pvvx commented Dec 9, 2024

I don't use Apple devices. None of them suit me in terms of functionality.
So I don't know anything and can't check. I don't even want to have Apple devices for testing.

@atc1441
Copy link

atc1441 commented Dec 9, 2024

I don't use Apple devices. None of them suit me in terms of functionality. So I don't know anything and can't check. I don't even want to have Apple devices for testing.

Same :D

The FindMy is only reverse engineered as there is no official doku available

@biemster
Copy link
Owner Author

biemster commented Dec 9, 2024

yup same here too :) although I did buy a mini for testing, which turned out to be useless

@pvvx
Copy link

pvvx commented Dec 9, 2024

nRFConnect:
image

Device data used:
image

The Key used is simply a random sequence of numbers.

@pvvx
Copy link

pvvx commented Dec 9, 2024

A MAC address with 0xC0 (bits 7 and 6 in "1") in the first byte is a random MAC address. And it should be marked as Random in the BLE advertising data. But there is no mark in the BLE packet flags, if you look at the FindMy "childish writing".

@biemster
Copy link
Owner Author

biemster commented Dec 9, 2024

yeah they are really abusing the mac address to get some extra bytes there

@pvvx
Copy link

pvvx commented Dec 9, 2024

But they don't put a mark in the flags that it's "Random MAC"?

Why then isn't "Extended Advertising" used - the length of the message is in kilobytes...
Apple only use older Bluetooth v4.2 chips in its devices?

The FindMy is only reverse engineered as there is no official doku available

There are still a lot of questions.
It turns out that this is not a complete "reverse engineered", but only a basic one, without analyzing the simple BLE format.
Need to wait until they finish this or give an example of a full BLE ad package, not just a portion of the transmitted payload (PDU).

@biemster
Copy link
Owner Author

biemster commented Dec 10, 2024

I was thinking to have something like this built: https://oshwlab.com/biemster/ch592tag
nanotag
nanotag_3d

@biemster
Copy link
Owner Author

biemster commented Dec 10, 2024

The ceramic antenna actually is much more expensive than I thought (0.4), exchanging that for a PCB one will result in 30 assembled modules for EUR 40 (which is 1.33 per tag, not bad!)

@pvvx
Copy link

pvvx commented Dec 10, 2024

There is no button - without it, it is difficult to work with such a sensor. You can't update it, you can't change the key...
A ceramic antenna usually has a worse operating range than an antenna correctly routed on a printed circuit board (size matters).

@biemster
Copy link
Owner Author

biemster commented Dec 10, 2024

I knew I forgot something!

@atc1441
Copy link

atc1441 commented Jan 13, 2025

Not 1$ (More like 10$) but also interesting in general.
A ST17H65B Ultra flat Find My Compatible device from Aliexpress:
https://de.aliexpress.com/item/1005007625677230.html

Firmware dump:
SmartCard_st17H65B.zip

20250113_114733

20250113_114806

@atc1441
Copy link

atc1441 commented Jan 13, 2025

By the way here is a leak of the FindMy SDK https://github.com/goodix-ble/BLE.REF.PEPS/tree/master/device/projects/references/eBike/ble_app_multi_slave/Src/fmnadk

Not sure how the certification on Apples side works but this could enable the creation of a real compatible FindMy device if not every Serial number is registered pre sell at Apple

@biemster
Copy link
Owner Author

By the way here is a leak of the FindMy SDK https://github.com/goodix-ble/BLE.REF.PEPS/tree/master/device/projects/references/eBike/ble_app_multi_slave/Src/fmnadk

Thats a great find!

@biemster
Copy link
Owner Author

The APPLE_SERVER_ENCRYPTION_KEY is found in this repo too: https://github.com/LiePingWei/find-my-ncs

@pvvx
Copy link

pvvx commented Jan 16, 2025

HS09 is also suitable for FindMy.
Image
Has the smallest module with TLSR8258.

@yousaf465
Copy link

HS09 is also suitable for FindMy. Image Has the smallest module with TLSR8258.

aliexpress links?

@pvvx
Copy link

pvvx commented Jan 16, 2025

I bought these sensors here https://aliexpress.ru/item/1005007714955215.html
But with a discount.

And there really is an iron ring there, which is rare for such trinkets... :)

Image

Very rarely reports temperature and humidity (~10 minutes), transmits a button press event.
Average consumption is about 2 µA, taking into account transmission once every 10 minutes.

But the sensor is bad - CHT8305 minimum power supply 2.5V.

@biemster
Copy link
Owner Author

HS09 is also suitable for FindMy. Image Has the smallest module with TLSR8258.

great find, that module is exactly what I'm trying to build! I'll try my luck on Alibaba to see if i can track down the manufacturer of that one

@atc1441
Copy link

atc1441 commented Jan 16, 2025

TLSR with the "Z2" Markings are always Tuya
https://developer.tuya.com/en/docs/iot/ztc-module-datasheet?id=Kbhmqqqhjxrh7

@khongpt
Copy link

khongpt commented Jan 17, 2025

HS09 is also suitable for FindMy. Image Has the smallest module with TLSR8258.

great find, that module is exactly what I'm trying to build! I'll try my luck on Alibaba to see if i can track down the manufacturer of that one

Looks very promising. Is it possible to alternate broadcasting location with thermometer values to the Apple's Find My network?

@biemster
Copy link
Owner Author

Looks very promising. Is it possible to alternate broadcasting location with thermometer values to the Apple's Find My network?

No data can be broadcasted (except a 2 bit status byte), the location of the receiver is what's in the reports on the network. You could however broadcast a different key for a different temperature range, and from that determine the current or past temperatures. This would however require you to write firmware that does that.

@pvvx
Copy link

pvvx commented Jan 17, 2025

It is possible to work immediately in BLE and Zigbee, and the transfer of Findmy beacons.
At the same time, the most expensive part for the battery is Findmy.

At Zigbee, the transmission interval can reach hours. For Ble, a typical maximum transmission interval for the possibility of connecting is 10 seconds. But if there is a button, then it is possible to turn on the mode of waiting for the connection. The rest of the time, BLE advertising can be transmitted much less often. BTHome format provides such options.

This particular Zigbee device transmits temperature and humidity at the following interval:

Image

This creates an average battery consumption of 2 µA.

(Temperature measured nearby:)

Image

Experimental firmware for devices on the TLSR825x chip operating simultaneously in Zigbee 3 and Bluetooth LE.

@biemster
Copy link
Owner Author

TLSR with the "Z2" Markings are always Tuya https://developer.tuya.com/en/docs/iot/ztc-module-datasheet?id=Kbhmqqqhjxrh7

That probably means we can't find them wholesale? So far I haven't been able to find a source for bare tuya modules 😢

@atc1441
Copy link

atc1441 commented Jan 17, 2025

@biemster
Copy link
Owner Author

This one actually looks very similar: https://www.lcsc.com/product-detail/ZigBee-Modules_TUYA-ZSC_C41364946.html

@atc1441
Copy link

atc1441 commented Jan 17, 2025

This one actually looks very similar: https://www.lcsc.com/product-detail/ZigBee-Modules_TUYA-ZSC_C41364946.html

That one is not TLSR it is Silabs

Repository owner deleted a comment Jan 17, 2025
@pvvx
Copy link

pvvx commented Jan 19, 2025

OTP
Image
ver2

Image

Image

Image

They go in the trash, except for the battery. :)

@teamcoltra
Copy link

teamcoltra commented Jan 20, 2025

I'll just drop in my usecase in case it overlaps with someone else:

I ship expensive goods to customers. I would love a 0.50-1USD option that would let me create a sort of "disposable"* tracker.

Battery life (to me) doesn't matter beyond a month or two.

I would create a program that has 30 or so apple IDs and fills each to the maximum id limit and has a database of which account is associated with which tracker.

Customer could put in tracking number and their package would have the find me overlayed with DHL / USPS / etc information. If it's not delivered on time or at all we could identify where the tracker is.

If anyone is going down this direction, my background is in Chinese sourcing so I would be happy to facilitate a group buy and do the sourcing and everything for free and would get in on the buy.

* I would try to set up a "no postage required" return envelope for environmental reasons to encourage people to send them back.

@pvvx
Copy link

pvvx commented Jan 20, 2025

Battery life (to me) doesn't matter beyond a month or two.

The problem with batteries is that the minimum required pulse current for operation is given only by CR2032 and larger batteries. And since CR2032 is the minimum, its operating time with the correct transmission intervals is up to half a year.

I would love a 0.50-1USD option that would let me create a sort of "disposable"* tracker.

And such a task fits into 0.5 dollars for a batch of a thousand pieces... But not for 30 pieces.

Repository owner deleted a comment Jan 20, 2025
Repository owner deleted a comment Jan 20, 2025
@biemster
Copy link
Owner Author

biemster commented Jan 20, 2025

The problem with batteries is that the minimum required pulse current for operation is given only by CR2032 and larger batteries. And since CR2032 is the minimum, its operating time with the correct transmission intervals is up to half a year.

(for @teamcoltra a cheap CR2032 seems fine considering their use case)

@pvvx Is the size constraint mostly determined by the thickness? Would a CR1632 suffice?

@teamcoltra
Copy link

And such a task fits into 0.5 dollars for a batch of a thousand pieces... But not for 30 pieces.

And this is the benefit of doing a group buy. I could pick up 500 or so but I don't need 2000 which I think would be a minimum order for something like this.

@biemster
Copy link
Owner Author

And such a task fits into 0.5 dollars for a batch of a thousand pieces... But not for 30 pieces.

And this is the benefit of doing a group buy. I could pick up 500 or so but I don't need 2000 which I think would be a minimum order for something like this.

I'd take 500 if they are $0.5 as well, maybe even more.

@pvvx
Copy link

pvvx commented Jan 20, 2025

Order a chip version with an OTP of several thousand. The Chinese will probably make it. :)

Would a CR1632 suffice?

CR1632 will not provide the required current.

@pvvx
Copy link

pvvx commented Jan 21, 2025

It's been over a month since FindMy was flashed. We can estimate the consumption from CR2032 a little.
Current statistics on battery consumption from CR2032 batteries in key fobs (fw: FindMy).
3 different CR2032. One is new, the other two were in these keychains.

Image

Two are just lying around, the one with the new battery is used every day by the kids - they turn on the floodlight outside...

@olivluca
Copy link
Contributor

All of them with the FindMy advertisement every 5 seconds, right?

@pvvx
Copy link

pvvx commented Jan 22, 2025

All of them with the FindMy advertisement every 5 seconds, right?

The transmission step is 5 seconds. But it is switched to a more consuming option with the ability to connect and in the BTHome format with periodic transmission of additional information in the form of a package with dozens of transmissions with a step of 70 ms. With FindMy, the consumption will be slightly less.

I don't need FindMy. No one in the forest will find it. :)
Around my plot, on three sides, there is only forest for several kilometers. And there are no more than a couple of pedestrians on the road every few months, and no one has Apple devices.
And if something gets lost, dogs will find it faster.

“FindMy” cannot work in BLE ”LE Long Range” (Coded PHY). And this significantly narrows the reception distance (about 4 times).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants