Closed beemach closed 8 months ago
Hmmm, just looking at this on my phone (limited)… strange that it doesn’t think that UUID is available. What BT hardware are you using? I’ve had trouble before with my Mac caching a bunch of characteristic info. This is resolved by using the OS ‘forget device’ if available, or generally resetting whatever is responsible for the BT stack. Worth a try. If this doesn’t help, next step probably to dig a bit deeper.
Thanks @pbutterworth. I’m using a raspberry pi4 as my Bluetooth host that is 2m from the astralpool Chlorinator. I will do some deeper debugging to find out what is going on and report back here in case others hit the same issue in the future. I have another PI I will try to rule out a hardware issue. Thanks for creating this API - much appreciated!
@beemach, have you tried cold restarting the pi? I seen some strange issues with BLE that was fixed with a cold restart.
Thanks for your help @DanielNagy and @pbutterworth. Cold restart didn't work. In the end I found an OS level bluetooth caching issue was the culprit - No issues in pychlorinator.
/var/lib/bluetooth/[pi-blue-tooth-mac-address]/cache/POOL01-mac-address
When I removed this cache file, re-ran my pychlorinator client it worked perfectly. Not sure how the cache became out of sync. Image shows the difference between the correct and failure cache.
hostnamectl
Static hostname: rpi4-homeserver Icon name: computer Machine ID: e0add2b48e764adabfe6df20a6a0ffcf Boot ID: 42f7bfafad28456f97f11d09674fd4df Operating System: Debian GNU/Linux 11 (bullseye) Kernel: Linux 6.1.21-v8+ Architecture: arm64
I will consider a way to clear the cache periodically in my client to avoid the issue again and improve reliability.
Hi @pbutterworth - I'm trying to build a generic python application around your awesome work that takes many of the attributes from an AstralPool viron and publishes them on a regular basis to an MQTT which in turn enables multiple use cases - including the ability to be used in OpenHAB an other applications.
My early beta versions were working find, however, for some odd reason I'm now consistently receiving the following error. I've been updating dependent packages so not sure if something new has happened which may have broken things? My Alstralpool firmware version is v5.6.
main - ERROR - Failed _gatherdata: main - ERROR - Exception trace Traceback (most recent call last): File "/home/pi/pyastralpoolpublisher/pyastralpoolpublisher/pyastralpoolpublisher.py", line 97, in main data = await chlorinator.async_gatherdata() File "/home/pi/.cache/pypoetry/virtualenvs/pyastralpoolpublisher--xa-O3E4-py3.9/lib/python3.9/site-packages/pychlorinator/chlorinator.py", line 141, in async_gatherdata await client.write_gatt_char(UUID_MASTER_AUTHENTICATION, mac) File "/home/pi/.cache/pypoetry/virtualenvs/pyastralpoolpublisher--xa-O3E4-py3.9/lib/python3.9/site-packages/bleak/init.py", line 659, in write_gatt_char await self._backend.write_gatt_char(char_specifier, data, response) File "/home/pi/.cache/pypoetry/virtualenvs/pyastralpoolpublisher--xa-O3E4-py3.9/lib/python3.9/site-packages/bleak/backends/bluezdbus/client.py", line 848, in write_gatt_char raise BleakError("Characteristic {0} was not found!".format(char_specifier)) bleak.exc.BleakError: Characteristic 45000003-98b7-4e29-a03f-160174643001 was not found!