Skip to content
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

Daly error 147 - Bluetooth seems to work, but then fails #117

Closed
wimg opened this issue Jul 24, 2023 · 3 comments
Closed

Daly error 147 - Bluetooth seems to work, but then fails #117

wimg opened this issue Jul 24, 2023 · 3 comments

Comments

@wimg
Copy link

wimg commented Jul 24, 2023

The Daly device is detected over Bluetooth, but then Daly error 147 occurs.

Any idea what might be wrong ? I've tried the various Bluetooth troubleshooting steps, but they seem to have no effect.

Paste log output between BEGIN and END:
BEGIN 
11:13:45 INFO [main] Power cycle bluetooth hardware
11:13:49 INFO [bt] BT Discovery:
11:13:54 INFO [bt] BT Device   DL-76670203023E   address=76:67:02:03:02:3E
11:13:54 INFO [main] Bleak version 0.13.1a1, BtBackend version bluez-v5.66
11:13:54 INFO [bt] BMS DalyBt(76:67:02:03:02:3E) keep alive enabled
11:13:54 INFO [main] connecting mqtt @localhost

11:13:54 INFO [main] Fetching 1 BMS + 0 others serially, period=1.00s, keep_alive=True
11:13:54 INFO [sampling] connecting bms DalyBt(76:67:02:03:02:3E)
11:13:56 INFO [daly] found rx uuid to be working: 17 (tx 15, sx 48)
11:13:56 INFO [sampling] connected bms DalyBt(76:67:02:03:02:3E)!
11:14:04 ERROR [sampling] daly1 error: 147
11:14:04 INFO [sampling] Bleak version 0.13.1a1
11:14:12 ERROR [sampling] daly1 error: 147
11:14:12 INFO [sampling] Bleak version 0.13.1a1
11:14:12 ERROR [main] 1 exceptions occurred fetching BMSs
11:14:12 ERROR [main] Error (num 1, max 0) reading BMS: 147
11:14:12 ERROR [main] Stack: Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/tasks.py", line 490, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/bmslib/daly.py", line 114, in _q
    sample = await self._fetch_futures.wait_for(command, self.TIMEOUT)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/__init__.py", line 50, in wait_for
    return await asyncio.wait_for(self._futures.get(name), timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/tasks.py", line 492, in wait_for
    raise exceptions.TimeoutError() from exc
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/main.py", line 35, in fetch_loop
    await fn()
  File "/app/main.py", line 280, in fn
    raise exceptions[0]
  File "/app/main.py", line 275, in fn
    await t()
  File "/app/bmslib/sampling.py", line 69, in __call__
    return await self.sample()
           ^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/sampling.py", line 97, in sample
    sample = await bms.fetch()
             ^^^^^^^^^^^^^^^^^
  File "/app/bmslib/daly.py", line 128, in fetch
    status = await self._fetch_status()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/daly.py", line 155, in _fetch_status
    response_data = await self._q(0x93)
                    ^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/daly.py", line 116, in _q
    n_recv = num_responses - self._fetch_nr[command].count(None)
                             ~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 147

END
@fl4p
Copy link
Owner

fl4p commented Jul 24, 2023

I'll fix this with the next update

@fl4p
Copy link
Owner

fl4p commented Jul 25, 2023

0.0.64 should fix it, please re-open if not

@fl4p fl4p closed this as completed Jul 25, 2023
@fl4p
Copy link
Owner

fl4p commented Jul 25, 2023

Duplicate of #107

@fl4p fl4p marked this as a duplicate of #107 Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants