Mercer
Posts: 2
Joined: Tue Apr 19, 2016 7:27 pm

Energenie Wall plugs & Raspberry PI

Tue Apr 19, 2016 7:28 pm

I just got a Raspberry Pi 3 and have been having the most frustrating time. http://www.penguintutor.com/raspberrypi/pi-power
I have been using this tutorial to get my Energie plugs working and I am not sure what is going wrong
I have the RPi module plugged in on the side closest to the SD card, the plug is flashing with a red LED, I've loaded the web address but nothing appears to happen
both bottle and energie are installed - do I have to move them? Would realy appreciate the help!

Mercer
Posts: 2
Joined: Tue Apr 19, 2016 7:27 pm

Re: Energenie Wall plugs & Raspberry PI

Wed Apr 20, 2016 5:40 pm

Hopefully this is allowed -- bump.

User avatar
B.Goode
Posts: 8820
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Energenie Wall plugs & Raspberry PI

Wed Apr 20, 2016 5:55 pm

These Raspberry Pi forums are 'staffed' by volunteers. Not all volunteers have the same interests and experience - maybe noone with the ability to comment knowledgeably on your specific issue has logged in during the last day.

In the meantime: have you checked the installation and functioning of the PiMote controller and the pairing with the remote switches by running the demo code on the Energenie website, here: https://energenie4u.co.uk/catalogue/dow ... 002-2PI.py

User avatar
penguintutor
Posts: 376
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: Energenie Wall plugs & Raspberry PI

Sun Apr 24, 2016 5:22 pm

I'm not sure what you mean from your post.

What do you mean by "I've loaded the web address but nothing appears to happen" - do you get to the web page showing the on/off buttons or do you not get that far?

Also have you registered the Pi-Mote with the socket by using the on button after plugging in the socket?

If you are looking to coding the Energenie plugs from within Python then the Energenie board has now been added to GPIO Zero which is at https://gpiozero.readthedocs.org/en/v1. ... #energenie ( you will need to update you GPIO Zero on your Raspberry Pi first).

User avatar
penguintutor
Posts: 376
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: Energenie Wall plugs & Raspberry PI

Sat Apr 30, 2016 11:30 pm

I have now updated the code to use the GPIO Zero module instead of the Energenie module used previously.

Also thanks to other updates to the Raspbian image and converting the startup to systemd the install is now slightly easier.

Details are provided on my website: http://www.penguintutor.com/raspberrypi/pi-power
including a link to the github page at: https://github.com/penguintutor/pi-power

I hope this helps.

User avatar
B.Goode
Posts: 8820
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Energenie Wall plugs & Raspberry PI

Wed May 04, 2016 4:29 pm

@PenguinTutor - Stewart

Thank you for your ongoing interest and support.

I was not the original poster in this thread, but this has prompted me to try out a PiMote control board and Energenie remote switch, something I had meant to do for ages.

