I have a new L3 heatpump monitor and after updating to the latest version i am unable to connect to my EmonTH nodes, looking in the logs it looks like the SPI interface is failing to be created. can anyone help?
2024-08-01 15:58:37,365 INFO MainThread EmonHub v2.6.13
2024-08-01 15:58:37,366 INFO MainThread Opening hub...
2024-08-01 15:58:37,366 INFO MainThread Running as user: pi
2024-08-01 15:58:37,366 INFO MainThread Logging level set to DEBUG
2024-08-01 15:58:37,367 INFO MainThread Creating EmonHubOEMInterfacer 'EmonPi2'
2024-08-01 15:58:37,368 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2024-08-01 15:58:37,369 INFO MainThread Creating EmonHubRFM69LPLInterfacer 'SPI'
2024-08-01 15:58:37,389 INFO MainThread Creating RFM69 LowPowerLabs interfacer
2024-08-01 15:58:37,389 INFO MainThread RFM69 node_id = 5
2024-08-01 15:58:37,390 INFO MainThread RFM69 network_id = 210
2024-08-01 15:58:37,390 INFO MainThread RFM69 interruptPin = 22
2024-08-01 15:58:37,390 INFO MainThread RFM69 resetPin = 24
2024-08-01 15:58:37,390 INFO MainThread RFM69 selPin = 16
2024-08-01 15:58:37,391 INFO MainThread Starting radio setup
2024-08-01 15:58:37,992 ERROR MainThread Unable to create 'SPI' interfacer: Failed to add edge detection
Thanks
Interesting, what update did you run?
I’m struggling to think how an update could cause this, this error is usually cased by a hardware issue. On the emonPi2 the RF module is directly connect to the RaspberryPi SPI, it’s not related to the emonPi2 firmware.
I simply just carried out the full update. I don’t mind trying anything out through ssh but I don’t have the credentials to test anything out. It was all working fine before the update. Happy to give you remote access to investigate.
Barry
Ok, I’ve been able to replicate. It looks like the Full Update has updated kernel from 6.1.0
to 6.6.31
which seems to have broken SPI via RPi.GPIO.
The new kernel interface for gpio access has changed from library gpio
to lgpio
. Switching from python package rpi-gpio to rpi-lgpio might be a possible solution, but it doest seem to work.
I need to head home now, but I’ll continue working on this later. Rolling back the kernel may be an interim solution.
Going forward, I think we need to limit the updating that Full Update does to avoid situations like this @TrystanLea.
Sounds positive, thanks for all your help Glyn, let me know if there is anything you want me to do.
I’ve tracked this issue down to the attempted update of libbluetooth-dev in emonhub/install.sh:
echo "installing or updating emonhub dependencies"
sudo apt-get install -y python3-serial python3-configobj python3-pip python3-pymodbus bluetooth libbluetooth-dev python3-spidev
# removed libbluetooth-dev as this was causing a kernel update
I have removed libbluetooth-dev as mentioned in the comment in the latest version of emonhub and have pushed this to stable. This should sort further systems being updated but does not unfortunately help you yet @barryward .
Looking into the best way to solve the issue once the kernel has been updated next.
Would it be possible for me to reflash the SD card images and restore the config from backup? Just wanted to check as I’m running one of the prebuilt EmonHP installs. Or should I just be patient and wait lol.
I think this could be the quickest way to get you back up and running. I’ve emailed you a link to download the SD card image.
Update: see Trystan post below
Hello @barryward I’ve fixed this for you on your system. No need to write a fresh SD card.
I’ve put the changes required to get this working on the more recent kernel versions in a emonHub development branch called: lgpio.
These are the steps to upgrade/fix:
cd /opt/openenergymonitor/emonhub
git fetch
git checkout lgpio
./install.sh
This also works on the 6.1.x kernel but for those on 6.6.x a reboot is also required after running the above.
sudo reboot
1 Like