-
Notifications
You must be signed in to change notification settings - Fork 5
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
Non blocking miThermometer.getData() #3
Comments
This makes sense! It may take a while until I find some spare time to work on it, though! In any case, I recommend to use https://github.com/matthias-bs/ATC_MiThermometer instead of this repository. |
Did you have a look at this? It seems to be possible to set a "scan end callback". |
Thanx for your answers. |
Oh, that's good news! Would you mind providing your code as an example? You can either fork the repository and make a pull request or attach your code to this issue and I will try to integrate it. |
|
I have a github account, but I'm not fluent at all with forks and pull requests. |
Thank you very much in advance! |
A little bit complicated, with a lot of data copies.
|
Hi, thank you very much! I added it to the examples directory. The CI run (see https://github.com/matthias-bs/ATC_MiThermometer/actions) gives me a compile error due to FreeRTOS missing:
Where can I find it to include it in the build run? Thanks in advance! Matthias |
O.k., it works if I comment out this I also had to add the following for the generic
Which target have you been using? |
Please let me know when you think you have a stable version; I will create a new release then. |
I am configuring my Arduino IDE (2.0.3) for the board Wemos R1 D32. |
Sure. |
Hmmm... I could not find it in Arduino IDE 1.8.19. Now I've updated to 2.0.3. The sketch still compiles without installing FreeRTOS explicitely. And the documentation for this library says it's for AVR targets. I'm not sure if this is actually used for the ESP32. |
Is there anything to be done or can you close this issue? |
Hi @matthias-bs, I would like to extend it a bit: e.g: What do you think? +1: I also created a Struct to be able to bind together the Name of the sensor and the Mac address. |
Hi @bazooka02, That sounds good! Please feel free to implement the changes and make a pull request! Regards |
Hi, very happy to have found this library. I'd like to integrate several Mijia temp sensors in a home monitoring system.
Is your feature request related to a problem? Please describe.
The example (ESP32_ATC_MiThermometer_Client.ino) works well. However the miThermometer.getData() is blocking.
It's not a good news to have the ESP32 blocked for 5 seconds and not reacting to the user inputs
Describe the solution you'd like
A callback mechanism, integrated in the ATC_MiThermometer class, that would manage the sensor callbacks
Describe alternatives you've considered
Make use of FreeRtos to launch getData in a seperate task. But I'm not sure it's compatible with NimBLEDevice.h/.cpp
Additional context
Ideally my system would include a touchscreen and implement a thermostat feature.
Blocking that for 5s is not acceptable
The text was updated successfully, but these errors were encountered: