juanboro / cync2mqtt

Bridge Cync bluetooth mesh to mqtt
38 stars 7 forks source link

Does not work with Python 3.10+ #17

Closed ecrode closed 2 years ago

ecrode commented 2 years ago

Having an issue with mqtt client on python 3.10, downgrading to 3.9 is a temporary solution. Error I get is as follows: /home/gene/venv/cync2mqtt/bin/cync2mqtt:373: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() 2022-08-14 15:09:00,542 - cync2mqtt - ERROR - MQTT Connection failed: As of 3.10, the loop parameter was removed from Event() since it is no longer necessary

Thereafter program states that the next connection attempt will be in 10 minutes, have not waited to verify if it would attempt again.

juanboro commented 2 years ago

Hi - See if the update I just checked in fixes it. I'll also see about getting python3.10 installed in my local env to test further. thanks.

juanboro commented 2 years ago

I've tested with a 3.10 venv on my Raspberry Pi2W and it still has issues - I will look more this evening:

~/venv_310/cync2mqtt/bin/cync2mqtt ~/my_cync.yaml
2022-09-16 10:03:00,278 - cync2mqtt - ERROR - MQTT Connection failed: As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary
2022-09-16 10:03:00,279 - cync2mqtt - ERROR - Will attempt reconnect in 10 minutes

Looks like AMQTT - so I'll have to see if there are updates there.

juanboro commented 2 years ago

AMQTT doesn't yet have a released version supporting python3.10, but the version on main does. For now, to install with python3.10 - you need to install with that version, with a set of commands like this:

git clone https://github.com/juanboro/cync2mqtt.git src_cync2mqtt
~/venv_310/cync2mqtt/bin/pip3 install -r src_cync2mqtt/requirements.python3.10.txt  src_cync2mqtt/

I'll update the README file and close this.