Comments (16)
I'm running into this (one of my sensors 'drifts' in and out of Bluetooth range, so I'm seeing this pretty often) - will try out the fix @jboeddeker and @JoanMCD over the next few days and put up a PR unless someone beats me to it
from miflora-mqtt-daemon.
That's exactly what i did. :-D
I am testing it currently. I will do a PR when i am confident this helps.
from miflora-mqtt-daemon.
Thomas, thanks for adding this in and maintaining this daemon. It works great and makes it much easier to work with the MiFlora!
from miflora-mqtt-daemon.
Thanks for the bug report!
As I am not able to do serious development right now I would very much appreciate if one of the others reading could have a look. Thanks!
from miflora-mqtt-daemon.
I enjoy the same. At first, i configured the service as restart=always, but that doesn't help.
I am quite clueless regarding python, but i did a change. I added the "BluetoothBackendException" which is raised by the backend to the "IOError" Exception handler.
Similar is in line 314. Only IOError Exception is handled, but BluetoothBackenException is raised.
But as i said, i am clueless with python, this may be nonsense.
from miflora-mqtt-daemon.
Hey guys, I had a quick look.
You are on the right track. Simply replace IOError by the new more specific one. As I didn't check if an IOError could still occur, let's catch both.
Please replace those two lines:
miflora-mqtt-daemon/miflora-mqtt-daemon.py
Line 221 in 9cf5482
miflora-mqtt-daemon/miflora-mqtt-daemon.py
Line 316 in 9cf5482
by
except (IOError, BluetoothBackendException):
If you can proof the correct behavior please let me know and I'll add the change (or you can push a PR!) Thanks!
from miflora-mqtt-daemon.
@jboeddeker good job, thank you very much!!
line 15:
from btlewrap import available_backends, BluepyBackend, GatttoolBackend, PygattBackend, BluetoothBackendException
from miflora-mqtt-daemon.
Thanks. I currently just use the import of BluetoothBackendException. Are all of these neccessary?
Line 15:
from miflora.backends.gatttool import GatttoolBackend, BluetoothBackendException
Service doesn't stop anymore, although i have an unreachable sensor.
from miflora-mqtt-daemon.
hmm, no.
I only want to hint that in comparism with the original code I have to add the BluetoothBackendException
BluepyBackend
and PygattBackend
are alternative backends. BluepyBackend
is more stabile as I read, but I still use GatttoolBackend
from miflora-mqtt-daemon.
Exchanging the backend would be the main task for a next version.
If any of you wants to create a PR with the needed changes, that would be very much appreciated!
from miflora-mqtt-daemon.
OK, i made the changes. Works fine. But i am confused with github. (Not really used to it, still use SVN for all my projects.)
I made the changes in the version installed on my pi with openHABian. Works.
I created a fork and a branch, but this is a more recent version (some work is done to the backends). Cloned my fork, changed it and this works as well.
But how can i apply the changes to the version which was cloned to my pi by openhabian? This is a simple bugfix and people needing the bugfix, shouldn't go to a new version manually to obtain this.
from miflora-mqtt-daemon.
In order to create a PR here you could actually just work with the GitHub provided editor. As the program is just one script file it is easy to add all changes, then create a PR based on that. After the PR was accepted and merged, you should be able to update your setup on the Pi by re-executing the openhabian-config step.
from miflora-mqtt-daemon.
Hey guys, are you still working on this PR?
from miflora-mqtt-daemon.
Whats the status on this?
from miflora-mqtt-daemon.
Any update on this?
from miflora-mqtt-daemon.
Deeply sorry for the delay guys. This should be solved now.
from miflora-mqtt-daemon.
Related Issues (20)
- Its possible to change MAC address in MyFlora sensor? HOT 2
- Bluepy error after apt update && upgrade HOT 1
- Daemon connects and collects data but does not publish to openhab HOT 3
- `$ sudo hcitool lescan` - Input/Output error HOT 2
- Anyone with problems? ->Miflora Firmware 3.3.5 HOT 4
- Failed to retrieve data from Mi Flora sensor but `bluetoothctl` detects all data HOT 2
- Light measurement disturbed by flashing LED HOT 1
- Installation fails HOT 8
- Add config option for "expire_after" HOT 2
- running as service in python3.10 HOT 3
- Api changes in miflora break miflora-mqtt-daemon HOT 4
- Brightness value wrong HOT 6
- MQTT Push - Topic not case sensitive HOT 2
- Last Message timestamp HOT 2
- Project dependencies may have API risk issues HOT 1
- Running on ESP32 HOT 1
- Change unit of light sensor from "lux" to "lx" HOT 1
- Support for Flower Care Max sensor?
- one sensor stopped answering, but works in the app HOT 2
- Error: The MAC address "..." seems to be in the wrong format. HOT 2
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 miflora-mqtt-daemon.