I can confirm that the web interface, and the energenie interface in its revised form, both work 'out of the box' just as documented. [I moved the web interface to port #3142, so that there is no need to invoke root/admin rights with sudo.]

yewtc
Posts: 4
Joined: Sat Nov 23, 2013 12:03 pm

Re: Energenie Wall plugs & Raspberry PI

Fri May 13, 2016 5:19 pm

I've got the same problem with and RPi3, but it works fine with RpiB. I'm guess the driver needs updating.

User avatar
B.Goode
Posts: 8820
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Energenie Wall plugs & Raspberry PI

Sat May 14, 2016 1:24 pm

yewtc wrote:I've got the same problem with and RPi3, but it works fine with RpiB. I'm guess the driver needs updating.
I don't have an RPi3: I see that you and @mercer (the OP) both do.

As I understand it there is no 'driver' involved. The interface from the RPi to the PiMote adapter is simply 6 GPIO pins.

I have seen 3 different implementations, in python, of a script to talk to the PiMote. The one published by Energenie themselves; the one published by @PenguinTutor based on gpiozero; and an earlier implementation from the RPF based on RPi.GPIO prior to the release of gpiozero. All drive the gpio pins - and thus the pimote adapter - directly.

Lacking hands-on experience with an RPi3 I don't see - from my knowledge of it from documentation - why the gpio handling would be different to the RPi2B running Raspbian Jessie that I tested. Perhaps @PenguinTutor might be able to comment?

Have you tried the 3-line basic recipe from the gpiozero documentation:

Code: Select all

from gpiozero import Energenie

lamp = Energenie(1)
lamp.on()
ref: http://gpiozero.readthedocs.io/en/v1.2. ... #energenie

(You will need to use a long press on the green button on the socket to put it into 'learning' mode to pair it with the PiMote.)

[Added later postscripts -
1. There are both Green button and Purple button socket-and-transmitter sets, with different interfaces. My experience is with the Green button version, and I am pretty sure that is what @PenguinTutor has documented.

2. If you have code that works on an earlier RPi, you can probably 'pair' the PiMote and Socket using that code and then transfer the Pimote to the RPi3 before trying the gpiozero test.
- end of Postscript ]

yewtc
Posts: 4
Joined: Sat Nov 23, 2013 12:03 pm

Re: Energenie Wall plugs & Raspberry PI

Sun May 15, 2016 12:12 pm

I wasn't sure about the "driver" as such, but there is this on the energenie web site:
"We have recently been made aware of the bcm library change for
the Raspberry Pi 2. The bcm library (2835 - 1.37) does not
support the new device tree introduced in the BCM2836 based
kernels, so it gets the wrong peripheral base address for GPIO
and SPI peripherals (it changed address on the new quad -
core device). As far as we can see BCM2835 - 1.5 does work
on the Raspberry Pi 2"

Given that the Rpi3 use the BSM 2837 - I was wondering if there was an issue.

Anyway I used the gpiozero sample code and it works in the RPiB and not on the RPi3.

Their (energenies) code is the same - works on RpiB and not on RPi3.

When I say that nothing works, that isn't strictly true. The LEDs go on and off, the switches don't go on and off. In fact if I reset them, they leds keep flashing implying the sockets haven't picked up their ids.

I agree I can see nothing in the gpio pin outs of the two boards that shows any issues.

User avatar
B.Goode
Posts: 8820
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Energenie Wall plugs & Raspberry PI

Sun May 15, 2016 3:20 pm

yewtc wrote:I used the gpiozero sample code and it works in the RPiB and not on the RPi3.
If you have a reproducible test case for this I think it would be valuable to report it to the gpiozero developers here:
https://github.com/RPi-Distro/python-gpiozero/issues

WindyMiller
Posts: 6
Joined: Sat Dec 08, 2012 7:06 pm

Re: Energenie Wall plugs & Raspberry PI

Sun Jan 29, 2017 9:53 am

Hi, I've followed the guide in https://github.com/penguintutor/pi-powe ... INSTALL.md but getting the below error:

sudo /home/pi/pi-power/web-power.py
Traceback (most recent call last):
File "/home/pi/pi-power/web-power.py", line 20, in <module>
from gpiozero import Energenie
File "/usr/lib/python3/dist-packages/gpiozero/__init__.py", line 58, in <module>
from .devices import (
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 18, in <module>
import pkg_resources
ImportError: No module named 'pkg_resources'

Any ideas?
Thank you :)

DirkS
Posts: 9956
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Energenie Wall plugs & Raspberry PI

Sun Jan 29, 2017 10:05 am

WindyMiller wrote:ImportError: No module named 'pkg_resources'
That module is part of 'setuptools'.

Try

Code: Select all

sudo apt-get update
sudo apt-get install python3-setuptools

WindyMiller
Posts: 6
Joined: Sat Dec 08, 2012 7:06 pm

Re: Energenie Wall plugs & Raspberry PI

Tue Jan 31, 2017 10:01 am

Thanks a lot. That worked !

Return to “Troubleshooting”