Closed ilgrank closed 1 year ago
I agree on this fact, nevertheless having passive per default could generate more support with users not seeing their devices. I have another idea in mind that should make everybody happy, give me some time to implement it.
Thanks! You mean something like an MQTT command to enable/disable it?
Also, while I'm at it, and as I don't want to flood you with issues, since this is just another suggestion.. IMHO it would be great to allow to retain a (password-protected) configuration webpage after the initial wifi config one.
I spent most of the time configuring OpenMQTT with an issue (my fault) I had with my MQTT broker, and so every time I had to re-set, re-configure and hope for the best, until I found what my problem was, dozens of resets later.
Having a webpage (tasmota-like) for configuration would have made changing config way easier (and since I had issue connecting with my broker, using MQTT to reconfigure was not an option)
Again, thanks!
Thanks! You mean something like an MQTT command to enable/disable it?
We have already this for info https://docs.openmqttgateway.com/use/ble.html#setting-if-the-gateway-use-active-or-passive-scanning
For the web page, this is something that I'm considering
Double thumbs up for the Web page, it would make things a lot more practical 👍
Whoops, sorry, completely missed that page :( edit: after disabling Active scanning, I do still receive passive beacons, but they don't get decoded. , eg:
{
"id": "A4:C1:38:36:20:D6",
"mac_type": 0,
"rssi": -55,
"servicedata": "d6203638c1a44708a013180c641705",
"servicedatauuid": "0x181a"
}
If I get it right, the servicedata
should be carrying the sensor readings... i'm missing something else?
And they are decoded when you turn active scan ON ?
If it is an LYWSD03MMC with PVVX, you may have to try to change the name to have ATC_ in it. Or alternatively, you can flash this patch which is less restrictive than the production one: https://docs.openmqttgateway.com/dev/upload/web-install.html
made all the tests with retained messages as you suggested
had the sensor data -> turned active scan off -> no more data turned active scan back on -> still no sensor data power cycled the ESP32 (still with active scan retained message) : now I have data
edit: been able to reproduce by setting active scan off again -> no sensor data. (running pvvx firmware with pvvx data format)
edit2: installing https://docs.openmqttgateway.com/dev/upload/web-install.html right now
did you try this different binary: https://docs.openmqttgateway.com/dev/upload/web-install.html
sorry, edited while you were replying, I'm already flashing it, will take some minute to reconfigure
If you don't erase you don't have to reconfigure for info
I can confirm that with this version it works perfectly! I also can confirm that the active scan is still off as I see way less devices (actually, just the Xiaomi sensors)
If you don't erase you don't have to reconfigure for info I had fear that keeping the 'old' config with the new build could mess things up
Great, we will integrate it into the development branch for the next release
again, my thanks! 👍 🥇
btw: I've checked the "Contribute" page, and I would want to make a donation, but apart from contributing code (alas, I'm not able to) is there a way to tip the project (or, as the page says, its contributors?) Edit: I found your PP address in a 5 year old issue : https://github.com/1technophile/OpenMQTTGateway/issues/35 is that one still valid? :)
Thanks for asking, to tip the project you can purchase the Theengs app https://app.theengs.io/ Or a Theengs Plug if you are in the US or Canada https://shop.theengs.io/
Alas, not in USA/CA, and will surely try Theengs in the future, hope that that PP address is still fine :)
Send me an email to florian@theengs.io I can share you a link
Received on the previous address thanks
Naive question, how do I setup passive mode? (so that it reacts on every BLE advertisement)
No matter how I'm trying to do it (BTConfig.forcePassiveScan = true in ZgatewayBT.ino or sending command messages: { "forcepscn": true } or { "forcePassiveScan": true }) it does not really work for me. The gateway still seems to scan and connect to individual devices (at least based on serial messages).
I'm using ESP32 with LYWSD03MMC thermometers running ATC firmware sending ads every 10s, but MQTT messages I receive come every minute or so.
Hi @jacol-code
There are two different scanning intervals for passive and active scanning
TimeBtwRead - interval between passive scans https://github.com/1technophile/OpenMQTTGateway/blob/development/main/config_BT.h#L103
and TimeBtwActive - interval between active scans https://github.com/1technophile/OpenMQTTGateway/blob/development/main/config_BT.h#L84
hence your
… come every minute or so
as the default for both is 55 seconds.
So you can adjust these separately to your requirements.
Hope this clarifies things.
According to @pvvx, BLE active scanning does greatly reduce BLE battery life:
(original commend here) So wouldn't it be 'wiser' to default to passive scanning?