-
Notifications
You must be signed in to change notification settings - Fork 2
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
use several advertisement keys like https://github.com/dakhnod/FakeTag #1
base: main
Are you sure you want to change the base?
Conversation
Awesome! I wasn't aware of FakeTag. I'll be taking a look and reviewing this In a bit! |
I have the key_switch_interval set to 10 minutes, but I think the esp32 is rebooting (I'm not monitoring it constantly): I received reports up to the first 15-20 keys then it restarts from the first one. |
(though the latter is unlikely, since when I had the interval set to 5 minutes I could cycle through all the keys) |
Last night I left the esp32 connected to a good quality power bank (in case the reboots where caused by the power supply) and it only got reports of keys 0 and 1. Now I'm back to a 10 seconds interval and it cycles all 100 keys no problem (and I get reports of most of them). |
I added an option "save_key_index_to_flash" to save the current key index to flash. |
Is there a reason why you create a task with xTaskCreatePinnedToCore instead of just calling ble_setup in setup? |
I'm testing a version that does just that (ble_setup in setup and key switching in loop) and it seems to be working just fine (i'll let it run for a while to see if it crashes). |
still crashing 😞 |
I think the reboots were caused by the wifi reboot_timeout. |
I think now I really found the cause of the reboot: "[E][api:127]: No client connected to API. Rebooting..." |
I modified the component so that it rotates among several keys (I wouldn't want the eventual thief to be alerted there is a tag tracking him).
The configuration parameter key is now keys and it's a list (I tested with 100 keys). You can specify just one key and it will work like before.
There's a new configuration parameter key_switch_interval to specify the interval in seconds when the next key has to be used (by default 3600 = 1 hour).
Since it's the first time I touch esphome and the esp32 and I don't like C++ I'm not sure if what I did is 100% right.
I performed two tests:
In test 1 I missed a handful of keys (I don't know if it's because they weren't sent or my phone was too slow to scan.
In test 2 I only saw 59 keys out of 100, I don't know which apple device is picking my tag so I cannot say if this test is failing or it's OK. I'll leave it running with a 10 minutes interval and I'll check later if it picked up more keys.