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

Get Error AC200MAX and Python 3.10 on Windows10 #7

Closed
fluchderpixel opened this issue Jul 26, 2022 · 1 comment · Fixed by #8
Closed

Get Error AC200MAX and Python 3.10 on Windows10 #7

fluchderpixel opened this issue Jul 26, 2022 · 1 comment · Fixed by #8

Comments

@fluchderpixel
Copy link

Hi warhammerkid,

at first, thanks for your work!!!!

I'm not a programmer and my english is terribel :-)

At first I used the "bluetti-logger --scan" options and get an Error:

PS C:\Users\fluch> bluetti-logger --scan

Scanning....
Traceback (most recent call last):
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\Scripts\bluetti-logger.exe_main
.py", line 7, in
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\logger_cli.py", line 119, in main
asyncio.run(scan())
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\logger_cli.py", line 24, in scan
bluetti_devices = [d for d in devices if prefix.match(d.name)]
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\logger_cli.py", line 24, in
bluetti_devices = [d for d in devices if prefix.match(d.name)]
TypeError: expected string or bytes-like object

I changed the Code in logger_cli.py at line 24 and I dont get any error now:

bluetti_devices = [d for d in devices if d.name and prefix.match(d.name)]

I think some bluetooth devices has no name and we must check this.

PS C:\Users\fluch\bluetti> bluetti-logger --scan
Scanning....
Found AC200M214200020XXXX: address 00:15:83:8A:F4:71

In the next step I used the "bluetti-logger--log" option and get an Error:

PS C:\Users\fluch\bluetti> bluetti-logger --log test.log 00:15:83:8A:F4:71
Connecting to 00:15:83:8A:F4:71
Waiting for connection...
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<BluetoothClient.run() done, defined at C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\bluetooth\client.py:36> exception=TimeoutError()>
Traceback (most recent call last):
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\asyncio\locks.py", line 214, in wait
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 456, 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 "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\bluetooth\client.py", line 51, in run
await self.client.disconnect()
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bleak\backends\winrt\client.py", line 314, in disconnect
await asyncio.wait_for(event.wait(), timeout=10)
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 458, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

When I use the "bluetti-mqtt" I get this error:

PS C:\Users\fluch\bluetti> bluetti-mqtt --broker 192.168.188.204 --username Mqtt --password test 00:15:83:8A:F4:71
INFO:root:Connecting to clients: {'00:15:83:8A:F4:71'}
INFO:root:Starting to poll clients...
INFO:root:Connecting to MQTT broker...
Traceback (most recent call last):
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\Scripts\bluetti-mqtt.exe_main
.py", line 7, in
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\server_cli.py", line 116, in main
cli.execute()
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\server_cli.py", line 58, in execute
asyncio.run(self.start(args))
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\fluch\AppData\Local\Programs\Python\Python310\lib\site-packages\bluetti_mqtt\server_cli.py", line 88, in start
signals = (signal.SIGHUP, signal.SIGTERM, signal.SIGINT)
AttributeError: module 'signal' has no attribute 'SIGHUP'

I don't now, is the error in bluetti-mqtt or in the MQTT-Broker. The MQTT-Broker is runing as Mosquito MQTT on a Home Assistant Raspberry 4.

So, I hope you can help :-)

Thanks so lot!!!

@warhammerkid
Copy link
Owner

@fluchderpixel This will be fixed in the next version released some time later today (I still have some work I want to do).

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

Successfully merging a pull request may close this issue.

2 participants