# EmonHP L3 issue after update: RFM69 SPI failed to add edge detection

**URL:** <https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511>\
**Category:** emonTH\
**Tags:** rfm69\
**Created:** [3 August 2024 11:13 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511 "2024-08-03T11:13:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![barryward](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@barryward](https://community.openenergymonitor.org/u/barryward)\
**Post date:** [3 August 2024 11:13 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/1 "2024-08-03T11:13:18Z")

</div>

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?

```auto
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

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [5 August 2024 16:45 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/2 "2024-08-05T16:45:50Z")

</div>

Interesting, what update did you run?

 ![Screenshot from 2024-08-05 17-44-06](https://community.openenergymonitor.org/uploads/default/original/3X/4/e/4e0c4d8bb2250fcb5713ab3e6dcf803b9c5dcf96.png)

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.

---

<div class="post-metadata">

**Author:** ![barryward](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@barryward](https://community.openenergymonitor.org/u/barryward)\
**Post date:** [5 August 2024 17:31 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/3 "2024-08-05T17:31:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [5 August 2024 21:19 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/4 "2024-08-05T21:19:04Z")

</div>

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](https://pypi.org/project/RPi.GPIO/) to [rpi-lgpio](https://pypi.org/project/rpi-lgpio/) might be a [possible solution](https://forums.raspberrypi.com/viewtopic.php?t=367169), 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.

---

<div class="post-metadata">

**Author:** ![barryward](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@barryward](https://community.openenergymonitor.org/u/barryward)\
**Post date:** [5 August 2024 22:12 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/5 "2024-08-05T22:12:31Z")

</div>

Sounds positive, thanks for all your help Glyn, let me know if there is anything you want me to do.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [6 August 2024 12:48 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/6 "2024-08-06T12:48:27Z")

</div>

I’ve tracked this issue down to the attempted update of libbluetooth-dev in emonhub/install.sh:

```auto
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.

---

<div class="post-metadata">

**Author:** ![barryward](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@barryward](https://community.openenergymonitor.org/u/barryward)\
**Post date:** [6 August 2024 18:14 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/7 "2024-08-06T18:14:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [6 August 2024 23:09 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/8 "2024-08-06T23:09:43Z")

</div>

~~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

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [7 August 2024 16:04 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/9 "2024-08-07T16:04:42Z")

</div>

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:

```auto
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

```

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [3 July 2025 17:00 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/10 "2025-07-03T17:00:40Z")

</div>

Resurrecting this topic, while preparing the new emonSD image it seems we now need lgpio as standard. I’ve merged this into the master branch of emonhub for testing.

**A reboot is required** after updating emonHub, I cant find another way around that at the moment. There is also a related change to emonPiLCD to also use rpi-lgpio.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [4 July 2025 10:17 UTC](https://community.openenergymonitor.org/t/emonhp-l3-issue-after-update-rfm69-spi-failed-to-add-edge-detection/26511/11 "2025-07-04T10:17:29Z")

</div>

I’ve modified the update scripts to provide a message at the end when a reboot is required:  
This message will appear if a modification has been made to /boot/config.txt e.g changing the SPI chip select pin. A reboot is required for RFM69 radio data to continue being received.

 ![image](https://community.openenergymonitor.org/uploads/default/original/3X/4/8/486328211da3c8ce952bb45a3840b83543243e4b.png)
