JsBergbau / MiTemperature2

Read the values of the Xiaomi Mi Bluetooth Temperature sensor 2 including custom encrypted format.
705 stars 162 forks source link

illegal instruction in ATC mode #104

Closed lsroka76 closed 2 years ago

lsroka76 commented 2 years ago

Hi,

i've installed everything according to instructions on my Pi Zero W but script crashes with "illegal instruction" when used with --atc. There are no issues without --atc switch. I tried everything including reinstallation of Pi system from scratch.

JsBergbau commented 2 years ago

Hi Isroka76,

thanks for your report. Based on your post this sounds so far either as bug in some python version or maybe even a hardware problem with your Pi Zero W. Please post detailed steps of how you installed your Pi and MiTemperature2 script as well es the complete commandline running MiTemperature2 script.

lsroka76 commented 2 years ago

I did several attempts, each time starting from scratch (SD format, fresh OS image - Raspberry Pi OS Lite (32-bit), 10.2021 using Raspberry Pi Imager). I tried with "sudo apt-get dist-upgrade" and without it...I even tried to built Bluez from sources.

Nothing helps - script works perfectly with 5 sensors, but with --atc it ends with "illegal instruction" - with and without sudo.

Regarding MiTemperature2 script I did git clone of your folder.

JsBergbau commented 2 years ago

Since there are some requirements to be installed before script can run, please also post all the steps after you have setup the Raspberry PI OS.

lsroka76 commented 2 years ago

sudo apt-get update

sudo apt-get dist-upgrade

sudo rpi-update

sudo apt-get autoclean

sudo reboot

sudo apt-get install -y mc git libssl-dev bc python3-pip supervisor

pip3 install bluepy requests

sudo apt install bluetooth libbluetooth-dev

pip3 install pybluez

sudo setcap cap_net_raw,cap_net_admin+eip $(eval readlink -f which python3)

JsBergbau commented 2 years ago

It seems to be a problem with pycryptodomex library.

Please uninstall current version with pip3 uninstall pycryptodomex and then install older version pip3 install pycryptodomex==3.11

Then it will work.

lsroka76 commented 2 years ago

It works! Thank you :-)

JsBergbau commented 2 years ago

Old version is not needed any longer. pip3 install pycryptodomex works again.