How to control any of the pins in RJ45 socket


how can I control, e.g. pin 8 (ADC6/D20), of the RJ45 socket?

My first attempt was to play with GPIO17, which shuts down the emonpi right after pulling to 1…


GPIO17 of the Pi is connected to D5 of the AVR and used for shutting down the emonPi, to free up that pin you would need to alter both the emonPi firmware sketch and the shutdown script on the Pi itself, this will obviously have a impact on the emonPi ‘shutdown’ functionality.

I think RJ45p8 (ADC6/D20) is controlled exclusively by the emonpi boards AVR ADC6/D20 pin. If you are not using lightwaveRF OOK (transmitter not fitted) and have a emonPi v1.6 you could use the link from the Pi’s GPIO pin 12 (GPIO18) to the AVR’s D6 and alter the emonpi firmware to relay D6 input to D20 output (v1.5 doesn’t have the OOK/GPIO connection). You may need to disable the lightwaveRF script or remap it’s OOK pin too.

If you are handy with a soldering iron, take a look at the schematics there are a range of Pi GPIO’s that are not connected to the emonpi board, (ie do not have tracks to/from the connector pins) you might find one of those suitable to tack a jumper wire directly to the back of the GPIO socket on the emonpi board and to the unpopulated ADC6/D20 screw terminal located under the RJ45 (the other side of the PCB should be accessible), this would avoid any need for software/firmware changes to the emonPi stuff, just add your control software to the Pii for the currently unused GPIO pin.

Note I haven’t tried these, i’m just suggesting somethings for you to look into and confirm for yourself before trying, I’m working from the wiki and schematics alone.

emonpi wiki
emonpi v1.5 schematic
emonpi v1.6 schematic

1 Like


thanks for your quick reply. I’ve hoped for an easier solution. I guess this means soldering for me…