Comments (14)
Hi @hismastersvoice, I am glad you appreciate my work.
I don't see any technical problems implementing your request, other than the code would get a little bigger, but I honestly don't see the benefit.
Could you explain in more detail why a continuous scan isn't right for you?
This would help me understand if this is a change that other users might need as well.
from esp32_bletracker.
Good moring @shogunxam,
thanks for you fast response.
The continuous scan is good as it is.
My need is...
- I start different action by entering the house or garage, defined to the right person.
- For battery saving reason, I don't what to do scanning <10 sec.
- If I open the door, in worst case it takes 10 sec. before the action is starting.
- For me this is sometimes to long
Now I want to start scanning by opening the door contact or when NFC access is granted.
Then I got in 1-2 sec. the right person, and can start action(s).
At the moment I only can do not personalized actions.
Thanks.
from esp32_bletracker.
I have created the branch Manual_start_stop_scan. I haven't tested it yet, just wrote a first draft of the code.
I think I'll have time to work on it this weekend.
If you want give it a try, change the line 106 of the settings.cpp
from
manualScan = eManualSCanMode::eManualSCanModeDisabled;
to
manualScan = eManualSCanMode::eManualSCanModeOff
Than you should be able to start and stop the scan using the api
GET http://<device_ip>/scan?on=1
GET http://<device_ip>/scan?off=1
I think also
GET http://<device_ip>/scan?on
GET http://<device_ip>/scan?off
should be enough.
But I don't guaratee it works 😃
from esp32_bletracker.
Thanks !
Will try it, and come back.
from esp32_bletracker.
on=1 turned on the scan
off=1 turn off, but than starts spamming MQTT with a lot of messages.
Will have a closer look this days.
from esp32_bletracker.
I have updated the branch adding a new check box in the configuration page to enable/disable the manual scan (by default is disabled) and than when the scan is off the device state is published only every two minutes.
Could you please give a try and let me know what do you think?
from esp32_bletracker.
Thanks for changing...
I'm on a business trip until Friday morning, test on Friday afternoon.
from esp32_bletracker.
@shogunxam
Thanks for working on a solution!
Works like you describe...
But the result of the scan is also submitted after e.g. 10 sec., so if I scan automatically or manual is the same timing.
Or do I understand the function wrong?
from esp32_bletracker.
When the scan is enabled in auto or manual mode the timing of the publication is the same.
When the scan is set to manual but it's off, to avoid to spam on MQTT (because there is no more the delay of the scan), the publication of the state is sent every 2 minutes. Obviously when scan is off the BLE device will be considered non present.
If this is sufficient for your needs I'll merge the changes in the master branch.
from esp32_bletracker.
"If this is sufficient for your needs I'll merge the changes in the master branch."
Yes an no... ;)
My idea was to get faster Information about presence, now I had in both situations the 10 sec. or however the scan time is set.
When I look with my little knowledge to the code, the scan result are submitted after the full scan-period e.g. 10 sec., and not after new device was found. I'm not sure, but it looks like that I only can set down the scantime, and start / stop by a logic to get faster results.
Is it possible the the manual scan stops after every loop automatically?.
So I don't have to set two commands.
Also it is more reliable if the scan?off=1 not reach the controller.
from esp32_bletracker.
I don't have full control over the BLEScan library, it's a 3rd party library.
This library take in input a time for the scan and a callback. In this callback I get the advertised devices but I don't have control on the main loop of the library where it waits until the scan period is ended.
You can reduce the scan period, but I cannot stop the manual scan when the scan ends, because in that period the device could not be advertised. You should stop the scan when you are informed about the presence of the new device.
Also, reducing the scan period could cause you to lose a second device.
from esp32_bletracker.
Thanks for explanation...
I habe installed today an additional motion detector, so the scan starts some second before the user reach the door.
So together with the door contact it fits now perfect with the manual scan an the 10 sec scan time.
Thanks again for do the changes special for me.
Now I have the perfect solution!!!!!!! ;)
from esp32_bletracker.
Please take the changes to the master branch, so everybody can use it.
from esp32_bletracker.
Also I have change the Hardware today to XIAO ESP32-C3 with external Antenna and the scan radius is amazing.
I only need only 2 instead of 4 devices to cover the house and garage.
from esp32_bletracker.
Related Issues (20)
- FHEM support request HOT 16
- Add the capability to set a static IP
- FHEM Mode exceptions HOT 49
- Friendly name to the MAC address HOT 2
- MAX_NON_ADV_PERIOD in control panel HOT 3
- Retain State and Battery level after black-out HOT 2
- Wrong time reported in the logs HOT 2
- Report the date and time of the last battery level detection HOT 2
- Last battery level status HOT 9
- New firmware release notification HOT 2
- Multiple esp32 network HOT 4
- Noob needs help HOT 2
- Running extremely slow? HOT 3
- Build problem HOT 7
- Implement a Mailbox Sensor,Led and MQTT message HOT 4
- only battery state ? HOT 2
- reset HOT 7
- sysinfo is published not after 2 Minutes
- The status of the gateway is unstable HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32_bletracker.