dauden1184 / RaspiNukiBridge

Simple Nuki Bridge implementation using asyncio
GNU General Public License v3.0
48 stars 19 forks source link

crc16 PY_SSIZE_T_CLEAN #29

Open piferrari opened 9 months ago

piferrari commented 9 months ago

After preparing my virtual environment

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
$ python3 -m venv .venv
$ source .venv/bin/activate
$ python3 --version
Python 3.10.12
$ python3 -m pip install -r requirements.txt
$ python3 . --generate-config > nuki.yaml

It fail to pairing with this message:

File "/home/ubuntu/RaspiNukiBridge/./nuki.py", line 643, in pair
    cmd = self._prepare_command(NukiCommand.REQUEST_DATA.value, payload)
  File "/home/ubuntu/RaspiNukiBridge/./nuki.py", line 269, in _prepare_command
    crc = crc16.crc16xmodem(message, 0xffff).to_bytes(2, "little")
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

The problem is known here

I temporarily fixed the problem using this fork in the requirements.txt file

requirements.txt

aiohttp==3.8.1
bleak==0.14.0
PyNaCl==1.3.0
PyYAML==6.0
git+https://github.com/ljelen/pycrc16.git

Best regards